Commit Graph

32900 Commits

Author SHA1 Message Date
ragge
32923df5d6 Fix a signal handler bug originally reported by Hugh Graham some year ago:
If two signals are sent after each other without the process being run in
userspace between them then the second one will overwrite part of the signal
info stored on the userstack.
Fixed by rewriting and simplifying both the signal delivery code and the
trampoline code. Also bump signal version number to 2.
2002-09-12 18:22:23 +00:00
abs
4bebaafe44 Protect extern zstty_cd with (NKBD > 0) || (NMS > 0) 2002-09-12 12:51:37 +00:00
scw
a9c1bc6c83 Add code to deal with the "Cache Purge/Invalidate can cause TLB Miss"
problem, such that a TLB miss no longer occurs.

With the above, it is now safe to enable write-back caching for userland
mappings.

TODO: Deal with cache issues for shared mappings with different VAs.
2002-09-12 12:44:13 +00:00
scw
7e0aa6fcfc sh5_setasid() now returns the original ASID value. 2002-09-12 12:39:34 +00:00
scw
a73ea332f6 Adapt to new cacheops requirements. 2002-09-12 12:38:42 +00:00
scw
22569e09ed The cacheops functions now need the physical address of the region
to be purged/invalidated.
2002-09-12 12:37:49 +00:00
scw
b0ecf76dd4 sh5_setasid() now returns the value of the previous ASID. 2002-09-12 12:35:00 +00:00
matt
02573a8516 Add non-_KERNEL variants so regress/sys/kern/lock will compile. 2002-09-12 07:31:13 +00:00
martin
000826593a Make kernels without KTRACE work. 2002-09-11 20:19:45 +00:00
mycroft
3294e33d95 Don't blindly receive all multicast packets just because we're on a turbo.
Pay lip service to making promiscuous mode work.
2002-09-11 13:15:58 +00:00
scw
08dfbb4305 - Be more consistent about using ptel_t where it matters.
- Add event counters for some key pmap events (similar to mpc6xx pmap).

 - Use the cache-friendly, optimised copy/zero page functions.

 - Add the necessary cache management code to enable WriteBack caching
   of KSEG1 mappings. Seems to work fine so far.
2002-09-11 11:08:45 +00:00
scw
ecb4124668 - Add cache-friendly, optimised copypage/zeropage functions for use by
the pmap module.

- Add {,e}intrnames and {,e}intrcnt to keep kernel-symbol grovelling
  tools like vmstat(8) happy.
2002-09-11 11:03:08 +00:00
scw
b08dae4d46 Tweak the interrupt names to properly match reality. 2002-09-11 10:57:50 +00:00
scw
e47c955f01 Get the correct evcnt structure and ipl number when initialising softints. 2002-09-11 10:56:43 +00:00
scw
2b0c53084c Slight tweak to save one instruction in the pteg TLB miss case. 2002-09-11 10:55:05 +00:00
simonb
6ebf56cc52 Use AU1500_MAC0_BASE as well as a test for setting the MAC addresses
of the on-chip interfaces.
2002-09-11 08:30:48 +00:00
mycroft
f13a876c12 Remove straggling NEXT_TURBO #ifdefs. 2002-09-11 07:17:33 +00:00
mycroft
d6a62735b7 Attach nextdisplay on the mono turbo. 2002-09-11 07:06:16 +00:00
mycroft
8ac5416160 In en_put(), if we don't get a packet, just return 0. This is how we tell
the libsa code to retransmit.
2002-09-11 06:32:07 +00:00
mycroft
d5e3432796 Don't know whether it works, but enable the '030 support for the Hell of it. 2002-09-11 04:17:01 +00:00
mycroft
a0688f1086 Determine turbo-ness based on the ROM machine type here, too. 2002-09-11 02:17:14 +00:00
mycroft
c618f2cc87 Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
  non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
  attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
  turbo machines).
* The boot block is prone to timing out.
2002-09-11 01:46:29 +00:00
scw
151ee8c81a Fix a devsw merge botch. 2002-09-10 21:10:18 +00:00
scw
bd0dd2e2e1 Add "machine fpr" command. This dumps the FPU registers for the current,
or a specified, process.
2002-09-10 12:44:38 +00:00
scw
fe2f8acf65 Another big round of pmap fixes/cleanup:
- Use the PMAP_ASID_* constants from pmap.h

 - Track pmap_pvo_{enter,remove}() depth in the same way as mpc6xx's pmap
   (on which this pmap was originally based).

 - Some misc. tidying up and added commentary.

 - Use the VA/KVA to select whether to use the IPT or PTEG instead of
   checking which pmap is being operated on.

 - Add a handy DDB-callable function which will scan the kernel IPT
   looking for inconsitencies.

 - Finally, when unmapping a pool page, purge the data cache for the
   page. This permits write-back caching to be enabled for kernel
   text/data.
