Commit Graph

515 Commits

Author SHA1 Message Date
mycroft 897a8a7f29 Mark [hn]to[nh][ls]() with __const__, so they are subject to CSE. 1999-01-24 12:55:01 +00:00
nisimura 7766b60f7c - Add NEC Vr5400 processor ID. 1999-01-23 06:13:30 +00:00
mycroft 7497ccd364 Clean up. 1999-01-22 14:19:54 +00:00
mycroft ec253b6315 Use __builtin_next_arg(). Fixed PR 6862. 1999-01-22 14:14:32 +00:00
thorpej 2fb041ce0a No need for <sys/mtio.h> 1999-01-19 18:18:41 +00:00
castor de42f91db3 Forgot to also ship out regnum.h 1999-01-18 04:59:54 +00:00
nisimura 3478ed1de4 - Nuke 90 lines of dead code inherited from 4.4BSD. They were mostly for
VAX BSD VM.
1999-01-18 03:48:34 +00:00
castor 4e216f5744 Remove vestiges of cpuarch.h. Revert to using cpuregs.h instead. 1999-01-18 02:11:07 +00:00
chuck 417e5339f0 MNN is no longer optional 1999-01-16 20:31:50 +00:00
nisimura f3b48dd536 - Restore 'cpuregs.h'. 1999-01-16 09:25:18 +00:00
nisimura d9b9f639e6 - Update 'cpuregs.h' and decline 'cpuarch.h'. 1999-01-16 09:07:37 +00:00
nisimura 6119939f5a - Restore 'cpuregs.h'. 1999-01-16 08:51:04 +00:00
nisimura b6cc76ac91 - Never use an uninitialized variable. 1999-01-16 08:48:06 +00:00
nisimura 25806f2bf5 - Make cpu_switch() a normal call; formally it was splitted into halves.
- Fix an error in mips3_cpu_switch_resume(); ASID was not set correctly.
- Remove global variable 'curpcb' reference in mips1_proc_trampoline().
- Restore 'cpuregs.h'.
1999-01-16 08:45:53 +00:00
nisimura f163b5653f - Replace the stub value of 'eret' instruction with correct one. 1999-01-16 03:44:42 +00:00
nisimura f4b56d8060 - Clarify how inimplemented FP instruction traps are handled. 1999-01-16 03:31:49 +00:00
nisimura d077749e8f - Fix errors involving proc0's kernel stack usage. Fortunately it made
no error so far...
1999-01-16 03:17:06 +00:00
nisimura 7dce3ef311 - User mode context held with pcb_regs[38] in 'struct pcb' was relocated
at the very bottom of process kernel stack.   The address is pointed with
'curproc->p_md.md_regs'.
- Define 'struct md_coredump'.
1999-01-16 03:12:18 +00:00
thorpej f52ee598ae __pmax__ -> pmax, __arc__ -> arc, like other ports. 1999-01-15 23:35:54 +00:00
castor 48cbfb842a * Add prototype for mips1_clean_tlb
* Add the correct version of locore_mips1.S [ See previous revision for
	description of changes ]
* Use defopt'ed MIPS3_L2CACHE_ABSENT in mips_machdep.c and pmap.c
	to avoid generating extraneous code.
* GC pmap_set_referenced in pmap.c
1999-01-15 22:26:42 +00:00
bouyer dc306354b0 Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
1999-01-15 13:31:15 +00:00
castor 534c67a373 Protect defopt against -D_LKM 1999-01-15 10:07:12 +00:00
castor 84915f67d7 Fix typo in mips3_ConfigCache() -- mips3_L2CachePresent 1999-01-15 09:58:43 +00:00
castor 4720afb463 Avoid introducing new prefix '__JB' -- '_JB' is fine. 1999-01-15 03:43:56 +00:00
castor e20f6d6203 * Elimination of UADDR/KERNELSTACK
Affected files:
	include/mips_param.h, include/pcb.h,
	mips/locore_mips1.S, mips/locore_mips3.S,
	mips/mips_machdep.c, mips/vm_machdep.c

   Issue:

So far, NetBSD/mips has not successfully got rid of fixed-address
kernel stack.  USPACE (two 4KB pages) of each process has two distinct
KSEG2 addresses, both refer to a single physical storage; one address
for fixed range [ UADDR .. KERNELSTACK ), and another for "normal" KSEG2
address which was allocated by kernel memory manager and unique to each
others of processes.

"Doubly mapped" USPACE complicates context switch.  Both address ranges
have to be managed with a special care of "wired" TLB entries which
are never replaced until next context switch to ensure no TLB miss for
USPACE access.  It's equally crumbersome that MIPS processor's cache
machinary gets be confused about USPACE contents because there are two
distinct KSEG2 addresses to manipulate one physical storage.

   Solution:

