Commit Graph

702 Commits

Author SHA1 Message Date
shin b6113c1d8c delete clrnd() to compile again. 1999-12-05 03:31:11 +00:00
ragge 0513268399 CL* discarding. 1999-12-04 21:13:19 +00:00
nisimura ba72fb5211 Decouple DECstation binding, use 'dev/dec/mcclock_pad32.h' for
implementation consistency.
1999-12-03 02:56:37 +00:00
nisimura 31f8115d20 Add _splrestore() to manipulate processor interrupt control bits. 1999-12-03 02:15:55 +00:00
shin ccba32ca1d reorder instructions in mips3_TLBFlush() to avoid coprocessor hazard
for R4600/R4700/VR4100.
1999-11-30 11:53:24 +00:00
uch 878e985d08 Some TX39 I/O region lies over 512MByte. KSEG2IOBUFSIZE reserves PTE to map there. 1999-11-29 11:14:49 +00:00
uch 8b01b15437 TX3912/22 specific register defines. 1999-11-29 11:13:11 +00:00
uch 347ea4cd91 TX3912/22 support. ENABLE_MIPS_TX3900 enables it. 1999-11-29 11:12:12 +00:00
shin 49ead2a4a7 add RCS Id.
add copyright & license notice.
1999-11-22 02:11:09 +00:00
jun 46b5560f98 and add sys/arch/mips/mips/fpemu.c 1999-11-18 06:50:17 +00:00
jun 0e8bb20fd2 on port-mips@netbsd.org:
Shuichiro URATA <ur@a-r.org> makes kernel softfloat emulation code.

http://www.a-r.org/~ur/softfloat1116.diff.gz

is Patch for
      sys/arch/mips/conf/files.mips
      sys/arch/mips/mips/fp.S
      sys/arch/mips/mips/fpemu.c
      sys/arch/mips/mips/genassym.cf
      sys/arch/mips/mips/locore.S
      sys/arch/mips/mips/mips_machdep.c
      sys/arch/mips/mips/process_machdep.c
      sys/arch/mips/mips/trap.c
      sys/arch/mips/mips/vm_machdep.c
After apply this patch,pmax package binary works on hpcmips!
1999-11-18 06:47:48 +00:00
kleink ac88fcbb17 G/c orphaned prototype. 1999-11-15 02:00:08 +00:00
mhitch ed2a0c2648 Fix an additonal return in pmap_enter() that wasn't returning a value.
Use flags (formerly access_type) to set page reference/modified status.
Don't use the PG_CLEAN flag from the UVM when checking to see if a
writeable page has been marked as modified.
When updating page status to modified from the UTLBmiss handler, set
the referenced bit in addition to the modified bit.
1999-11-13 23:16:39 +00:00
thorpej 1946167939 Update for pmap_enter() API change. No functional difference. 1999-11-13 00:30:26 +00:00
nisimura 95e2c7af76 Make sure wbflush symbol treated as a C function call. 1999-11-12 06:17:13 +00:00
nisimura 24a33d9f37 Remove a small scale 'improvement' for TLB mod exception which is now
found harmful.  Fix panics on MIPS1 only kernels.
1999-11-10 08:06:05 +00:00
kleink b4f0936a8c Per discussion on tech-toolchain, remove MIPS-specific <machine/elf.h> header;
all the information is available from <sys/exec_elf.h>.
1999-11-09 21:50:18 +00:00
mhitch 5239567fb0 Don't use MIPS3_L2CACHE_ABSENT to control compiling the Level 2 cache flush
in pmap_remove_pv().  Also comment why I'm doing the second cache flush
operation.
1999-11-07 19:42:23 +00:00
mhitch 93598fd12b Cleanup pmap_remove_pv() a bit:
Page mod/ref status is stored in the pv header, and needs to be copied to
    the following entry when removing the head entry, otherwise the status
    will be lost (oops!).
  Move the common MIPS3 cache flush into pmap_remove_pv() and eliminate the
    unnecessary testing of the return value when only compiled for MIPS1.
  If the pv entry had the cache inhibited, and we remove the last cache index
    alias conflict, restore caching on the mappings for that entry.
  Eliminate possible extra cache flushing inherited from the pica pmap:  it
    was doing the flush when the head entry was being removed - not just the last
    entry.  Now the flush is done only when the last mapping has been removed.
    Also make sure the secondary cache gets flushed [MIPS3 cache flushing needs
    to be re-thought/re-done someday].
  Update comment for pmap_remove_pv() to reflect these changes.
