Commit Graph

805 Commits

Author SHA1 Message Date
nisimura
0e501989cd - Have savefpregs() and loadfpregs() in C codes with lengthy inlined
asm statements, obsoluting asm routines in locore.S.  They are
  designed to work in symmetry as names suggests.  savefpregs()
  does not clear a global variable fpcurproc.  Both would be noops when
  NOFPU global symbol is defined.
- MDP_FPUSED flag is not turned on for FPA-less processors like Vr4100
  and TX3900 even when processes execute FP insns.
2000-05-30 01:23:53 +00:00
simonb
4857b33794 A few more white-space bogons. 2000-05-29 23:40:03 +00:00
simonb
6c87680cbf A TAB after the define keyword instead of spaces. 2000-05-29 23:30:06 +00:00
nisimura
a7c050472e Nuke #include directives found unnecessary. 2000-05-29 11:46:52 +00:00
nisimura
f7c88c8f18 Make sure to load FPA contents next time an FP insn is executed when
process_write_fpregs() changes pcb_fpregs[].
2000-05-29 11:19:46 +00:00
nisimura
76f0ee4e32 Put an additional check to see curproc was an FPA owner process. 2000-05-29 09:47:19 +00:00
nisimura
87cd634474 Put addtional checks to see the curproc is an FPA owner process. 2000-05-29 09:43:33 +00:00
nisimura
8e19d02f25 Cleanup take two
- Nuke external function reference of savefpregs() which is already defined
  in mips/cpu.h.
- Adjust the comment tells "let user processes change CP0 status register
  freely might be dangerous."
2000-05-29 09:37:00 +00:00
nisimura
3f8e9c25b6 Make claried MDP_FPUSED usage.
- MDP_FPUSED flag indicates the process has executed at least one
  FP insn during its life time.
- pcb_fpregs storage is guaranteed zero initialzed.  If the process is FPA
  owner, savefpregs() must be called to synchronize it with FPA contents.
- No necessity to save FPA contents into pcb_fpregs prior to the whole
  storage is overwritten by process_write_fpregs().
