Commit Graph

472 Commits

Author SHA1 Message Date
perry b46484bb8a RCSID Police. 1998-01-05 20:51:25 +00:00
perry 015e898c02 RCSID Police. 1998-01-05 07:02:46 +00:00
thorpej b9f1b716f3 Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
1998-01-03 01:12:59 +00:00
mhitch cc997082a5 Someone forgot to update db_tlbdump_cmd() when adding the printf routine
to the TLB dump routines arguements.  Machines would die horibbly when
trying to dump the TLB entries in DDB.  Also don't explicitly "page" the
output, since db_printf takes care of that.
1997-12-06 19:19:07 +00:00
kleink 66c2794142 Add _BSD_SUSECONDS_T_ and _BSD_USECONDS_T_; do some space vs. tab formatting
cleanup
1997-11-23 20:20:53 +00:00
mhitch 44c123573b Define PC_ADVANCE() to advance the PC around the break instruction only
if the break instruction is still there.  This works around a problem with
the software single step in DDB not recognizing the temporary breakpoint
set to emulate the single step.
1997-11-18 21:13:17 +00:00
veego df6d37534b s/NETHER/NARP/ and s/ether.h/arp.h/ for the 'new' arp system. 1997-11-13 10:37:40 +00:00
mhitch c390c7a5e1 The address used by mips1_FlushICache() is a virtual address, not a physical
address.  This caused DDB to hang the machine hard when trying to set a
breakpoint.
1997-11-11 16:50:57 +00:00
thorpej 0b04d28454 Mark uses of long long with /* LONGLONG */ for lint. From
Chris Demetriou <cgd@pa.dec.com>.
1997-11-05 04:36:08 +00:00
thorpej a15938129d asm -> __asm__ 1997-11-05 04:02:26 +00:00
thorpej 4730a8cbec Bug fixes and cleanup from Chris Demetriou <cgd@pa.dec.com>:
- fix _C_LABEL so that it actually works.
- make __RENAME use _C_LABEL.
- fix __RENAME so that it expects an unquoted argument.
- fix __indr_reference and __warn_references so that they
  supply their own final semicolon.
