Commit Graph

919 Commits

Author SHA1 Message Date
cgd 8dbc5c0c51 provide mips3_ld() and mips3_sd(), functions which provide safe wrappers
for mips3 (and later) 'ld' and 'sd' instructions.  These currently
only are properly implemented for the _MIPS_BSD_API_LP32 and
_MIPS_BSD_API_LP32_64CLEAN 'API's.  They're pretty messy, but when you
need them, you really need them.
2000-10-02 22:13:38 +00:00
jeffs 1bf0f4630f Use a cast to handle syscall() copyin case with 64b clean ctx save/restore. 2000-09-26 18:24:45 +00:00
jeffs d6f992112d No longer save $at on syscall entry. v1 does appear to be used as if
you do not save it and pass it along in rval the system will start
to fail running user programs.  This finishes the suggestion by cgd to
not save some registers on syscall entry.
2000-09-26 18:22:12 +00:00
uch a21df3ae8e fix R3900 FlushCache bug. 2000-09-26 17:47:40 +00:00
jeffs e13c3f735f In trap(), do not lower spl for T_BREAK. This lets ddb always run at
splhigh() so nothing can happen behind it's back.
2000-09-21 20:59:58 +00:00
thorpej b008f5f25a Make PMAP_PAGEIDLEZERO() return a boolean value. FALSE indidcates
that the page being zero'd was not completed and that page zeroing
should be aborted.  This may be used by machine-dependent code doing
slow page access to reduce the latency of running a process that has
become runnable while in the middle of doing a slow page zero.
2000-09-21 17:46:04 +00:00
jeffs f1173a05e0 Add trace/t pid support for mips. 2000-09-19 06:22:51 +00:00
uch 0500ddb633 [R3900/R3920] sync with
| Module Name:	syssrc
 | Committed By:	nisimura
 | Date:		Sat Sep 16 07:20:17 UTC 2000
2000-09-18 18:17:32 +00:00
nisimura 70a97ab16c Introduce new MIPS1 direct mapped cache capacity detection logics. 2000-09-16 07:20:16 +00:00
jeffs 36c4252a17 Re-enable SR IE bit before calling syscall(). Matches Tohru's mips1 change. 2000-09-16 06:57:21 +00:00
nisimura 2982d7707b There is no need to handle processor master interrupt mask SR_INT_IE
in syscall() anymore.  By defition, processor was in SR_INT_IE turn
on prior to have syscall exception.  MIPS1 assembler hook arranges
to enable the bit for its own.  MIPS3 does the same effect by
turning off EXL bit.
2000-09-16 05:07:06 +00:00
nisimura f4b74d3898 - Reimplement MIPS1 cache size dectection logic taking advantage of the
fact the direct mapped cache makes address alias effect.
- Just turn on processor master interrupt mask IEc (SR_INT_IE) bit prior
  to call syscall() kernel entry point.  IEp is always 1 in this case
  by defition.
2000-09-16 04:54:44 +00:00
chuck 9dc2f5ced0 IDT32364's Config register uses a different base for IC/DC (instruction
and data cache sizes).   R4000 uses 2^(12+IC) and 2^(12+DC).  IDT32364
uses 2^(9+IC) and 2^(9+DC).

abstract around the problem by making the base a parameter to the
MIPS3_CONFIG_CACHE_SIZE macro.   we pass the base down from mips_vector_init
to mips3_vector_init and to mips3_ConfigCache (where it is used).

