Commit Graph

1346 Commits

Author SHA1 Message Date
gavan f2c2467d5c Correct masks for PCIXSR decomposition 2003-12-19 10:08:11 +00:00
bsh 7020653430 add a function to initialize variables used by splfoo().
This should be called in bootstrap so that splfoo() doesn't touch illegal address.
2003-12-17 13:20:04 +00:00
gavan 5232db351e The PIRSR is at location 0xffffe1ec, not 0xffffe2ec.
Source: Intel(R) 80321 I/O Processor Developer's Manual, page 578
2003-12-16 00:04:09 +00:00
scw 5f0d6f1b24 Work-around an obscure bug (reported by a couple of people, and reproduced
exactly twice by me) which causes the code at the top of copyin which
word-aligns the destination pointer to copy more bytes than necessary,
resulting in an alignment fault later on.

The bug is difficult to reproduce, but as far as I can tell it seems
to be as a result of the condition codes being corrupted, possibly
following a page fault caused by the first ldrbt/strb instructions.
The subsequent ldr<cc>bt/str<cc>b instructions then _always_ execute.
I can't think of any obvious reason why this would happen, though.
2003-12-15 09:27:18 +00:00
scw fbdf861fac The last cpsr_all change was misguided. Just use cpsr_c wherever possible. 2003-12-15 09:18:21 +00:00
rearnsha 94c1474569 The machdep.debug sysctl variable uses code CPU_DEBUG
(not CPU_CONSDEV).
2003-12-13 12:07:41 +00:00
thorpej 648d5e6e22 Add a default case to avoid an uninitialized variable warning. 2003-12-12 16:42:44 +00:00
atatat 74b1767b3c The machdep.debug node is an int, not a struct 2003-12-12 03:52:56 +00:00
jmc 695a2a2f9f Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
2003-12-10 02:04:00 +00:00
scw 2107fae815 Scoot the SDRAM controller's mapping forward to the next 1MB boundary
so it can be mapped easily at startup.
2003-12-08 16:14:16 +00:00
scw 40db825e26 Add support for picking up the size of SDRAM by reading the memory
controller's config register.
2003-12-08 14:41:11 +00:00
scw c2415a0dc3 Oops, map PCI memory space at VA 0xf8000000 instead of in the middle
of user VM space at 0x48000000.
2003-12-08 13:40:33 +00:00
bjh21 df8ccd8d1b Undo last change: The "iomd" driver has its own bus_space tag, so it didn't
rely on the brokenness of the mainbus one.
2003-12-06 22:31:16 +00:00
bjh21 ed4b80b144 Fix the ARM mainbus version of bus_space_subregion() to correctly shift the
base offset before using it.  This makes it work the same as every other
implementation, and makes wdc at pioc on acorn32 work again.  Fix the only
caller I found which depended on the old behaviour.
2003-12-06 22:05:33 +00:00
bjh21 3f1dc2b013 Don't complain if we're asked for != 8 channels. There's no actual support
for fewer channels yet, but this is necessary just to avoid a boot-time panic.
2003-12-06 19:59:32 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
scw ef87776bdb As per the recent ixp425 fix (which is based on this code):
In the interrupt dispatch loop, make sure to handle any pending interrupts
which came in while we were dealing with the first interrupt(s), and which
are enabled at the current spl.

This fixes a problem where the intr_enabled/hw mask is not updated to
allow pending interrupts through until the next splx(). In some case,
interrupts could be delayed until the next clock tick.
2003-12-03 19:55:37 +00:00
scw 99df1a0ae1 In the interrupt dispatch loop, make sure to handle any pending interrupts
which came in while we were dealing with the first interrupt(s), and which
are enabled at the current spl.

This fixes a problem where the intr_enabled/hw mask is not updated to
allow pending interrupts through until the next splx(). In some case,
interrupts could be delayed until the next clock tick.
2003-12-03 13:20:34 +00:00
rearnsha e3cb92a81b Avoid alignment faults in fusword and fuswintr. Also handle big-endian
systems in susword and suswintr.
2003-12-01 13:34:44 +00:00
scw 7cf5104b5a - For consistency, use cpsr_all instead of cpsr.
- Make sure IRQs are enabled before handling ASTs.
2003-12-01 08:48:33 +00:00
bjh21 dd89bf7764 Use kdb_trap() rather than Debugger() to deal with unhandled undefined
instructions in the kernel, so that DDB gets a useful trapframe.  Also
panic if this happens when DDB's not around.
2003-11-29 22:21:29 +00:00
bsh ae462c19db fix typo pointed out by Olivier Houchard. thanks. 2003-11-26 12:17:18 +00:00
rearnsha 445d91a12e Reposition a couple of NOP instructions for better efficiency. 2003-11-26 10:31:53 +00:00
christos a21fdf3b43 bye, bye _MCONTEXT_TO_SIGCONTEXT and vice versa. 2003-11-25 23:11:52 +00:00
scw d657bddd8c In data_abort_handler(), honour pcb_onfault even in the case where
current_intr_depth > 0.
2003-11-20 14:44:36 +00:00
scw 61aab8b582 On a fatal fault, dump the trapframe's contents to the console.
This is useful when DDB is not available, or practical.
2003-11-18 22:39:05 +00:00
scw 5801c73162 - Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
 - Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
 - Re-work the delay() implementation to use the free-running Time-
   Stamp counter. This removes the need to bootstrap TMR0 early on.