Purge KERNELSTACK constant for kernel stack pointer and replace
it with process unique values.  Kernel stack bottom is located at
'curproc->p_addr + USPACE'.  Context switch is simplified as it unloads
half of TLB hardwiring burden.  It just manages the unique KSEG2 address
of each USPACE to be wired.  As the side effect, switch_exit() has no
MIPS processor ISA dependent code anymore.  It switchs kernel stack to
proc0's USPACE which has KSEG0 address and no need of TLB entry.

* Extensive use of 'genassym.cf'

To hide target port dependent and/or processor register size dependent
constants from assembler routines, 'genassym.cf' now has an extentive
set of definitions for various constants and offset values of
structural objects.  This change will contribute possible NetBSD/mips64
portability too.

* Separation and rename of locore_r2000/_r4000.S

Those files are now indepedent standalones from locore.S to ease
maintainance works, and renamed to match MIPS processor ISA version.

* Changes in kernel mode exception handlers

Kernel mode exception handlers hold exception contexts by pushing a
certain set of register values on stack for resuming kernel mode
processing.  This context is now represented with 'struct trapframe',
which is smaller than full scale (user mode) exception context 'struct
frame'.  Stack consumption of kernel mode exception services is now
similar to 4.4BSD/mips.

* Relocation of exception frame

User mode context 'struct frame' is moved to the very bottom of kernel
stack at 'curproc->p_addr + USPACE - sizeof(struct frame)'  This change
saves a bit of instructions on every return to user processes as it
eliminates reference to global variable 'curpcb' each time.

* Refurblished DDB backtrace routine

It's a growing concern to maintain stacktrace() code correctly.  It
could be simplified by enforcing special arrangements for some of
obscure locore routines which violate usual coding conventions.

New backtrace code searchs for certain instructions peculiar to any of
function tails.  Specifically, "jr ra" for normal function returns, "jr
k0" for MIPS1 exception handlers and "eret" for MIPS3 handlers.