- define __warn_references to nothing if not GNU C (required
  by the way it's used).

The __warn_references semicolon change has to be made
so that __warn_references can be defined into nothing.
(A ; all by itself isn't a great idea.)  The __indr_reference
change was made for consistency.
1997-11-04 23:09:23 +00:00
jonathan ba6431afae Incorporate a 4.4BSD-Lite workaround for a bug in cache invalidation.
From   /sys/news3400/news3400/locore.s, with id
	@(#)locore.s	8.3 (Berkeley) 9/23/93

Kazumasa Utashiro notes that the pmax cacheflush routines don't work:
    #ifndef NOTDEF /* I don't know why Ralph's code doesn't work. KU:XXX */

It's because pmax hardware wries the COP0 bit to external branch
logic.  news3400s don't, and so the bc0f loop fails.  It will also
fail on some other models of pmax, but we dont' support them.
Surround the relevant framgents in locore_r200.S with "#ifdef pmax".

Longer-term,  the cacheflush entry in the locore callback may have
to be a  CPU baseboard-specific entry, not just CPU-version specific.
1997-11-01 06:34:07 +00:00
jonathan 84dcba44e2 Add missing `(void)' cast to big-endian variant of {NTOH,HTON}{L,S}(). 1997-10-30 09:07:50 +00:00
thorpej 665f7d1a6e Implement __RENAME() in <machine/cdefs.h> 1997-10-22 05:20:32 +00:00
jonathan 4d29dd99dd Put back duplicate <XXX>_ENDIAN definitions. Defining them as _<XXX>_ENDIAN
loses on non-POSIX source that re-defines <XXX>_ENDIAN itself (e.g., gdb.)
1997-10-20 19:15:40 +00:00
jonathan a03a434f1b * Use ANSI-clean names for host-specific byte-order definition
(_BYTE_ORDER, _BIG_ENDIAN, _LITTLE_ENDIAN).
  Define old names from the ANSI ones if not _POSIX_SOURCE.
* Define _QUAD_HIGHWORD and _QUAD_LOWWORD properly when
  _BYTE_ORDER == _BIG_ENDIAN.
1997-10-20 09:57:05 +00:00
jonathan b29ce8697c Comment out PT_STEP for 1.3. Defining it causes gdb 4.16 to break.
(inferior debugee children die immediately with SIGTRAP.)
1997-10-20 07:29:23 +00:00
jonathan 04c45d466a Define PT_STEP. 1997-10-19 21:49:50 +00:00
jonathan ed413accab Add PT_GETFPREGS, PT_SETFPREGS and process_{read,write}_fpregs. 1997-10-19 21:02:00 +00:00
jonathan 92ed4b0f7f Make the __mcount entrypoint non-static for kernels, to avoid any
chance of gprof mis-report profile ticks in __mcount to  the following
function in libkern (currently _qdivrem).
1997-10-18 22:31:33 +00:00
jonathan 82526d56fd Prototype __flt_rounds(). 1997-10-18 02:43:06 +00:00
jonathan d385e0e57e Prototype ANSI-safe gcc trampoline entrypoint. 1997-10-18 02:25:14 +00:00
jonathan dd7290db41 Add explicit #include <vm/vm.h> before mips/pte.h is included. 1997-10-17 09:34:43 +00:00
jonathan 84d8ac7355 * Performance improvements from July 1997:
Avoid unecessary cache writebacks on mips3. 10% win on kernel builds.
* _KERNEL_RCSID.
1997-10-17 05:57:20 +00:00
jonathan 22b3f9ebd8 Add bi-endian support to mips locore, <mips/endian.h>, and mips_opcode.h.
Derived from a change request (PR port-mips/4277) from
Tsubai Masanari, (tsubai@iri.co.jp).
1997-10-17 04:43:57 +00:00
mhitch c7422c2d87 Fix typo - list/libc/gen/nlist_ecoff.c still wasn't compiling. 1997-10-15 00:59:01 +00:00
mycroft 7b89784c31 GC some bogus definitions. 1997-10-11 16:12:55 +00:00
jonathan 2ebcc702b9 Don't check the actual CPU type unless we're in the _KERNEL, or
src/lib/libc/gen/nlist_ecoff.c breaks.
1997-10-10 03:24:49 +00:00
bouyer 6ab3092b11 Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
1997-10-09 15:42:19 +00:00
jonathan ac262c0c2f Allow mips3 ECOFF binaries if running on a mips3 CPU. 1997-10-08 07:36:58 +00:00
jonathan 1203ea77f9 GNU ld script for linking standalone MIPS code (e.g., bootblocks). 1997-10-05 22:17:56 +00:00
mhitch 9769ae9148 Fix error in msgbuf change: add missing '&&'. 1997-09-24 02:20:56 +00:00
mhitch 5bcefb5bc6 Fix another missed *setregs() change. 1997-09-24 02:15:51 +00:00
leo c5ba7a3102 Move the definition of MSGBUFSIZE up to the machine-arch level if
possible. Pointed out by Bernd Ernesti.
1997-09-20 12:06:37 +00:00
leo d4713d24c2 Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
1997-09-19 13:52:37 +00:00
mycroft 16a8787248 Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way.  (See tech-kern.)
1997-09-11 23:01:44 +00:00
jonathan e14d1d4768 Move SSIZE and DELAY() definitions to sys/arch/mips/include/mips_param.h.
Update comment in pmax/include/param.h (pr 3988).
1997-08-20 03:47:17 +00:00
mhitch 4c88f43717 Get $ra contents from the proper location in the exception/interrupt frames.
Use DDB symbols if available for stack traceback.
1997-08-17 17:02:07 +00:00
mhitch 549e36420e Display jump and branch target with symbols if available.
Clean up indentation - seems to have gotten messed up when the mini-debug
routine was added.
1997-08-17 16:58:53 +00:00
jonathan bf61f3291a Add checks for DS 3100, 2100. Use more generous delay values, these
systems may be memory-bound.
1997-08-14 00:15:37 +00:00
jonathan a5266cdd64 Fix for mbufs that start on odd-byte-aligned boundaries, and use. 1997-08-12 06:05:28 +00:00
jonathan cfc1040a1f Revert syscall interrupt re-enable of previous revision:
introduces a race in trap logging.  Reported by Michael Hitch.
1997-08-10 01:14:49 +00:00
jonathan 85d2b918cd Definition of cpu_mhz. 1997-08-09 19:06:45 +00:00
jonathan baad4266be Fix printf() format strings for VMFAULT_TRACE (see PR port-pmax/3777).
Re-enable interrupts in syscall() before doing anything else; marginal
impprovment (2ms?) in NTP accuracy on 5000/240.
1997-08-09 06:06:37 +00:00
jonathan 95a12ee943 MIPS cpu-speed detection using mc146818 clock.
Compute CPU speed(MHz) and loop multiplier for DELAY() based on
counting empty loop between mcclock ticks.  New global: cpu_mhz.
Change pmax/pmax/machdep.c to build baseboard model names from cpu_mhz.
Set  'cpuspeed' for more realistic DELAY() on mips3 models.

Mips CPU constants, testing, and calibration from D. Sean Davidson
<davidson@zk3.dec.com> and Simon Burge <simonb@telstra.com.au>.
1997-08-09 05:51:56 +00:00
jonathan 003ccf3b1c mips pmap_activate:
* prototype and definition for pmap_activate(p). Updates the segtab,
   and changes the active ASID if p == curproc.
 * Make reserved fixed-address (UADDR) kernelstack PTEs global,
   so we still have a kernel stack after pmap_activate() on curproc.
 * make KSEG2 mappings for p_addr global (see above.)

Seems to detune contextswitch and NTP resolution (by 60 ms), but
thepmap_activate() interface is mandatory.  Needs more thought.
1997-08-09 03:41:02 +00:00
jonathan 1c7fa31659 Add mips_read_causereg() 1997-08-08 06:52:59 +00:00
mhitch b4af013102 Resident count in pmap is now valid. I can now see RSS in ps. 1997-07-29 01:43:26 +00:00
mhitch fd5f2fd062 Get rid of the MIPS3 mess I left in pmap_enter_pv(). The cache inhibit
of cache-index incompatible virtual mappings for a physical page may be
required for hardware without secondary (level 2) cache to detect and
correct virtual coherency problems.  I'm not sure this is really needed
anymore, since pmap_prefer() took care of of the cache-index
incompatible mappings that I have seen.  Count the times a page is
cache inhibited in enter_stats if DEBUG.

Wait for memory instead of panic() on failure to allocate a page for the
segtab or segmap [from OpenBSD arc port].  Also check for malloc()
failure on allocation of a new pv entry and panic().

Increment resident_count when adding a new page to a pmap [also from
OpenBSD].  Process resident size is now valid.
1997-07-29 01:41:46 +00:00
jonathan 98d9a419f8 Add comments to pmap_copy_page() and pmap_zero_page() describing the
cache flush operations required on a virtually-indexed, physically-tagged
mips3 with no L2 cache to provide cache-coherence exceptions.

(Similar to what's needed with a virtually-indexed, virtually-tagged cache.)
1997-07-28 20:41:58 +00:00
mhitch 8e145a319b Don't rely on curproc to access the current pcb when testing for kernel
faults.  Use curpcb, which always points to the current pcb.  If curproc
was NULL when the kernel faulted, the trap handling would fault recursively
and the kernel stack would overflow.
1997-07-26 19:46:40 +00:00
jonathan f9e3ce0f92 revert to MI in_cksum code. 1997-07-25 21:01:45 +00:00
jonathan 83ebfc3545 Unroll pmap_copy_page() and pmap_zero_page() inlined loops even further. 1997-07-23 05:41:17 +00:00
jonathan b1032ac9db Substitute Mach 3.0 MK84 mips kernel bcopy() for Sprite bcopy().
Has unrolled loop for aligned-to-aligned copy.

Notes:
  1. this code tuned for DEC 5000/200.  ioasic decstations do more unaligned
     copies.  Better than old non-unrolled loop, but could be improved.

  2. Undoes changes made for MIPS3 with comment implying an r4000 TLB bug.
     We can't reproduce this on 5000/150 (jonathan) or 5000/50 (mhitch).
     Calls to previous  bcopy with a bad address show similar symptoms,
     reporting a trap in bcopy() after bcopy() has returned.  Same thing??
     Needs re-checking on an r4000 with no L2 cache.
1997-07-23 05:36:40 +00:00
jonathan a6c118666a Fix for chains containing interior mbufs with odd length. 1997-07-22 07:36:18 +00:00
jonathan 592eeb7378 mips-tuned bcopy from Jon Kay (UCSD) released under BSD copyright,
with standard BSD in_cksum() interface by Jonathan Stone.
1997-07-20 22:42:33 +00:00
jonathan f43c13bff4 Add ddb to mips/conf/files.mips. Garbage-collect mdb. 1997-07-20 20:48:40 +00:00
jonathan 5ba85a4cf8 Kernel profiling. Don't profile the following:
sigcode():
      executed from user-space stack.

  mips1_cpu_switch_resume, mips3_cpu_switch_resume:
      arguments passed in via v0, t0, t1 (outlined from cpu_switch())

  mips3_VCED(), mips3_VCEI():
      called from exception-vector code without any register save,
      $at, $ra are live.
1997-07-20 19:48:03 +00:00
jonathan 01794f87e3 Conditionalize mips1-speciifc locore code on #ifdef MIPS1 1997-07-20 19:40:19 +00:00
jonathan fd7a6758c8 Don't emit ".set reorder ; .set noreorder" around mcount profiling
stubs if _LOCORE or _KERNEL are defined,.  _LOCORE means we're
compiling locore. Locore assumes ".set noreorder" for the whole file.
1997-07-20 09:47:03 +00:00
jonathan 9f89c0da89 Use __attribute__((unused). From Chris G. Demetriou <cgd@pa.dec.com>. 1997-07-20 03:47:29 +00:00
jonathan caea1075c9 * Do staktcraces back through traps from kernel mode.
* Don't take  stack adjustment inside procedures as frame size
  (e.g.,  8-byte stack adjustment for calling _mcount).
1997-07-20 03:46:20 +00:00
jonathan 06df97095c Add ecoff ``struct ext_ext'' header fields to ecoff_extsym.h.
Compatible with mips ECOFF nm from GNu binutils or MipsCo toolchain.
1997-07-20 02:38:02 +00:00
jonathan 39814d8abc Add pointer to _mcount to avoid bogus warnings about unused static function.
(calls from interpolated assembler are invisible to gcc.)

If _KERNEL, add prototypes for non-profiled entrypoints _splhigh(), _splx().
1997-07-19 21:30:25 +00:00
jonathan ccf3801c92 * Re-apply changes from rev 1.6 of sys/arch/mips/include/reg.h accidentally
undone by rev 1.7:
  >redo pmax/include/reg.h
  >so that the definitions needed by locore.S are in a separate file,
  >pmax/include/regnum.h.

* Add explicit `#include <mips/regnum.h>'  where symbolic offsets
  into a mips trapframe or struct reg are used..
1997-07-19 09:54:23 +00:00
perry ad1710ce1e update comment from 1981 on memory and disk prices -- pr-2754 from Curt Sampson 1997-07-12 16:18:36 +00:00
jonathan 1490cbcf7b Rewrite struct ecoff_symhdr using the same field ordering as GNU
binutils and the MipsCo toolchain, not the Alpha ordering (which has a
block of int32_t symbol counts and a block of long offsets) .
1997-07-07 19:37:33 +00:00
jonathan 65e2c70353 Force write-back of D-cache after doing DDB writes on mips3. Flushing
the Icache is not sufficient: a mips3 can write a new insn into
writeback L1 Dcache, leaving stale instructions in the mixed L2 cache.
1997-07-07 04:55:27 +00:00
jonathan 919bc0ce92 Typo in RCS id. 1997-07-07 03:57:55 +00:00
jonathan d1ec048977 DDB for mips.
Add DDB interface to /sys/arch/mips/mips..
  Rework heuristic stack traceback to work with DDB.
  Add hooks  to print exception log from DDB.
  Add hooks from pmax console drivers:   call Debugger()
  after break from serial console, or 'DO' key from LK-xxx.
1997-07-07 03:54:24 +00:00
jonathan da53d70f23 Move generic mips functions setregs(), sendsig(), sys_signal()
to sys/arch/mips/mips/mips_machdep.c.  Delete from pica, pmax machdep.c.

Delint pica machdep.c.
1997-07-01 09:32:13 +00:00
jonathan 8586e62e14 Enable stack tracebacks if MDB is configured. 1997-06-30 14:42:32 +00:00
mhitch d6b6efec34 Moved the mini-debug routines out of trap.c into their own file, like the
original pica port.
1997-06-28 03:59:46 +00:00
mhitch a503f4436c Mini-debuuger is now included by options MDB.
Move mini-debugger routines to separate file, minidebug.c.
1997-06-28 03:57:55 +00:00
mhitch 566b174c13 Mini-debugger now included by options MDB.
Cpu_regs() is included by options DEBUG, as are the stacktrace routines,
so move it inside the #ifdef DEBUG along with stacktrace().
1997-06-28 03:55:05 +00:00
mhitch 8c12914cdb Fix typo.
Include minidebug.c with options MDB.
1997-06-28 03:43:21 +00:00
mhitch 63f2f12797 Someday I'll learn how the MIPS cpu works; add some delay after the tlbp
when switching to a new process.  This was causing a ktlbmiss and stack
overflow panic on R3000 machines.
1997-06-25 05:06:01 +00:00
mhitch dc1ece0234 Move the mips*_dump_tlb() routines outside the #ifdef so they are always
available.  Used in the locore ktlbmiss/panic to display the TLB contents
that are mapping the kernel stack.
1997-06-23 21:48:28 +00:00
mhitch f200f89fe7 Remove an incorrect store of the SP when displaying information about a
ktlbmiss on the kernel stack.  It was showing the temporary SP, not the
original SP.

Add a display of the first few wired entries of the TLB so when the ktblmiss
occurs, the TLB entries mapping the kernel stack can be verified.
1997-06-23 21:45:05 +00:00
jonathan 0d95f6f43d Align to 8-byte boundary after ASMSTR(), for mips3. 1997-06-23 06:15:28 +00:00
jonathan d2faa7a82b Set kernel text start address in port-specific Makefile, not ldscript. 1997-06-23 02:40:28 +00:00
jonathan 1eba6a6cc9 Disambiguate cache-size message, as suggested by cgd. 1997-06-22 12:22:37 +00:00
jonathan 1f44934407 * Change Sprite MACH_xxx prefix to MIPS_xxx.
* Use standard mips terminology (xxx_KSEG0, xxx_KSEG1) instead of the
  (more meaningful) Sprite names (xxx_CACHED, xxx_UNCACHED).
1997-06-22 07:42:25 +00:00
jonathan b86aa7f311 Fix typo mips3_mips_switch_exit. 1997-06-22 04:30:01 +00:00
jonathan 4692a37162 Final changes for configuring MIPS1 and MIPS3 in a single kernel.
* cpuregs.h:
    rename remaining VMMACH_xxx TLB macros to MIPS_TLB_xxx.
    Add compile-time MIPS3-only, compile-time  MIPS1-only, and
    runtime (both) definitions  for number of TLB ASIDs (tlb pids)
    and shift count to extract a TLB pid.

  * locore.h:
    Delete unused vector slot for indexed TLB writes.
    mips1 and mips3 TLBs are different enough that we have
    to break them out at the caller anyway.

  * Add compile-time MIPS3-only andcompile-time  MIPS1-only
    macros to call locore functions directly by name.
    Use the  existing method table only if

  * mips/mips_machdep.c, mips/trap.c, mips/pmap.c, pmax/machdep.c:
    Use MIPS3_ or MIPS1_ specific names for TLB pids in
    mips3 and mips1 specific code paths (e.g., creating the kernel stack
    for process 0).

Add `options MIPS3' to pmax/conf/GENERIC.
1997-06-22 03:17:37 +00:00
mhitch a7ac6e48ad Move the CPU-specific shift of the TLB PID into mips_r?000.S. 1997-06-21 06:32:22 +00:00
mhitch b027d98eb5 MachHitFlushDCache is gone. 1997-06-21 04:52:26 +00:00
mhitch edbde97cdf Fix pmap_prefer() to work in merged for mips1/mips3.
Remove unused debug procedure I forgot to remove previously.
Consolidate the vm_page_free1() calls in pmap_release().  Duplicate code
was a result of the way I merged the MIPS3 support from the pica pmap.c.
Enhance the comment on flushing the cache when releasing the segmap pages,
and add a comment about the currently unused code to uncache pages in
pmap_enter_pv().
1997-06-21 04:36:22 +00:00
mhitch 478559dd28 Merged mips1/mips3: cache alias test in pagemove(). 1997-06-21 04:24:45 +00:00
mhitch 51d10edcf2 Restore a lost (int) case in DELAYBRANCH macro - test for BR delay in
unsigned cause register wouldn't have worked.
Add missing ')' in trapdump that shows up when compiled with DEBUG.
Fix (unfix?) previous change to printf formats in mips3_dump_tlb: vad_to_pfn
is now consistant with single-CPU and merged-CPU support.
1997-06-21 04:18:29 +00:00
jonathan 68863ebd8e More mips1/mips3 changes to cpuregs.h and psl.h:
* cpuregs.h:
  Delete unused VMMACH_ names (e.g., duplicates of PTE bits in  pte.h).
  Change remaining VMMACH_xxx  names to MIPS1_xxx or MIPS3_xx.
  Fold remaining compile-time definitions into a single #ifdef MIPS3.

* Use MIPS1_ names  in locore_r2000.S, mips3_ names in locore_r4000.S

* Garbage-collect MachHitFlushDCache()

* psl.h:
  use MIPS1_, MIPS3_  symbolic names for Cause register bits.
  change  _R3K to MIPS1_,  _R4K to MIPS3. Conditionalize for mips1 only,
  mips3 only, or when both are defined,  use runtime CPUISMIPS3 test.
1997-06-21 04:18:09 +00:00
mhitch e03cf7a95c Cast mips1-only and mips3-only pfn_to_vad() macros to match the mips1/mips3
merged inline function.  Fixes inconsist printf format usage in trap.c.
1997-06-21 04:10:42 +00:00
jonathan 63b4439556 Correct cast type on mips3_MachHitFlushDCache(). 1997-06-20 07:35:03 +00:00
jonathan 5ed24fd4b4 trapDump(): compute accurate mask for EXC_CODE from CPU type at runtime. 1997-06-20 05:15:36 +00:00
jonathan c6c2263566 MachHitFlushDCache -> mips3_HitFlushDCache().
Add  XXX reminder to d-cache flush I don't understand.
1997-06-20 04:34:38 +00:00
mhitch 9b445e15ea Use same cachesize variables for mips1 and mips3, and rename the variables
per Jonathan's request.
Remove switch_exit() declaration - it's now called via the locore jump vector.
1997-06-19 06:34:16 +00:00
mhitch 4fa507b4fc More merged mips1/mips3 support:
Remove cpu-specific routines from locore.S and add them to locore_r2000.S
and locore_r4000.S.  Add entries in locore jump vector table for switch_exit()
and the cpu_switch() context resume.
Add offsets into the jump vector to genassym.cf for use in locore.S.
1997-06-19 06:31:14 +00:00
mhitch df0701481f Use same cachesize variables for mips1 and mips3, and rename the variables
per Jonathan's request.
1997-06-19 06:30:47 +00:00
mhitch 129320c2ca More merged mips1/mips3 support:
Remove cpu-specific routines from locore.S and add them to locore_r2000.S
and locore_r4000.S.  Add entries in locore jump vector table for switch_exit()
and the cpu_switch() context resume.
Add offsets into the jump vector to genassym.cf for use in locore.S.

Use same cachesize variables for mips1 and mips3, and rename the variables
per Jonathan's request.
1997-06-19 06:30:03 +00:00
jonathan a066eecaf8 MachHitFlushDCache() -> mips3_HitFlushDCache() outside pmap.c. 1997-06-18 04:51:15 +00:00
jonathan a1085c85ae typo. 1997-06-18 04:23:52 +00:00
jonathan bbc40c6757 RCS id police.
Add a copyright, and a copy of the copyright from the 4.4BSD locore,
from which this is a derived work (as the CVS logs show).
1997-06-18 04:23:14 +00:00
mhitch b61d107b9b Save and restore usermode PC to/from current pcb instead of the RA slot of
the stack frame when usermode interrupt occurs.  The interrupt may have
modified the PC [such as sendsig()].  This got dropped with the stackframe
changes.
1997-06-18 04:07:06 +00:00
mhitch 806f730e87 Remove stray macro definition; didn't hurt for MIPS1 only, but wrong for
MIPS3.
1997-06-17 04:12:38 +00:00
mhitch fb16ddddc7 Fix printf format/argument mismatches. 1997-06-17 04:11:33 +00:00
mhitch 6df1fecbce Virtual coeherency exception handler fixes:
Remove old code now that the new version is working.
  Correct typo for 16K cache (R4400).
  Align the saved AT register location; seems to hang if not aligned on 8
  byte boundry.
1997-06-17 04:10:19 +00:00
jonathan b903dc73da Fix locore cache variables. (Should these be exported from locore at all?) 1997-06-17 01:40:13 +00:00
jonathan 4506da9ebd Check for '#ifdef MIPS1', not '#ifndef MIPS3', since we can now have both.
Add runtime check for 'if (CPUISMIPS3)' inside #ifdef MIPS3.
Add runtime check for 'if (!CPUISMIPS3)' inside #ifdef MIPS1.
1997-06-17 01:38:21 +00:00
jonathan fef3e76b31 Changes for configuring both MIPS1 and MIPS3, from a merge of
similar design and code by Jason Thorpe and Jonathan Stone.

NOTE: the kernel-stack-switching code and cacheflush() calls in
locore.S still use #ifdef MIPS3 and need more work.

mips/include/cpu.h:
    Add CPUISMIPS3 for run-time tests of what CPU architecture level
    we're running on.

mips/include/locore.h:
    Add declarations of locore cache-size variables for ref/def toolchain.

mips/include/mips1_pte.h:
    mips1 TLB bit definitions.

mips/include/mips3_pte.h:
    mips3 TLB bit definitions.

mips/include/pte.h:
    define accesor macros for TLB bits (e.g., mips_pg_m_bit(),
    that expand to CPU constants if only one CPU arch is configured,
    or to inline functions if both MIPS1 and MIPS3 are configured.

mips/mips/locore_r2000.S:
    Use MIPS1_PG_xxx constants inside mips1-specific code.

mips/mips/locore_r4000.S:
    Use MIPS3_PG_xxx constants inside mips3-specific code.

mips/mips/locore.S:
    Use MIPS1_PG_xxx constants inside mips3-specific code.
    Use MIPS1_PG_xxx constants inside mips1-specific code.
    (Needs more  work!)

mips/mips/{pmap.c,vm_machdep.c,trap.c}, pmax/pmax/machdep.c:
    Use MIPS3_PG_xxx constants inside mips3-specific functions,
         and MIPS1_PG_XXX inside mips1-specific code.
    Otherwise, use mips_pg_XXX_bit() macros where they apply,
    and use "if (CPUISMIPS3) { ... } else {... }" where they don't.

mips/mips/mips_machdep.c:
    Import Michael Hitch's fixes from the pmax locore-init code
    into mips_vector_init().

pmax/pmax/machdep.c:
    Use generic mips_vector_init() locore vector-init function.
1997-06-16 23:41:40 +00:00
jonathan eb1d8427cc Garbage-collect redundant declarations:
mips/include/locore.h:
  Add prototypes for HitFlushDCache() functions. Moe cpu_prid definition here.
mips/include/cpu.h:
  remove  cpu_prid definition.
pmax/pmax/machdep.c:
   remove local protoypes of HitFlushDCache() functions.
mips/mips/vm_machdep.c, mips/mips/vm_machdep.c::
   remove local protoypes of HitFlushDCache() functions.
1997-06-16 09:50:26 +00:00
jonathan 2d10220f8f Yet more mips1/mips3 merging:
Move mips-specific pmap definitions (PMAP_PREFER for mips3, declaratin
of pmap_bootstrap() for the system-specific machdep.c) from
arch/pmax/include/pmap.h to arch/mips/include/pmap.h.
1997-06-16 07:47:42 +00:00
jonathan df6533a42e Fix idempotent inclusion test macro: _MACHCONST -> _MIPS_CPUREGS_H_
to avoid collision with obsolete Sprite-derived NetBSD/pica  header file.
1997-06-16 07:41:08 +00:00
jonathan 5db35a8cce Yet more merging:
* Move declaration of locore communcation variables (CPU family,
     cache sizes, etc) to mips/include/locore.h.  Delete from
     pmax/include/cpu.h and older versions from pica/include/cpu.h.

   * Move definitions of CLKF_BASEPRI, CLKF_USERMODE to mips/include/cpu.
   * Delete duplicate definitions in pica/include/cpu.h, pmax/include/cpu.h.
1997-06-16 06:17:25 +00:00
jonathan 8ccf9122e4 Garbage-collect MIPS_3K_xxx, MIPS_4K_xxx outidde mips/include/cpuregs.h:
MIPS_3K_xxx ->    MIPS1_xxx
    MIPS_4K_xxx ->    MIPS3_xxx
1997-06-16 05:37:32 +00:00
jonathan 59c33b9f85 Garbage-collect #include <machine/machConst.h>. 1997-06-16 03:52:37 +00:00
jonathan d3ecedb9fb Garbage-collect non-jumptable prototype for wbflush(). 1997-06-16 03:52:08 +00:00
jonathan 2557a6fa43 GC more old header files:
<machine/locore.h> -> <mips/locore.h>
    <machine/mips_opcode.h> -> <mips/mips_opcode..h>
1997-06-16 03:29:07 +00:00
jonathan 2520d0a604 Remove genassym.c. (pmax has used genassym.cf for some time.) 1997-06-16 02:58:28 +00:00
jonathan c6b9463cd1 Remove all references to <machine/machAsmDefs.h>.
Use #include <mips/asm.h> instead.
1997-06-16 01:23:56 +00:00
jonathan 15628b2d97 Move merged pmax psl.h with mips1/mips3 support to mips/include/psl.h.
Change pmax/include/psl.h to just do #include <mips/psl.h>.

pmax/include/psl.h would go away completely if it wasn't stil required
by compat/common/kern_exit_43.c.
1997-06-16 01:10:03 +00:00
jonathan 8e5f767c50 Use generic MIPS pmap vm_machdep.c 1997-06-16 00:35:10 +00:00
jonathan 747e2b5e7e Generic mips pmap/vm code: move the merged pmax mips1/mips3 vm_machdep
and pmap code to arch/mips/mips.
Use <mips/XXX.h> header files, not <machine/XXX.h>.
1997-06-16 00:16:08 +00:00
mhitch ab0eff4a87 From Toru Nishimura: _FORKBRAINDAMAGE is gone, user process entered through
proc_trampoline().
More merged MIPS1/MIPS3 support.
1997-06-15 18:21:17 +00:00
mhitch f42f8eb4e6 More merged MIPS1/MIPS3 support - from pica pmap.c 1997-06-15 18:19:47 +00:00
mhitch 76f5c2a6c6 More merged MIPS1/MIPS3 support for DECstations. 1997-06-15 18:02:20 +00:00
mhitch 6b75aad4ca From Toru Nishimura: exception trapframe changes, separate out syscall
processing from generic trap processing,  _FORKBRAINDAMAGE is gone -
user process entered through proc_trampoline(), mini-debugger from pica
port.
More merged MIPS1/MIPS3 support for DECstations.
1997-06-15 17:49:53 +00:00
mhitch a5c7f52094 More merged MIPS1/MIPS3 support. Added wbflush() and proc_trampoline() to
locore vector.  Display level 2 (secondary) cache size.
1997-06-15 17:47:46 +00:00
mhitch 6748462623 From Toru Nishimura: _FORKBRAINDAMAGE is gone, user process entered through
proc_trampoline(); move away from UADDR access to user structure.
From Toru Nishimura:  exception trapframe changes, mini-debugger from pica
port, separate out syscall exception.
DECstation MIPS3 support: wbflush() is cpu-dependent, MIPS3 level 2 cache
support.
1997-06-15 17:44:46 +00:00
mhitch 501b5e6892 From Toru Nishimura: adjust for struct user pcb changes. 1997-06-15 17:40:03 +00:00
mhitch 386cf35c8d From Toru Nishimura: exception trapframe changes. 1997-06-15 17:37:45 +00:00
mhitch 27f717cdb8 From Toru Nishimura: user pcb/proc changes for exception handling and
removing access through UADDR.
1997-06-15 17:36:24 +00:00
mhitch ffb95ac852 DECstation MIPS3 support: wbflush() is cpu-dependent, need declaration from
machine/locore.h.
From Toru Nishimura: _FORKBRAINDAMAGE is gone, user process entered through
proc_trampoline() [also cpu-dependent].
1997-06-15 17:33:53 +00:00
mhitch 75b0c4777c From Toru Nishimura: _FORKBRAINDAMAGE is gone, user process entered through
proc_trampoline().
1997-06-15 17:28:46 +00:00
mhitch c06eb27dc9 More merged MIPS1/MIPS3 support: still only allows single-architecture
support.
1997-06-15 17:27:03 +00:00
mhitch fb6d59052e More merged MIPS1/MIPS3 support. The pte definitions still need work before
they can be support both MIPS1 and MIPS3.
1997-06-15 17:24:22 +00:00
jonathan 070deac2d1 Use standard symbolic register names in stacktrace() and logstacktrace(). 1997-06-15 01:18:25 +00:00
jonathan 8e854e11d1 Rewrite stack traceback printing (stacktrace()) and logging(logstacktrace()
wrappers for stacktrace_subr() in assembly code to avoid prototype conflicts.
1997-06-15 01:08:16 +00:00
mrg dc6a98e92c bring mrg-vm-swap2 onto mainilne. 1997-06-12 15:09:23 +00:00
jonathan f89e57aee7 Add sys_sysarch() calls for the standard mips userspace cache-control calls. 1997-06-09 11:46:16 +00:00
jonathan 19e4111ef7 Move the mips sys_machdep.c from pmax/pmax to mips/mips, to enforce a
common sysarch on all mips ports.
1997-06-09 02:14:56 +00:00
jonathan d6a4dfdc41 Declarations for standard MIPS-ABI cacheflush() and cachectl() calls,
as used by g++ trampoline code.
1997-06-08 10:52:04 +00:00
jonathan f15c808e44 Initialize machine_arch from MACHINE_ARCH. 1997-06-08 10:48:02 +00:00
jonathan ccc08d5a61 Move MACHINE_ARCH and _MACHINE_ARCH from pmax/include/param.h to
mips/include/mips_param.h.  (They should be common to all mips ports.)
1997-06-08 10:46:01 +00:00
veego de7e49a954 Add 'char machine_arch[] = "xxx";' for the new sysctl hw.machine_arch. 1997-06-06 23:26:01 +00:00
jonathan 6aa07ba92c Add #ifdef _KERNEL/#endif around prototype of mips single-step emulator.
Add "struct proc;" inside the ifdef: <sys/proc.h> includes <machine/proc.h>
before declaring struct proc.
1997-06-02 01:58:38 +00:00
jonathan ed8e9558ab Lint: printf formats inside #ifdef DEBUG (long vs int, %x vs pointer).
Add XXX to inconsistency: sometimes pmap.c calls blkclr(), sometimes it uses
an inline C loop tuned for 4-entry writebuffer.  Why?
1997-05-26 23:02:11 +00:00
jonathan 333ebdebd6 lint: prototype blkclr __P((caddr_t val, int size)). Used in pmap code. 1997-05-25 23:00:40 +00:00
jonathan dbdac42c7e Add ecoff symbol header definitions for mips1. 1997-05-25 21:22:19 +00:00
jonathan 2548f9ceee lint: add prototype for kvtophys(). 1997-05-25 10:16:17 +00:00
jonathan e991c94232 Add parens where requested by gcc -Wall. 1997-05-25 10:01:38 +00:00