XXX: someone with an MIPS3_4100 should switch to this and get rid
of the ugly ifdefs in cpuregs.h
2000-09-16 00:04:57 +00:00
jeffs bdad8bae5b Handle R4K trap faults in user mode like overflows (deliver SIGFPE). This
prevents a panic running crashme.  Better comment for VCE define.
2000-09-15 06:50:46 +00:00
jeffs efef8a5aa6 Do not save t* registers in syscall stub as suggested by cgd. Saves
a whole 0.01us in lmbench lat_syscall null on our 250Mhz QED system.
$at is still saved just to be safe, although it looks like it does
not need to be.  $v1 is used in syscall(), although I'm not sure why.
2000-09-13 06:48:04 +00:00
nisimura 0ba2036eee Introduce 'segbase' global variable to hold the pointer to current
process's segtab, retiring 'pcb_segtab' field from 'struct pcb'.
This would be another MULTIPROCESSOR unfriendly and the necessity
might be eliminated when the way to hold PTE is redesigned.
2000-09-13 01:53:00 +00:00
chuck 0dcdf1214c kill mips3_write_xcontext_upper 2000-09-13 01:20:41 +00:00
chuck 6f9229b2e6 modify mips3 locore to elminate the abuse of XContext
so that we can run on systems that do not have XContext
(e.g. IDT 32364).
2000-09-13 01:12:47 +00:00
soren 99418ce05f Remove old comment. 2000-09-12 15:40:36 +00:00
jeffs bbcf1beea0 In outofworld, keep $sp for DDB case if it looks like a kernel address
so the stacktrace is ok.
2000-09-08 07:24:42 +00:00
jeffs 8f8a7ca780 Shuichiro URATA pointed out that the R4000 needs 3 nops. Other OSs make
it look at casual inspection like 1 nop is needed but play other tricks.
Still have reduced by 1 nop.  Hopefully this covers the NEC 41[x]1.  Could
not find info for those processors.
2000-09-07 20:31:02 +00:00
jeffs 8f2cc012b5 Remove 3 of the nops between tlbwr and eret in tlb miss handlers. They
were added early when adding the QED support.  RM5231 seems to work fine
w/o the extra nops.  Noticed by Chuck Cranor.
2000-09-06 06:33:42 +00:00
soren c5ce14be0a Back out (most of) previous. I was using an 1.5 asm.h and hadn't
noticed cgd's fix..
2000-09-05 01:24:51 +00:00
soren c3150dc3dc Add nop after PANIC macros. 2000-09-05 00:55:48 +00:00
jeffs f8d9f59ed9 Correct _KERN_MCOUNT restoration of $t9.
From Ethan Solomita (ethan@geocast.com).
2000-08-30 22:31:12 +00:00
thorpej 4db6fc7542 Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity.  Its use in
roundrobin() still needs some work.
2000-08-25 01:04:06 +00:00
uch 2111496e74 Rewrote TX39 series cache routines. 2000-08-24 05:31:59 +00:00
thorpej a86d1f4891 Add a lock around the scheduler, and use it as necessary, including
in the non-MULTIPROCESSOR case (LOCKDEBUG requires it).  Scheduler
lock is held upon entry to mi_switch() and cpu_switch(), and
cpu_switch() releases the lock before returning.

Largely from Bill Sommerfeld, with some minor bug fixes and
machine-dependent code hacking from me.
2000-08-20 21:50:06 +00:00
wdk 1e59559e3e intrcnt[] counters should be handled by the port specific interrupt handlers.
This change facilitates the migration from intrcnt[] to the new evcnt(9)
framework without breaking all of the mips based ports.
2000-08-14 04:36:34 +00:00
jeffs 95ac0dc817 In db_disasm() use fuword() to fetch user addresses. Mainly to avoid
bad EPCs from losing the initial ddb context when panicing, but also
helps with typos.
2000-08-10 22:31:26 +00:00
jeffs 6f9d8d6cd3 Tweak to compile with printf format changes. 2000-08-10 08:01:24 +00:00
jeffs 22bda73efd To be safe when called from interupt, [fs]uswintr need to preserve
cpu_onfault.  By Etan Solomita (ethan@geocast.com).
2000-08-09 23:03:24 +00:00
jeffs 0b5e00636a Fix a bug in how .S routines call _mcount to allocate stack before
use.  By Ethan Solomita (ethan@geocast.com).
2000-08-09 22:52:36 +00:00
tshiozak 51a53de0d5 Preparation for the future introduction of multibyte locale.
- MB_LEN_MAX is increased to 32.
 - To ensure binary compatibility for old executables
   under multibyte locale, versioned setlocale is added.
 - __mb_len_cur definision is added in setlocale.c
   and enable it in stdlib.h .
   It is also important for multibyte locale stuffs,
   but I just forgot.
