Commit Graph

417 Commits

Author SHA1 Message Date
scw
52c15bbd20 Don't drop to spl0 in cpu_switch/cpu_switchto. Do it in the idle loop
instead.

With this change, we no longer need to save the current interrupt level
in the switchframe. This is no great loss since both cpu_switch and
cpu_switchto are always called at splsched, so the process' spl is
effectively saved somewhere in the callstack.

This fixes an evbarm problem reported by Allen Briggs:

        lwp gets into sa_switch -> mi_switch with newl != NULL
            when it's the last element on the runqueue, so it
            hits the second bit of:
                if (newl == NULL) {
                        retval = cpu_switch(l, NULL);
                } else {
                        remrunqueue(newl);
                        cpu_switchto(l, newl);
                        retval = 0;
                }

        mi_switch calls remrunqueue() and cpu_switchto()

        cpu_switchto unlocks the sched lock
        cpu_switchto drops CPU priority
        softclock is received
        schedcpu is called from softclock
        schedcpu hits the first if () {} block here:
                if (l->l_priority >= PUSER) {
                        if (l->l_stat == LSRUN &&
                            (l->l_flag & L_INMEM) &&
                            (l->l_priority / PPQ) != (l->l_usrpri / PPQ)) {
                                remrunqueue(l);
                                l->l_priority = l->l_usrpri;
                                setrunqueue(l);
                        } else
                                l->l_priority = l->l_usrpri;
                }

        Since mi_switch has already run remrunqueue, the LWP has been
            removed, but it's not been put back on any queue, so the
            remrunqueue panics.
2003-10-23 08:59:10 +00:00
jdolecek
4bb42bc621 switch ARM to use same minor for /dev/zero as other archs
as discussed on tech-arm@
2003-10-16 12:02:58 +00:00
scw
def6ab457b Remove the #ifdef __XSCALE__ around the strd test as the instruction
is available on any v5E processor.

Pointed out by Richard Earnshaw.
2003-10-15 14:07:03 +00:00
scw
63d24b09fd A couple of Xscale tweaks:
- Use the "clz" instruction to pick a run-queue, instead of using the
   ffs-by-table-lookup method.
 - Use strd instead of stmia where possible.
 - Use multiple ldr instructions instead of ldmia where possible.
2003-10-13 21:44:27 +00:00
scw
3bf49b3ae8 Tweak the read/write data abort check to recognise Xscale's strd/ldrd
instructions.

While the original code matched "strd" just fine, it also matched
the "ldrd" instruction ...
2003-10-13 21:13:30 +00:00
scw
9d9ddf0409 Xscale-optimised b{copy,zero}_page().
Contributed by Wasabi Systems.
2003-10-13 21:03:13 +00:00
scw
063066a055 On Xscale, define PMAP_UAREA() and use it to tweak uarea mappings so
they use the mini D$.

This results in a small performance boost on xscale platforms, since
flushing the main cache on a context switch won't affect the kernel
stack/pcb.
2003-10-13 20:50:34 +00:00
thorpej
68723a995b * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.
2003-10-08 00:28:40 +00:00
matt
73ca535921 Add SA_SIGINFO support for ARM (from Chris Gilbert). 2003-10-05 19:44:58 +00:00
matt
2d54fd3a9c Change some type-punning detected by gcc 3.3.1 to (void *). 2003-09-21 00:26:09 +00:00
agc
81976735fd If we're going to reference SA variables in this file, might as well
include the header file to define them. From Steve Woodford.
2003-09-19 11:42:20 +00:00
cl
2c1366cfee add MD part of SA/pthread pagefault handling on arm 2003-09-18 22:37:38 +00:00
scw
877b3cbe5e Hand-optimised in_cksum/in4_cksum for ARM and XSCALE.
Contributed by Wasabi Systems, with input from Chris Gilbert,
Richard Earnshaw and David Laight.
2003-09-11 18:54:31 +00:00
rearnsha
46af0c9f17 Make sure _ARM32_BUS_DMA_PRIVATE is defined before we pull in any
include files to avoid problems with the rats nest of dependencies.
2003-09-06 09:46:37 +00:00
rearnsha
da86d47fb0 Support for initializing ARM10 processors in write-through mode. 2003-09-06 09:44:10 +00:00
rearnsha
ec2b5e2dfd Support for ARM10E class devices. 2003-09-06 09:42:12 +00:00
mycroft
b715eaff3c Recognize some TI processors -- not that you'd want to use them. 2003-09-03 02:07:07 +00:00
mrg
0e001a53fa make it "static long nil;" as it's used as &nil in an array wanting long *'s.
makes GCC3 happy.
2003-08-25 04:51:10 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
briggs
d4f2e39afc Clear ARM32_DMAMAP_COHERENT in _bus_dmamap_load_buffer for userspace mappings. 2003-07-24 16:22:01 +00:00
lukem
08716eae82 __KERNEL_RCSID() 2003-07-15 00:24:37 +00:00
thorpej
88f63e28d6 Make faulting in DDB continue back in the top-level command
loop properly.
2003-07-09 20:14:14 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
ichiro
4eee2aed2e struct proc * -> struct lwp *
ixp425_com:
add some status flags
2003-06-29 10:51:29 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
chris
93632a0574 Fix for port-arm/21962. Rather than fixing the #ifndef spl0, I removed
the test as spl0 is actually a macro for splx(0). The code now calls
splx(0)