1999-11-06 23:18:04 +00:00
mhitch 01a4486595 Try to document the use of the XContext register in the TLBMiss and XTLBMiss
exception handlers.
1999-11-06 17:35:55 +00:00
mhitch 32b8c8d62c The previous change to pmap_create() to fix DEBUG compiles was incorrect. The
original debug output was printing the argument to pmap_create(), but
pmap_create() no longer has an argument.  The incorrect change now prints
an un-initialized pointer.  Change to just print out the function name.
1999-11-06 16:56:33 +00:00
mhitch 54b3de8b6f Only check for cache index compatiblity on MIPS3 if there is no secondary
cache.  With secondary cache, the CPU will detect cache coherency errors
and the Virtual Coherency Exception handler will flush the appropriate
cache lines to maintain cache coherency.  This allows much better
performance than inhibiting the cache for the entire page.  This is
very noticable when shared library mappings occur with incompatible
mappings, since there's a very likely chance the mappings will remain
for long periods of time.  Systems without secondary cache will still
have the cache inhibited, so there will still be performance issues if
shared libraries don't get mmaped() on correct memory alignments.

This fixes the current problems on DECstations using the R4x00 getting
coredumped programs.
1999-11-04 17:20:57 +00:00
mycroft b2ecb4ad21 In copy*str(), explicitly check for maxlen==0, rather than implicitly making it
act like 2^32.

Tested by: simonb
1999-11-03 16:21:22 +00:00
simonb 80e4097b69 Fix cut'n'pasto in comment. 1999-10-29 03:36:18 +00:00
lukem dc8817eb44 sort mips_db_command_table 1999-10-28 06:54:16 +00:00
simonb 87082426d7 Use the new ELF macros and structures from <sys/exec_elf.h> and not the
old ones from <mips/elf.h>.

XXX: If there's no MIPS API issues, {pmax,pica,newsmips,hpcmips,mips}/elf.h
can be thrown away...
1999-10-27 11:54:53 +00:00
kleink 522cbf0248 Update to match new SVR4-style definition names in <sys/exec_elf.h>. 1999-10-25 13:55:06 +00:00
simonb f72818160a Remove unused variable. 1999-10-20 14:21:10 +00:00
soren 72b75dc0b8 Shorten fpuname for built-in FPUs. 1999-10-18 17:23:00 +00:00
soren 6bae30b8f8 Make it compile with DEBUG. 1999-10-18 17:17:09 +00:00
jdolecek 7f589dba84 rename the MD Debugger() to cpu_Debugger()
add MI Debugger() which switches to console if wscons is used prior
to calling cpu_Debugger()
1999-10-12 17:08:56 +00:00
shin 359347c965 fix mips3 TLB printf format 1999-10-11 05:11:02 +00:00
shin 44c2553ded Changes for NetBSD/hpcmips.
Support VR4100.
	Support 16KB page.
	Support CPU without FPU.

Fix virtual alias problem(physio() case).

[new options]

options		MIPS3_4100	/* VR4100 core */
options		MIPS_16K_PAGE	/* enable kernel support for 16k pages  */
options		SOFTFLOAT 	/* No FPU; avoid touching FPU registers */
1999-09-25 00:00:37 +00:00
nisimura ff559f77f0 'KB' for kilo-bytes as humanize_number(). 1999-09-24 00:37:52 +00:00
chs f3a668ed84 eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
1999-09-12 01:16:55 +00:00
mrg f75cf1688b install ieee.h 1999-08-30 00:51:57 +00:00
mycroft 4ef547e76d Add ieee.h. 1999-08-29 18:21:20 +00:00
simonb 3c185af5fd Include <sys/endian.h> after defining whether where are little- or
big-endian.  i386, pc532 and vax still include <machine/byte_swap.h>
and define macros for the {n,h}to{h,n}*() functions.  mips also
defines some endian-independent assembly-code aliases for unaligned
memory accesses.
1999-08-21 05:53:50 +00:00
simonb 06a92524c2 Include <sys/bswap.h> for function prototypes. i386, pc532 and vax
still include <machine/byte_swap.h> and define macros for some of
the bswap*() functions.
1999-08-21 05:39:51 +00:00
nisimura 3708c0dfd6 - Replace three splx() calls with _splset(). splx() should not be
considered the equivalent of 'set processor register'.
1999-08-18 04:43:31 +00:00
nisimura 44861c8d16 - Fix a severe bug I introduced May 7th. MIPS kernel ran for long time
in kernel mode after master interrupt (MIPS_SR_INT_IE) disabled.  Tons
of appreciation for Noriyuki Soda and Masanari Tsubai for almost full
time help to spot of the issue.
1999-08-16 07:53:18 +00:00
simonb 299578ebd5 Spell "privilege" correctly (correct spelling from Jonathan Stone). 1999-08-16 02:59:22 +00:00
thorpej 28fb7c1eb8 Define cpu_number() as discussed on tech-smp. 1999-08-10 21:08:05 +00:00
thorpej 3ebbe095e0 Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
1999-07-08 18:05:21 +00:00
nisimura b57c6ad0bc - _insque()/_remque() used by CODA. 1999-06-30 03:52:04 +00:00
itojun 427639cdce - Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
  and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.
