Commit Graph

1302 Commits

Author SHA1 Message Date
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
scw 336806eb55 Overhaul arm32's abort handlers:
- Assume a permission fault is always the result of an attempted
   write, so no need to disassemble the opcode.
   (as discussed with Richard Earnshaw/Jason Thorpe a week or two ago)

 - Split out non-MMU data aborts into separate functions, and deal
   correctly with XScale imprecise aborts. Specifically, the old code
   made no attempt to handle the double abort faults which can occur
   as a result of two consecutive external (imprecise) aborts. This
   was easy to provoke by read(2)ing from a /dev/mem offset which caused
   an external abort. With the old code, this would bring the system
   down instantly, with little clue as to why. (hint: tf_spsr held
   PSR_ABT32_MODE...)

 - Re-write badaddr_read() to use pcb_onfault instead of adding extra
   overhead to data_abort_handler(). A side effect of this is that it
   now benefits from the XScale double abort recovery.

 - Invoke the cpu-specific prefetch/data abort fixup routines only if
   the host cpu actually needs it. On other cpus, the code is optimised
   away.

 - Sprinkle __predict_{false,true} in all the right places.

 - G/C some excess debugging baggage.
2003-10-31 16:30:15 +00:00
simonb 6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
thorpej 920b229e72 "bogus pin" -> "bogus device" in last change. 2003-10-31 01:12:06 +00:00
matt b9e31106e8 Stop some (bogus) gcc unitialized variable warning. 2003-10-30 22:04:39 +00:00
matt a72426fa60 Fix (real) uninitialized error. (Someone familiar with this should see
if is really an error).
2003-10-30 22:03:46 +00:00
skrll d1ef336230 Fix a typo so that hack actually takes effect. 2003-10-30 12:30:39 +00:00
scw 7a55b436b2 Move the alignment fault enable/disable code into macroes to avoid
needless duplication.

Additionally, merge AST handling into the same code.

exception.S and the generic irq_dispatch.S routines have been updated
to use the macroes.

XXX: I have patches for the non-generic IRQ dispatch routines, but they
need testing by someone with hardware.
2003-10-30 08:57:24 +00:00
scw 97e37b6030 In bus_dmamap_sync(), we can no longer rely on the data cache being
flushed on every context switch as an indicator that a mapping is
not resident in the cache.