2000-05-29 09:16:36 +00:00
thorpej
e03e9e8086 Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1().  In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.
2000-05-28 05:48:59 +00:00
enami
2e535006c1 No longer need to include sys/types.h. 2000-05-27 02:18:12 +00:00
soren
630f6535cd Match a comment with the MIPS3 version. 2000-05-27 02:13:46 +00:00
soren
dc83d17889 Include <sys/param.h> to make the new cpu.h happy. 2000-05-27 02:13:12 +00:00
sommerfeld
40339b39f9 Reduce use of curproc in several places:
- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()
2000-05-27 00:40:29 +00:00
thorpej
a7d0570e67 First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

	- Global state: sched_qs (run queues), sched_whichqs (bitmap
	  of non-empty run queues), sched_slpque (sleep queues).
	  NOTE: These may collectively move into a struct schedstate
	  at some point in the future.

	- Per-CPU state, struct schedstate_percpu: spc_runtime
	  (time process on this CPU started running), spc_flags
	  (replaces struct proc's p_schedflags), and
	  spc_curpriority (usrpri of processes on this CPU).

	- Every platform must now supply a struct cpu_info and
	  a curcpu() macro.  Simplify existing cpu_info declarations
	  where appropriate.

	- All references to per-CPU scheduler state now made through
	  curcpu().  NOTE: this will likely be adjusted in the future
	  after further changes to struct proc are made.

Tested on i386 and Alpha.  Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
2000-05-26 21:19:19 +00:00
mhitch
5228efa47e Fix typo (stray " where it shouldn't be). 2000-05-26 20:59:00 +00:00
jhawk
8e44b27348 Rename the machine-specific stack trace printing functions
from db_stack_trace_cmd() to db_stack_trace_print(),
and add an additional argument, a function pointer for an
output routine (i.e. printf() or db_printf()).

Add db_stack_trace_cmd() in db_command.[ch], calling
db_stack_trace_print() with db_printf() as the printer.

Move count==-1 special handling from db_stack_trace_print() [nee
db_stack_trace_cmd()] to db_stack_trace_cmd() [nascent here].

Again, I'm unable to test compilation on all affected platforms,
so advance apologies for potential brokenness.
2000-05-26 03:34:24 +00:00
thorpej
8964c35eca Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor.  Test against SONPROC as appropriate rather than
combinations of SRUN and curproc.  Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
2000-05-26 00:36:42 +00:00
simonb
52e7cddaa7 Fix kernel profiling so that it actually works:
- Add 16 bytes to the stack on entry to _mcount so we don't
   overflow it.
 - Use inline interrupt {dis,en}abling instead of calling
   profiled function in locore.
2000-05-25 03:07:10 +00:00
soren
a20a3b38fd Appease gcc. 2000-05-24 18:42:03 +00:00
thorpej
1140468205 Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
2000-05-24 16:48:33 +00:00
soren
a255740671 MachForceCacheUpdate and cacheflush_bug have never been used in NetBSD,
so remove references them, and do a little other cleanup.
2000-05-23 04:21:39 +00:00
uch
fb077d8092 change TX3922 D-cache mode to write-through. 2000-05-21 11:53:00 +00:00
soren
f598aece87 MIPS 'mach halt' does nothing MD, so nuke it. 2000-05-21 05:41:25 +00:00
soren
6aba4259b6 R10K has 64 TLBs. 2000-05-21 04:25:57 +00:00
soren
abbe53961a Add R12K PRID. 2000-05-21 04:03:34 +00:00
soren
81fa4aa07f Populate the cputype defopt (not enabled yet). 2000-05-21 03:31:35 +00:00
soren
2779a53005 Include opt_cputype.h. 2000-05-21 03:23:15 +00:00
soren
7ea4a2b744 Fix RCS ID line. 2000-05-21 02:51:58 +00:00
soren
b70819c71a Also share BE ldscripts. 2000-05-21 02:50:10 +00:00
soren
135a70e5a6 Make cache printing a little more consistent. 2000-05-17 23:35:44 +00:00
soren
740759113f mips5200_FlushCache(): flush L2 cache too. 2000-05-17 12:44:48 +00:00
nisimura
66ecdc15d3 Remove unused PSL_USERCLR defines for processor status register. 2000-05-15 08:36:32 +00:00
nisimura
8a71a7a50f Backout the previous change which was done mistakenly. 2000-05-15 06:45:44 +00:00
nisimura
c7c815f46b Remove #include <machine/psl.h> which is not used. 2000-05-15 06:39:14 +00:00
castor
42ccab0d49 Add fp emulation for sqrt_s and sqrt_d instructions
from Jeff Smith <jeffs@geocast.com>.  These are needed to support
-mips2 compilation.  With this change, on a QED 5231 we now pass the
paranoia tests, and are successfully using userlands built with -mips2.
2000-05-14 06:19:32 +00:00
nisimura
df234d8698 Take a straight way for pagemove() PTE manipulation, abandoning to
use MIPS_TBRPL().  When PTEs are modified, both src and dst TLBs
are invalidated.  MIPS3 single TLB entry has paired double PTE
and pagemove() likely walks through multiple pages.  The positive
effect of of MachTLBUpdate() or TBRPL() is unclear.
2000-05-10 08:55:22 +00:00
nisimura
de13b44edd Have mips_locoresw[] of 3 entry pointer array for different
implementation of locore routines between MIPS1 and MIPS3.  It's
independent from mips_locore_jumpvec_t which is for cache/TLB
manipulating routines peculiar to processor designs.  mips_locore_jumpvec_t
will be replaced with "processor closures" encapsulating implementation
parameters (cpuinfo) and pointers to conventaion routines (cpuops),
eventually.
2000-05-10 01:34:13 +00:00
shin
a7dd7a7c0c bugfix: make sure there is no valid data in data cache, when last
mapping to the physical page is removed (R3000/MIPS1).

delete cache operations in pmap_zero_page_uncached().
2000-05-09 13:40:13 +00:00
nisimura
34a943161d Introduce mips3_TBRPL(); not used in this moment, to be useful to
discard MachTLBUpdate() calls, however, the necessity of TLB entry
modification in such a way is under question because implementation
glitches on ASID management was straightened, those calls can be
sanely removed after all.
2000-05-09 09:50:17 +00:00
nisimura
0cb6da487c Remove unused mapin(pte, v, pfnum, prot) macro. 2000-05-06 05:19:32 +00:00
thorpej
855b79db92 Let each platform typedef the new __cpu_simple_lock_t, which should
be the most efficient type used for the atomic operations in the
simplelock structure, and should also be __volatile.
2000-05-02 04:41:04 +00:00
soren
e038e8aac1 No need for flushing the cache after zeroing a page uncached. 2000-04-30 23:30:47 +00:00
simonb
21666d1ea5 Only call uvm_pageidlezero() if uvm.page_idle_zero is set. 2000-04-30 23:01:24 +00:00
simonb
0ba4762798 Define offset for uvm.page_idle_zero. 2000-04-30 22:56:12 +00:00
soren
f820567ce2 Allow non-pmax to use COMPAT_ULTRIX. 2000-04-29 21:47:13 +00:00
soren
082109d0e4 Move free page zeroing to before the whichqs spinner. Pointed out by simonb. 2000-04-29 14:44:42 +00:00
thorpej
f51470a514 Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED.  These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case).  Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
2000-04-29 03:31:45 +00:00
soren
2cfb26c801 Zero free pages in the idle loop. 2000-04-28 19:25:55 +00:00
shin
a332af2846 delete unused function mips3_TLBReadVPS().
reorder insns to avoid mtc0/mfc0 hazard (for VR4100/R4700/RM52xx).
save/restore PageMask in mips3_TLBRead().
2000-04-21 14:14:55 +00:00