1999-06-28 08:20:40 +00:00
nisimura 1c949badf4 - Fix an large error I made last month in TLB mod improvement, still
wondering why not I was immediately blown away.
- Continuing invastigations on VM related panics on very high loads.
1999-06-18 08:17:50 +00:00
thorpej 0288ffb53a pmap_change_wiring() -> pmap_unwire(). 1999-06-17 19:23:20 +00:00
thorpej f5a527bb4e Remove pmap_pageable(); no pmap implements it, and it is not really useful,
because pmap_enter()/pmap_change_wiring() (soon to be pmap_unwire())
communicate the information in greater detail.
1999-06-17 18:21:21 +00:00
mhitch d9be0d6e6b When entering a read-only page for MIPS3, va does not need to be adjusted by PAGE_SIZE
when flushing the I-cache.
1999-06-08 03:44:18 +00:00
nisimura 540b02ab76 - Exterminate haunted evil soul of MIPS va_arg(). Verified OK with
either endian.  Not a perfect solution which would be revealed on
a certain condition when va_arg() is applied to magical struct
arguments passed by value.  format_bytes() is now saved.  With the
help from Noriyuki Soda and Masanari Tsubai.
1999-06-08 00:46:38 +00:00
castor 6b1b77230e in switch_exit() previous fix forgot to guard REG_L with REG_PROLOGUE and
REG_EPILOGUE.
1999-06-04 21:43:12 +00:00
castor 4f92d800a6 fix register restore to be safe for n32 model. 1999-06-04 21:35:47 +00:00
nisimura fad2c4c762 - A little attention for TLBUpdate(). 1999-05-31 06:10:32 +00:00
nisimura ce19767c8b - Make a modification to reduce the cost of TLBmod exception handling.
TLBUpdate() routine is used for dual purposes.  In TLBmod case, just ok
to call 'tlbwi' (as designed).  Result in saving of extraneous execution
path.  MIPS1 only this moment.
1999-05-29 09:38:28 +00:00
thorpej dbc1dd921a Clone vmapbuf() and vunmapbuf() from the Alpha port. 1999-05-28 22:59:40 +00:00
nisimura d116bc4a0d - Make this compilable with MIPS1 or MIPS3 only configuration. 1999-05-28 07:23:38 +00:00
nisimura 58cf81db34 - Change a symbolic name of TLB entrylo from 'PG_M' to 'PG_D' to reflect
processor design.  MIPS 'dirty bit' is not the same as i386 'dirty bit'.
There is a growing concern of misuse in NetBSD/mips.
1999-05-27 01:56:32 +00:00
thorpej beb8d06638 Generally update the comment above vunmapbuf(). 1999-05-26 22:19:33 +00:00
thorpej a2d06a4721 Generally update the comment above the vmapbuf() implementations. 1999-05-26 22:07:36 +00:00
nisimura 10d1acd4ea - Backout the last code change. I found it broke pmax kernel. It's
retained for future use of pmap.new.c, though.