(note building with the #ifdef fixed, caused the build to fail on a
GENERIC acorn32 kernel.)
2003-06-23 09:05:22 +00:00
thorpej
452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
thorpej
cf8a25bdfc Add another devmap routine that allows bootstrap code to register
a devmap reflecting mappings that are created by really early
bootstrap code before pmap_devmap_bootstrap() is called.
2003-06-15 18:18:16 +00:00
thorpej
87d5bba5b3 Replace the ad-hoc "section mapping table" for static device mappings
with a more generic "devmap" structure that can also handle mappings
made with large and small pages.  Add new pmap routines to enter these
mappings during bootstrap (and "remember" the devmap), and routines to
look up the static mappings once the kernel is running.
2003-06-15 17:45:21 +00:00
scw
84f125b78d Modify db_{read,write}_bytes() to do a single 16- or 32-bit read/write if
'size' is 2 or 4 respectively.
This makes reading/writing hardware registers work as expected in all cases.
2003-06-06 10:07:07 +00:00
simonb
b71607572c Remove prototype for strtoul() that was in the wrong place. 2003-06-04 13:30:05 +00:00
kristerw
28f5335a9f Fix LINTSTUB comments. 2003-05-31 01:40:05 +00:00
ichiro
00eb02e3da support IXP425 Intel Network Processor
running on BigEndian
2003-05-23 00:57:23 +00:00
thorpej
fac0ce9387 Remove old pmap support. 2003-05-22 19:18:31 +00:00
thorpej
55073c92c1 Move the new pmap from arm32/pmap_new.c to arm32/pmap.c, fully replacing
the old.
2003-05-21 18:07:07 +00:00
thorpej
c8bed530ac Remove #ifdefs supporting the old pmap, switching fully to the new. 2003-05-21 18:04:42 +00:00
bsh
7ba6ee4ca8 fix warning when KGDB is defined and DDB is not defined. 2003-05-21 06:40:29 +00:00
thorpej
df7c83c4a0 Rewrite pagemove() to use pmap functions, rather than frobbing PTEs
directly.  The old code was totally bogus for the new pmap.  New code
lifted from SH5 port.

Fixes panics in ffs_balloc_ufs2() seen while stress-testing a file
system on an XScale-based server platform.
2003-05-17 00:41:36 +00:00
thorpej
36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
thorpej
b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
thorpej
78fac054fa In db_write_bytes(), use kernel_text rather than KERNEL_TEXT_BASE. 2003-05-03 17:32:59 +00:00
thorpej
69b2e108bb Remove the non-ELF case in db_machine_init(). 2003-05-03 17:29:27 +00:00
thorpej
6923eb1e4a Fix a couple of comments. 2003-05-03 16:18:57 +00:00
thorpej
aae7e372b7 Reduce differences between ARM32_NEW_VM_LAYOUT and not; always pass
the start and end of the kernel managed virtual address space to
pmap_bootstrap() in the new pmap.
2003-05-03 03:49:03 +00:00
thorpej
21b77f9aec Eliminate the last reference to PTE_BASE in the new pmap. 2003-05-02 21:54:38 +00:00
scw
36664b74fa Rework pmap_growkernel() to *not* use the regular pmap_alloc_l2_bucket()
for L2 allocation. This avoids potential recursive calls into
uvm_km_kmemalloc() via the pool allocator.

Bug spotted by Allen Briggs while trying to boot on a machine with 512MB
of memory.
2003-05-02 19:01:00 +00:00
scw
cbf4243cd7 KERNEL_TEXT_BASE is not defined for ARM32_NEW_VM_LAYOUT. 2003-04-29 13:27:21 +00:00
thorpej
b43b1645a2 Use aprint*(). 2003-04-29 01:07:30 +00:00
scw
6b08b996ba Fix the bug reported by Richard Earnshaw in port-arm32/21349.
Make sure to check the access permissions before doing
ref/mod/domain fixups. This is particularly important
on machines with ARM_VECTORS_LOW.
2003-04-28 15:57:23 +00:00