2000-08-08 22:31:13 +00:00
shin f0803f8192 protect doubleword register from interrupt. 2000-08-06 12:30:36 +00:00
jeffs 8d300a3b14 setregs() cache sync turns out not to be needed with kern_exec 1.104
(which was 2 weeks after our internal trees full sync).
2000-08-02 06:46:47 +00:00
jeffs e1cf55c8a8 Make mips3_FlushICache() convert a0 into a KSEG0 + virtual index like
the _2way and mips3_FlushDCache(). This lets all mips3 cache ops accept
user virtual addresss w/o a tlb miss.  Since this is now done in both
ICache flush routines, no need to do it in pmap.c.  Fixed R4400
stability problems with setregs() cache flushing.
2000-08-01 23:38:26 +00:00
jeffs e6bdec31fd Fix vmapbuf() to call uvm_km_valloc_perfer_wait() call, but trunc_page()
to the prefer arg so we free the correct page.
2000-08-01 22:45:05 +00:00
cgd b63ed164a1 convert PRID handling to use macros on an int, not bit-fields.
there's no reason to use bit-fields, and they just complexity to
the header.
2000-07-27 17:29:05 +00:00
jeffs 3eae1609f1 Fix to actually compile MIPS1 only. 2000-07-27 08:28:36 +00:00
jeffs e4a0934c13 Do not attempt mips3 style cache flush on mips1 in setregs() as it
is illegal to flush on user addresses.  In theory the race exists
on MIPS1, but it is rather unlikely in common use.  I have
seen it with regress/sys/kern/sigtramp on a QED 5231 system.
2000-07-27 06:28:06 +00:00
cgd 4adc7b9704 add nops after jals in PANIC and PRINTF. (these macros are often used in
code which has noreorder set, and they're not used with nops afterwards,
as is appropriate in that case, so put the nops in the macros.)
2000-07-27 05:01:06 +00:00
jeffs ca2a49c4cf Back-out vmapbuf() change for now as locally it has been found to sleep
in some circumstances that don't sleep when not using pmap_prefer().
2000-07-26 16:24:38 +00:00
jeffs 71538e8894 Fix mips3 outofworld to panic cleanly even if shutdown path misses K2.
Previously we jal to panic which never cleared the tlb fault, so if
on the course of shutdown (like a doshutdownhooks() callback) missed
K2, it would panic again.  Fix by setting EPC to panic() and eret.
2000-07-25 18:06:49 +00:00
jeffs 3a90817270 Add option to apply additional mask to the SR at run-time for MIPS3 platforms.
By default this is off, and only slightly changes the code to load SR when
a temp register is available.  This can be used by the platform code to
handle slow to clear interrupts (our case) or to mask off any interrupt
any interrupt at run-time.  This can be very useful for embedded platforms
that have less than desirable interrupt properties.
2000-07-25 17:56:05 +00:00
jeffs 7dad7ceb84 Use new uvm_km_valloc_prefer_wait() in vmapbuf(). This lets the K2
mapping of b_data have the same virtual index, so the mapping does
not degenerate into uncached in pmap_enter().
2000-07-24 20:16:29 +00:00
jeffs 2ebdfcd251 Make pmap_prefer() use a global setting based on cache size
instead of assuming 64KB.   This allows best fit and will
support bigger caches.
2000-07-20 18:33:40 +00:00
jeffs c8b819c2ed Include kgdb hooks in trap.c. Include bits of DDB code for kgdb also. Remove
some local prototypes that are in headers now.
2000-07-20 18:14:46 +00:00
jeffs d8d3c52075 Move masked status and instr into jal cpu_intr delay slot. 2000-07-20 00:43:07 +00:00
jeffs 5938072101 In FPU excepton code, send SIGILL if no one claims the instruction.
SIGFPE is still delivered where appropriate.
2000-07-19 22:05:02 +00:00