> New codes always use current ASID holded in EntryHi register.
1999-05-22 02:35:35 +00:00
nisimura fd243bd393 - Redefine symbols and parameters to represent CPU design with MIPS
nomenclature, retaining the old heritage.
- Remove API-related definitions for now obsolete utiltity routines.
1999-05-21 06:37:39 +00:00
nisimura e5ecc1bc87 - Typos, I made... 1999-05-21 06:36:37 +00:00
nisimura 28c74563b6 - Make sure ASID PARANOIADIAG work with MIPS3. 1999-05-21 06:19:55 +00:00
nisimura 1b332b28e2 - Now completing MIPS1 side change. Introduce MIPS_TBIS and MIPS_TBDATA
(correct name, vax?) replacing mips1_TLBFlushAddr and mips1_TLBUpdate,
respectively.  New codes always use current ASID holded in EntryHi
register.  In most occations, the register already contains a necessary
value before (re-)written, ugh.  'sva | asid' ops for their arguments are
now verbose, to be removed when MIPS3 side changes are done.
1999-05-21 06:01:14 +00:00
nisimura 634cb79411 - Rename '#ifdef DIAGNOSTIC' to '#ifdef PARANOIADIAG' to detect
catastrophic events to break VM machinary.  Add some more diags to
track ASID.
1999-05-21 05:28:31 +00:00
nisimura 90d9a14b01 - Avoid recomputations inside inner-most loop which produce identical
values evreytime.
1999-05-20 10:50:08 +00:00
lukem e4a87aa1a9 * convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes
1999-05-20 08:21:42 +00:00
nisimura a784d093ea - Change pmap_alloc_asid() and pmap_activate() to make sure that
'pm_asid' member of 'pmap' structure is assigned a new value after
uvmspace_alloc() provides afresh pmap.
- ASID generation number 0 is not a reserved value anymore.
1999-05-20 05:32:06 +00:00
nisimura 7d44b47145 - Make tlb dump DDB command have 'D' indication for TLB 'dirty bit'. MIPS
processor is one of processors with no 'referenced bit' nor 'modified bit'
processor machinary.  Those functions are implemented combining two
hardware bits, 'dirty bit' and 'valid bit', with TLBmod exception handler.
1999-05-20 03:34:06 +00:00
nisimura a5a47c3772 - Implement MIPS_TBIAP() which invalidates all TLB entries belong to
per process user spaces, replacing mips1_TBLFlush().  This reserves
kernel space TLB entries when TLBPID generation number about to wrap.
- Correct comments a bit, nuke unused routines.
1999-05-19 07:08:43 +00:00
nisimura 523983b88b - Forgot to change 'tlbpid' to 'asid'. But, why does the MIPS TLBmod
handler touch the value anyway?
1999-05-18 03:13:37 +00:00
nisimura c99765853f - Move MachSetPID(1) call to pmap_bootstrap() adajacent to kernel pmap
initialization code.
- Abandon mips_init_proc0() and do the 4 lines straightly in MD mach_init().
- Restore a block of code accidentally lost in prevous commit.
- Change the term 'tlbpid' to a MIPS3 nomenclature 'asid'.
- Hide PTE size exposures by symbolic names in locore.S
1999-05-18 01:36:51 +00:00
nisimura f2119ffdfb - Nuke one unused global variable 'mem_size'.
- Kernel pmap is now dectected by "if (pmap = pmap_kernel())" clause.
1999-05-17 11:12:44 +00:00
nisimura b7876c4182 - Minor code and comment adjustments for pmap_alloc_tlbpid() and
pmap_activate(), no functional change.
1999-05-17 01:10:51 +00:00
nisimura 7a50b38cbd - Adjust descriptive comment of cpu_fork() which returns nothing and
returns once.
- Minor fixes in mips/vm_machdep.c.
1999-05-14 02:11:59 +00:00
thorpej c10a926030 Allow the caller to specify a stack for the child process. If NULL,
the child inherits the stack pointer from the parent (traditional
behavior).  Like the signal stack, the stack area is secified as
a low address and a size; machine-dependent code accounts for stack
direction.

This is required for clone(2).
1999-05-13 21:58:32 +00:00
nisimura 9c2eefcae6 - Introduce MIPS processor interrupt control routines;
_splraise, _spllower, _splset, _splget, _setsoftintr, _clrsoftintr, _splnone.

They manipulate MIPS processor's 8 interrupt sources and are used
as building blocks for NetBSD spl(9) kernel interface.  Note that
MIPS processor doesn't enforce inclusive 'interrupt levels' found
in other processors, then the hierarchal nature of IPL must be
implemented by composing MIPS processor interrupt masks appropriately.