2003-11-16 12:41:03 +00:00
scw 07acf64710 Re-instate the behaviour of sending SIGKILL to a process if uvm_fault()
returns ENOMEM. SIGSEGV just doesn't cut it. The original code looks to
have been lost in revision 1.34.
2003-11-15 20:18:34 +00:00
scw a7533e4cdc - Add LOCKDEBUG-protected calls to sched_lock_idle() to cpu_switchto and
the idle loop. They seem to have gone AWOL sometime in the past.
   Fixes port-arm/23390.
 - While here, tidy up the idle loop.
 - Add a cheap DIAGNOSTIC check for run queue sanity.
2003-11-15 08:44:18 +00:00
briggs dfa839f16b Make sure that L_SA_PAGEFAULT gets cleared from l_flag if pmap_fault_fixup
returns non-zero and we want to shortcut out.  This avoids a bogus pagefault
condition being detected in sa_switch().
Many thanks to Christian Limpach for finding this, obviating my band-aid
patch to kern_sa.c (posted on tech-kern).
2003-11-14 21:22:08 +00:00
scw 4eeb1be7e4 Check alignment of the fault PC before de-referencing it.
Give the process a Illegal Instruction fault if the PC is misaligned.
2003-11-14 19:03:17 +00:00
scw a590a31135 - In data_abort_handler(), move the fault pc alignment check to before
the call to data_abort_fixup() as the fixup routines also try to
   de-reference the fault pc.

 - If a fault came from kernel mode, and the fault address looks to be in
   the kernel's address space, and pcb_onfault is *set*, check the
   instruction which caused the fault. If it's LDR{B,}T or STR{B,}T
   then one of the copy in/out routines is trying to read/write a
   kernel address with the wrong privilege. If that address is actually
   mapped, we could end up in an infinite loop because we failed to
   notice that it's really a 'user mode' access. Yay for "crashme".
   I suspect this also fixes PR port-arm/23052.

   Note: This *could* be fixed by adding sanity checks to copyin et al,
   but that would add extra overhead to the non-error path...

 - Fix a couple of __predict_false cases.
2003-11-14 19:00:03 +00:00
scw 571f89c4ad Slight re-org of the alignment/ast exit macro to better mimic the
original behaviour WRT cpsr/I32_bit handling.
2003-11-14 16:57:28 +00:00
scw bb0221494d Since data_abort_handler() may have to decode the instruction at tf->tf_pc
to determine if a fault is read or write, make sure tf->tf_pc is 32-bit
aligned before dereferencing it.

Otherwise, deliver an illegal instruction signal to the process. We don't
support execution of Thumb code at this time.
2003-11-14 00:21:30 +00:00
chs e07f0b9362 eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed.  however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors.  most of
the callers of uvm_useracc() make the above incorrect assumption.  the
rest are all misguided optimizations, which optimize for the case
where an operation will fail.  we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors.  since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
2003-11-13 03:09:28 +00:00
scw f99d0398fb The previous commit had a #endif in the wrong place. 2003-11-11 08:27:16 +00:00
wiz ee1b406595 Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
2003-11-10 08:51:51 +00:00
scw 41d2057ea7 Pick the right value for {,_}MACHINE_ARCH according to endianness.
Spotted by mrg@.
2003-11-09 08:27:19 +00:00
tsutsui 112c91d583 Use #if defined(_KERNEL_OPT) to protect #include "opt_xxx.h"
from building LKM etc. Suggested by mrg.
2003-11-09 05:29:59 +00:00
he c45fa09365 Suppress apparently-bogus -Wunitialized warnings, the compiler does
not detect that set / use occur under equal conditions in following
if() statements.
2003-11-07 18:29:30 +00:00
scw f77bf2bb0c Enable/Restore alignment fault state on interrupt handler entry/exit. 2003-11-05 21:10:59 +00:00
scw aee833c0ee Add "options ARM32_DISABLE_ALIGNMENT_FAULTS" to forcibly disable
alignment fault checking if necessary.

This option gets the acorn32 port working again.

XXX: Richard Earnshaw suggested enabling alignment faults for
XXX: userland only on acorn32. Need to investigate this.
2003-11-05 12:53:15 +00:00
scw 5d63abe1f1 Fix a braino introduced in r1.37. Thanks to Tom Spindler for spotting it. 2003-11-04 22:20:50 +00:00
dsl 2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
scw e9cd075343 It makes more sense to map the expansion bus registers in ixpsip
instead of the pci bridge driver.
2003-11-02 21:24:39 +00:00
scw 21f388f6e0 Add generic read/write region 1 ops. 2003-11-02 21:20:32 +00:00
reinoud 4e923603f1 Fix for PR # 23264 thanks to Mike Pumford; it is only attatching clock once
now.
2003-11-01 23:37:54 +00:00
jdolecek 3abecdb88d avoid stong words in comments 2003-11-01 17:35:42 +00:00
scw b4c2d3dbb0 Insert some nops around the load instructions in badaddr_read_N().
That way, we can be sure any imprecise data abort actually happens
before clearing pcb_onfault.
2003-10-31 16:54:05 +00:00
cl ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00