* Support for 64-bit safe user code
    Affected Files:
	${ARCH}/include/pubassym.cf lib/libc/arch/mips/gen/*setjmp*
	include/setjmp.h mips/include/[lots] mips/mips/[lots]

    Solution:

	We define macros REG_L/REG_S and SZREG for loading and storing
	registers and for the size of registers.  The exact meaning
	of these is controlled by a macro (currently _MIPS64) which
	allows one to treat the registers as either 32-bit or 64-bit.
	There are data types mips_reg_t and mips_fpreg_t which represent
	the true register sizes, and avoid confusing register_t.

	We needed a way to dynamically gen the structure sizes of things
	like sigcontext for setjmp.h, so we defined a pubassym.cf for
	libc routines like setjmp and longjmp.

	NetBSD/mips allows ${ARCH}'s to be defined which preserve
	all 64-bits of registers across user context switches.  There
	are still a few niceties to clean up for kernel mode context
	switches.

* Support for QED 52xx processors
    Affected Files:
	mips/locore_mips3.S mips/pmap.c include/locore.h

    Issue:
	The QED 52xx family of processors are targeted at low cost
	embedded systems, (i.e. CPUs ~$30) for systems like routers, printers,
	etc.  We have added preliminary support for some of the idiosyncrasies
	of this processor, e.g. no L2 cache, etc.  More work needs to be
	done here because with a modest 2-way  L1 cache, some of the rampant
	flushing has significant performance implications.  However,
	it doesn't crash, which is a start.

    Solution:
	A routine for flushing the cache based on virtual addresses was added;
	a routine which deals with the two-way set associativity of the
	5230 L1 cache was added, accomodations to 5230's instruction hazards
	were added.


* TLB Miss code for mips3/mips4 processors cleaned up significantly.
    Affected Files:
	mips/locore_mips3.S mips/vm_machdep.c include/locore.h mips_machdep.c
    Issue:
	The TLB Miss handler exceeded the allowed size, which wasn't
	a problem because there was no handler for when the processor
	was in 64-bit mode.  The handler for invalid TLB exceptions
	also appears to have much vestigial code, which made it
	difficult to understand.

    Solution:
	Use the XCONTEXT register to store a pointer to the segment
	map table, this coupled with removing some dead code allows
	the handlers to fit.
1999-01-15 01:23:12 +00:00
castor a6f7b8ff0e Add defopt opt_mips_cache.h and allow 'clock' device to not require the mc6xx files 1999-01-14 18:51:31 +00:00
castor a84ec5a3c1 * Create mips_reg_t data type to allow register size to be
decoupled from long or int or long long.  Define macros in asm.h to facilitate
  choosing these on a port by port basis.

* Create <machine/pubassym.h> mechanism to allow jmp_buf structure size
  to be calculated at system build time.

* Define _MIPS_BSD_SIM macro which specifies what calling style is appropritae
  for the architecture.  For 64-bit oriented systems set the Status Register
  to allow 64-bit instructions.

* Remove UADDR related macros because kernel U structure is now mapped
  normally.
* Separate cpu.h into cpu.h and cpuarch.h to keep things neat.
* Add support for QED 52xx processors
1999-01-14 18:45:45 +00:00
nisimura 6ebba254e7 - Put comments on several DDB helper routines. 1999-01-07 00:36:09 +00:00
nisimura 858e67e157 - Complete vm_offset_t purge for mips processor.
- bzero() -> memset() and bcopy() -> memcpy().
- Garbage collection in trap.c and db_interface.c.
1999-01-06 04:11:25 +00:00
nisimura fe061a7ae4 - Eliminate dead code in TLB miss handler. Fortunately it has never been
executed.  Once execunted, the result would be castrophic because it has
addressing error.
1998-12-28 00:31:03 +00:00
msaitoh 7c25d335bf s/are are/are/ 1998-12-25 16:52:10 +00:00
nisimura 14b18ffcb5 - Remove improper casts mistakenly creeped in the last commit. 1998-12-07 04:21:57 +00:00
jonathan 340efce0ea Track PV_REFERENCED bit as for PV_MODIFIED, to make mdsetimage work correctly.
Compatiblity with Mach VM: clear pmap-private bits in pmap_remove() if !UVM.
1998-12-05 09:13:09 +00:00
jonathan aecf708ee3 Clean up kernel PTE allocation. Allocate space for maxproc kernel stacks.
Bump UVM swap-map to avoid panics on large swap machines.
1998-12-05 07:50:12 +00:00
jonathan ea1aa3511c #ifdef _KERNEL around cpu_exec_ecoff_setregs() prototype. 1998-12-05 07:26:11 +00:00
nisimura 75ff38a27d - Fix an error in primary cache line size detection logic; when IC and/or DC
bit is 1, then line size is 32.  Otherwise, 16.
1998-12-04 10:32:08 +00:00
nisimura 9f33638436 - Fix and improve confusing indentations inside trap().
- Don't make a reference of curproc when it has NULL value.  It causes
double fault upon a fatal panic ocation.
- Macro FETCH_INSTRUCTION() took a value of address 0.
-
1998-12-04 04:35:44 +00:00
nisimura 3c6a704193 - Use explicite structure member reference with 'struct frame' to alter
register values of exception frame pointed with p->p_md.md_regs.
- Local auto variable 'cpustate' in cpu_coredump() was never used correctly.
1998-12-03 06:28:45 +00:00
thorpej a6f7e0c05a Implement WARN_REFERENCES(). 1998-12-02 00:58:42 +00:00
jonathan 7d813b16c3 Add PV_REFERENCED and track as for PV_MODIFIED,.
UVM relies on pmap modules keeping track of modified/referenced bits
after a page has been removed from all mappings.  So *dont* clear
PV_REFERENCED or PV_MODIFIED flags in pmap_remove().
1998-11-29 03:18:32 +00:00
thorpej e3e5bd6220 Erg, fix the non-error code path, too. 1998-11-26 21:16:08 +00:00
thorpej e328e13450 Oops, in some delay slot confusion, I ended up clobbering s0 before it
restored pcb_onfault.  Make it the way I wrote it originally, which was
correct.  Pointed out by Michael Hitch and Charles Hannum.
1998-11-26 20:52:45 +00:00
nisimura 53ac67d9b1 - Fix two bugs; inst_call() is supposed to check OP_SPECIAL opcode with
either OP_JR function code or *OP_JALR* function code (not OP_JAL opcode).
insn_unconditional_flow_transfer() was to read an unintialized variable.
Those MD DDB routines seems not useful work so far.
1998-11-25 01:14:48 +00:00
mrg db3051d720 fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
	- no check for negative offset.
many of these fix potential security problems in these drivers.


XXX XXX XXX
the d_mmap cdev routine should be changed to have a prototype like:
	paddr_t (*d_mmap) __P((dev_t, off_t, int));

by someone!
1998-11-19 15:38:20 +00:00
mhitch 549407b634 Change page modification emulation: don't fiddle with VM flags directly.
Track page modification status in the PV entry like the alpha, and let
pmap_is_modified() return current status back to the VM system.  UVM now
works reliably.

Garbage collect the old pmap_attribute[] stuff.
1998-11-15 02:34:19 +00:00
thorpej 49c62c4336 Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
  entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
  When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
1998-11-11 06:41:23 +00:00
nisimura 8ed3c420dc - Withdraw a duplicated file. This has never been a part of distribution. 1998-11-11 05:00:42 +00:00
simonb 67f74ebee4 Implement the new BUFCACHE option. 1998-11-02 07:43:37 +00:00
jonathan 558bc32937 Add missing braces pointed out by egcs. 1998-10-28 04:28:32 +00:00
jonathan dd735283c1 Add `struct proc;' to keep egcs warnings happy in userland.
XXX why are kernel prototypes visible here at all?
1998-10-28 04:26:52 +00:00