Instead, used the per-pmap flag maintained by the cpu_switch/pmap code.
2003-10-30 08:44:13 +00:00
mycroft 1588a62950 Whitespace. 2003-10-29 05:48:19 +00:00
mycroft 2f3400cec7 The previous patch was wrong -- mcr does not output anything. Instead give a
junk input (it's not used when the last argument is 0).
2003-10-29 05:47:04 +00:00
mycroft 7a85552554 If something goes wrong, we want to return ENOMEM, not 0! 2003-10-29 05:03:41 +00:00
mycroft a1178ff097 The uninitialized variable in this case was a bug, which could probably be
used to crash the system.
2003-10-29 04:38:50 +00:00
kleink 7b674621bf Retire FPA support from this file at last; suggested by Richard Earnshaw
and not objected to by port-arm.
2003-10-28 21:27:08 +00:00
skrll c5a4c60e2e Compile sys/kern/uipc_socket.c -fno-strict-aliasing for now. PR 23044. 2003-10-28 20:12:00 +00:00
chs b42acb8d26 uninitialized variable. 2003-10-28 15:31:33 +00:00
scw fe5371e8a9 Fix an uninitialised variable warning, reported by Shoichi Miyake
in port-arm/23293.
2003-10-28 08:22:55 +00:00
kleink 060a72601c For convenient use in libc, add unions of the C floating types and their
corresponding structure definitions.
2003-10-27 10:13:48 +00:00
chris 25c741b8a6 Fix up some unitialised variables. 2003-10-26 23:11:15 +00:00
kleink d54b367f5d Remove the FPA extended-precision format entirely; according to Richard
Earnshaw it was never supported by the toolchain.
2003-10-26 15:57:54 +00:00
jdolecek 85204ef973 fix NULL vs. 0 usage 2003-10-26 11:45:46 +00:00
scw 4d7283b3ec Assume that if curpcb is NULL, we're already running with alignment
faults enabled.
2003-10-26 11:34:29 +00:00
scw 43be86e59c Skip the alignment fault enabling code if we came from SVC mode. It's
already enabled in this case.
2003-10-25 21:51:31 +00:00
scw 569efbf106 Oops, forgot to commit this along with the others...
Enable alignment faults on arm32 for both kernel and userland.

If COMPAT_15 and EXEC_AOUT are defined, support per-process
alignment checking where AFLTs are always enabled when running
kernel code and userland ELF binaries, and dynamically disabled/
enabled when switching to/from a.out binaries. This is necessary
in order to execute older a.out binaries, where gcc made
deliberate use of misaligned loads under certain circumstances.
2003-10-25 20:42:49 +00:00
scw 84c17a8163 Enable alignment faults on arm32 for both kernel and userland.
If COMPAT_15 and EXEC_AOUT are defined, support per-process
alignment checking where AFLTs are always enabled when running
kernel code and userland ELF binaries, and dynamically disabled/
enabled when switching to/from a.out binaries. This is necessary
in order to execute older a.out binaries, where gcc made
deliberate use of misaligned loads under certain circumstances.
2003-10-25 19:44:42 +00:00
kleink f6ec7cebf1 Update for FPA long double being 80-bit extended-precision format. 2003-10-25 18:24:28 +00:00
kleink a68b9ea2bd G/c the 128-bit extended-precision format, which is not applicable to
this platform.  Name the 80-bit version the extended format, which it
is for the FPA case according to the ARM7500FE manual.
2003-10-25 18:19:10 +00:00
chris ceb06608ed Don't pass NULL as an integer. 2003-10-24 23:03:50 +00:00
jdolecek 821f341675 add necessary majors for miscellaneous devices, such as missing
wscons/scsi/isdn devices
2003-10-24 08:18:36 +00:00
kleink 422697679e * Move the definitions for types other than single-precision and double-
precision back to machine-dependent headers.  C99 has no strict
  requirement which, if any, extended-precision type `long double' must
  match, and even between 80-bit formats there are differences in
  implementation (m68k vs. x86).
* On arm, consider __VFP_FP__.
2003-10-23 23:26:06 +00:00
scw 1fdc9cd5a1 Add a defflag for __BUS_SPACE_HAS_STREAM_METHODS, and add the
appropriate glue in bus.h, contingent on the option being defined.

This allows stream methods to be available on a port-by-port basis.
2003-10-23 15:03:24 +00:00
scw 41e7743573 Map the expansion bus registers. 2003-10-23 09:32:17 +00:00
scw 0df102009a Add a few more register definitions. 2003-10-23 09:29:36 +00:00
scw 3a414f559e Use pmap_enter() instead of pmap_kenter_pa() as the former automatically
ensures the mapping is cache-inhibited, so we don't have to frob the PTE
directly.
2003-10-23 09:25:44 +00:00
scw 0fd0c83111 A few minor tweaks to the onfault handlers.
Save some instructions in the non-fault return path.
2003-10-23 09:11:35 +00:00
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
skrll 601de4df8c Rename dsrtc to ds1687rtc to avoid conflicting with the MI i2c
ds1307 driver.

Hi Jason.
2003-10-21 08:15:39 +00:00
briggs 093821886e Define SIGTRAMP_VALID(v). 2003-10-18 17:57:06 +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 9be5d4cbe9 Document the need for pcb32_r8 to be quad-aligned, now that cpuswitch()
uses Xscale's "strd" instruction.
2003-10-13 21:46:39 +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 100d67ec52 Xscale-optimised bcopyinout.
Contributed by Wasabi Systems.
2003-10-13 21:22:40 +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