With the simplest target port in which small number of devices are
independently assigned with 6 external interrupt signal lines,
spl(9) kernel interface will be implemented with #define's of
processor interrupt controls mentioned above.  In more general
cases, in which target computers have many devices and 'system
registers' indicating pending interrupt sources at any moment,
spl(9) will be implemented with more complex machinary manipulating
processor interrupts and system registers in target port dependent
ways.

- Nuke unused code and reorder locore definitions.  XXX Following
routines will be replaced with C language version; setrunqueue,
remrunqueue, switchfpregs, savefpregs, MachFPInterrupt.
1999-05-07 01:30:26 +00:00
christos c596c324e3 Define __builtin_*() for lint 1999-05-03 16:30:31 +00:00
cgd 1bce8c40fc ep_arglen is in units of 'sizeof (char *)', not in units of bytes. use
howmany(value, sizeof (char *)) to get the right value.
1999-04-30 23:02:06 +00:00
nisimura 56a9b84b91 - MIPS processors do not impose inclusive (nesting) interrupt levels with
their interrupt lines.  The notion and implemention of 'spl' are left
for how target ports approach to it.
1999-04-26 09:42:14 +00:00
simonb 5d8b1ef3e4 g/c REAL_CLISTS. 1999-04-25 02:56:26 +00:00
simonb b7c062102c Oops, deleted a register_t instead of register in previous. 1999-04-24 15:04:32 +00:00
simonb dc1d3940db Nuke register and remove trailling white space. 1999-04-24 08:01:01 +00:00
thorpej 94682a459b These are no longer used: replaced by locore_mips1.S and locore_mips3.S. 1999-04-23 00:10:15 +00:00
ad d79296c5e9 Disable ntohl/htonl due to duplication in libkern/arch/mips. 1999-04-15 15:30:46 +00:00
drochner 3b45055cd1 adapt to uvm_pagealloc() changes - use UVM_PGA_USERESERVE to allocate
page table pages
1999-04-12 17:59:29 +00:00
drochner ca88198b65 while symbol support in DDB is good to have one _can_ live without it 1999-04-10 15:10:56 +00:00
simonb c7a769fc26 Make unconditional clock cycle counter display conditional on DEBUG
being defined.
1999-04-07 23:04:34 +00:00
soda 009107c3e1 do not include <machine/regdef.h>, but include <mips/regdef.h>,
requested by Matthias Drochner and Toru Nishimura.
1999-04-01 09:02:53 +00:00
soda 678807689c fix error in previous my change 1999-03-30 17:34:55 +00:00
soda 530794ac61 - add _C_LABEL() to IMPORT(), to make this consistent with EXPORT().
- fix some oversight of previous my changes on defined(USE_AENT) or
  !defined(__NO_LEADING_UNDERSCORES__) case.
1999-03-30 16:50:04 +00:00
soda 83c01decb0 ALIAS() is not needed, use XLEAF() or XNESTED() instead 1999-03-30 14:27:56 +00:00
soda 2f780c89c9 - regdef.h is back, so use it.
- ALIAS() is not needed, use XLEAF() or XNESTED() instead
- use AENT() instead of .aent
- _END_LABEL() is not needed (and was wrong)
- define ALEAF(), NLEAF(), NON_LEAF(), NNON_LEAF() by
  XLEAF(), LEAF_NONPROFILE(), NESTED(), NESTED_NONPROFILE()
1999-03-30 14:26:42 +00:00
soda e5eb2cfa3f - protect from multiple inclusion
- incorporate changes to comments from asm.h
1999-03-30 14:22:58 +00:00
simonb c902cc84ca Don't install intr.h - there's only a kernel function prototype in
this file.
1999-03-30 02:16:03 +00:00
mycroft 9c6b797796 Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
  because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
  avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot.  Also, DO NOT use
  pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
  access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
  access_type = 0.  This should probably be revisited.
1999-03-26 23:41:25 +00:00
tsubai 670d76b7ea Remove ifdef UVM. 1999-03-26 03:40:41 +00:00
thorpej 567cda0537 Don't bother allocating mb_map on these systems. Mbuf clusters are
allocated from a pool, and the MIPS and Alpha use KSEG to map pool
pages.  So, mb_map wasn't actually being used.  Saves around 4MB of
kernel virtual address space in a typical configuration.

Garbage-collect the related VM_MBUF_SIZE constant.
1999-03-26 00:15:04 +00:00
mrg 7b93dd1117 remove opt_uvm.h 1999-03-25 00:41:46 +00:00