2002-09-10 12:42:03 +00:00
scw
bcf9491257 Always save/restore the FPSCR into/from the sigcontext. 2002-09-10 12:33:44 +00:00
scw
1a8208566d - Remove the RESVEC vector table (panic/debug traps). It's now in
machine-specific code.

 - Re-work the code which detects a nested critical section event.
   We can now determine who is the owner of the critical section, and
   what event occurred while it was owned.

 - Work-around a silicon bug which can cause a nested critical event.
   In the _EXCEPTION_ENTRY() macro (which sets up the critical section),
   if there is a pending hardware interrupt which has a higher priority
   than the current IMASK, then the "putcon" which supposedly clears SR.BL
   and sets SR.IMASK to 0xf is not atomic. The pending hardware interrupt
   will be taken, causing a nested critical section event. The work-around
   is to update SR.BL and SR.IMASK separately using two "putcon" insns.
2002-09-10 12:27:21 +00:00
scw
cd4797ccfa - Give a process a SIGFPE if it gets an FPU exception.
- Make it possible to at least *try* to resume execution if we
   get an NMI.
 - Major clean-up of the panic/critical section trap handlers.
   The dumped state is now much more accurate.
2002-09-10 12:15:39 +00:00
scw
5359676ddc - Add some comments,
- Fully initialise the FPU state (if enabled),
 - Implement delay() in assembly code.
2002-09-10 12:11:03 +00:00
scw
c65ee4aa71 Add the critical section types, and cache mode values.
Delete a couple of unused struct cpu_info fields.
2002-09-10 12:08:49 +00:00
scw
d9d434b5ed Always save/restore the FP status/control register across a context switch
(If the FPU is enabled).

Add a DEBUG check to ensure the incoming context's SR is sane.
2002-09-10 12:06:49 +00:00
scw
d7e84a627e - Remove the version of delay() which used the cycle counter register.
There were some problems related to wrap-around which lead to
   delaying much longer than requested.
 - Cacheops additions.
2002-09-10 11:59:50 +00:00
scw
0d7cafd74b Add a few more cpu-specific cacheop functions. 2002-09-10 11:56:32 +00:00
scw
7fa549e8d4 Move the RESVEC vector table/handlers to here, since some if it is,
essentially, machine dependent.
2002-09-10 11:53:14 +00:00
scw
fdd9155a03 Manifest constants for errors pertaining to recursive critical section
handling.
2002-09-10 11:51:01 +00:00
dbj
c1005e24ba reorganized code slightly that converts a partition map to a disklabel.
No functional change intended by this commit.
2002-09-10 11:31:10 +00:00
dbj
1771e13a7e added defines for new partition types found in the wild:
"Apple_UFS"
  "Apple_Boot"
  "Apple_Loader"
  "Linux"
  "Linux_swap"
removed duplicate define for "Apple_Patches"
2002-09-10 11:28:56 +00:00
scw
d2336580d6 Manifest constants for ASID values. 2002-09-10 11:11:44 +00:00
scw
8cd70003d7 Add external reference for _sh5_delay_constant. 2002-09-10 11:11:12 +00:00
gmcgarry
857f23b69e Garbage-collect unused sdreset(). Remove commented-out prototypes. 2002-09-10 04:19:57 +00:00
simonb
db5e8d65c9 Fix tyop in local function name. 2002-09-10 00:52:37 +00:00
simonb
e2125ae174 Share disksubr.c across all evbmips "ports" (it was identical). 2002-09-09 06:40:40 +00:00
simonb
221f834ea3 Remove some unused code. 2002-09-09 06:36:39 +00:00
simonb
f41231cffc Fix the order of the CPU revision and company options fields in the cpu
table for the Alchemy CPUs; successfully recognises an Au1500 now.
2002-09-09 03:42:04 +00:00
simonb
0f1300fa95 Remove commented-out NFS_BOOT_RWSIZE option. 2002-09-09 02:36:11 +00:00
simonb
54ef88d289 In the idle functions, set curproc to NULL and (#ifdef LOCKDEBUG) call
sched_unlock_idle before enabling interrupts.  LOCKDEBUG kernels now
boot successfully.

Thanks to Chris Gilbert for helping fix this.
2002-09-09 02:32:38 +00:00
simonb
378a5c4c85 Include "opt_lockdebug.h" here to #ifdef LOCKDEBUG actually does something. 2002-09-09 01:03:10 +00:00
tsutsui
be0f4cfb13 Rename some auto variables which might cause misleadings. 2002-09-08 05:35:42 +00:00
scw
7af71ec12b Some tidying up, and a fix for an event counter array overrun
which was responsible for corrupting the kernel IPT.
2002-09-07 20:43:32 +00:00
tsutsui
bf49a76d3b Call setcontext{4,4m}() directly when we already know the CPU type.
(inspired by OpenBSD)
2002-09-07 18:51:05 +00:00