Commit Graph

608 Commits

Author SHA1 Message Date
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
jonathan 94d7e627c1 Rename cpu_singlstep() to mips_singlestep() and add prototype.
(it's not part of the standard interface to MD code.)

XXX Consider moving into process_machdep.c when the mips3 changes are merged.
1997-05-25 09:56:45 +00:00
jonathan cedd6dbe25 Lint: move forward declarations to beginning of file and protoize.
delete unused variables and add redundant parens where suggested.
1997-05-25 05:19:51 +00:00
jonathan d5b9a48fd5 Add prototype for cpu_exec_ecoff_setregs() to mips/inuclde/ecoff_machdep.h.
Use it in compat/ultrix/ultrix_misc.c (setting emul type on mips).
1997-05-24 10:26:30 +00:00
jonathan b14cdadc36 lint: Create mips/include/conf.h with prototypes for {mem device.
Add 'struct proc *p' 4th arg to mmopen(), mmclose().
      Delete unused variable.
1997-05-24 08:57:59 +00:00
jonathan aab81e72b8 lint: add prototypes for interrupt(), softintr(), pppintr(). 1997-05-24 08:49:22 +00:00
jonathan ba1c517a52 GNU ld script for linking mips kernels, contributed by Arne Juul. 1997-05-23 22:21:06 +00:00
jonathan ba2aa6f75a Add cpu_spl[012345]() definitions to locore. These clear the given
interrupt-enable bit in the status register, and all lower bits.

Can be used for spl{bio,net,tty,clock,statclock} on machines where
devices are wried to mips hard-interrupt levels in ascending bit order
so as to match the BSD spl.9 ordering.
1997-05-19 23:25:09 +00:00
jonathan 0a995f71a2 Fix typo. 1997-05-19 21:24:10 +00:00
mhitch 8e9925b45b Eliminate vm_pmap. 1997-05-18 17:26:30 +00:00
jonathan ac99526674 Add defines for increasing SPL levels, assuming devices are wired up
in to CPU interrupt pins in order of increasing priority.
1997-05-18 03:19:41 +00:00
gwr e2a58b69f7 Add #define __VM_PMAP_HACK as a temporary measure. 1997-05-16 21:35:30 +00:00
jonathan e199d62111 Add hooks for definiing kernel RCSId and copyright symbols,
via  asm(".section"),  for compatibility with Alpha tc and ioasic  drivers.

Assumes ELF and binutils-2.8 toolchain.
1997-05-15 08:47:05 +00:00
jonathan ab9bbd64d6 Use genassym.sh script to make assym.h, for cross-compiling.
Remove dependencies on genassym.
1997-03-16 11:54:03 +00:00
is 07b064e02e New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:09:08 +00:00
jonathan 72a7ae4ee5 Add architecture-specific ELf relocs for mips chips. 1997-03-03 00:19:29 +00:00
jonathan cf0bcbc9b6 Define ALIGNED_POINTER
(missed when other <arch>/include/param.h files were updated)
1997-02-28 02:24:41 +00:00
jonathan 1607618d93 pmaxpagesperpage -> mipspagesperpage 1997-01-14 22:29:54 +00:00
jonathan 18a537d1da Pander to "kernel_text" kludge. 1996-12-23 15:27:47 +00:00
jtc 9da5f60715 PROF -> GPROF 1996-11-30 02:48:57 +00:00
jtc 16b48272c4 Define _BSD_CLOCKID_T_ and _BSD_TIMER_T_ 1996-11-15 22:38:45 +00:00
jonathan 0bbccb98a0 Change "___mcount" -> "__mcount" in asm() code in arch/mips/include/profile.h.
Fixes profiling for non-underscore-prepending toolchains
(elf, e.g.,  shared libs), and breaks a.out/ecoff  toolchains.

May  break mips kernel profiling too.  Needs more thought, since the
original intent of __mcount vs ___mcount on mips date back to pre-1.0 days.
1996-11-11 22:13:29 +00:00
jonathan bbcd2bb1ef Elf32 fixes for mips shared libraries:
* handle interpreters with nonzero virtual address of entry-point:
   subtract p_vaddr from computed entrypoint, as the mips elf exec did.

 * Add #ifdef ELF_INTERP_NON_RELOCATABLE/#endif around the code
   that tries to choose a `good' address at which to load an interpreter,
   if none was set by the emul probe  function.
   (the address chosen could be improved to avoid  fragmenting the
    process virtual address space).

 * define ELF_INTERP_NON_RELOCATABLE in machine/elf_machdep.h for mips CPUs,
   which currently use a GNU-derived ld.so.

ELF_INTERP_NON_RELOCATABLE is not necessary for native NetBSD/alpha ELF
binaries. It may be required for GNU-derived ELF dynamic loaders (Linux/i386?)
1996-11-11 20:33:10 +00:00
jonathan 502d34d915 Eliminate old mips/mips/elf.c ELF exec code.
Don't call into from the a.out exec hook; don't configure it into kernels.
1996-11-11 20:23:39 +00:00
jonathan 22858f6aed Eliminate old mips/mips/elf.c ELF exec code.
Don't call into from the a.out exec hook; don't configure it into kernels.
1996-11-11 07:45:30 +00:00
cgd 8a3333b2a9 Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed.  Rename remrq() to
remrunqueue().
1996-11-06 20:19:19 +00:00
jonathan 8ffa855e18 Increase MAXDSIZE to 256Mbytes. 1996-10-16 06:10:41 +00:00
jonathan 27ec6276b8 Rename mips CPU-family locore prefixes for case-consistency:
mips_r2000_, mips_R2000_ -> mips1_
    mips_r4000_, mips_R4000_ -> mips3_
(which are also, for mnemonic reasons,  consistent with gcc flag usage,
 rather than using mipsI_ and mipsIII_).
1996-10-13 21:37:35 +00:00
mhitch bc4aec6c5b Fix error from in_addr_t changes by christos: htonl() takes in_addr_t
parameter, not in_port_t.
1996-10-13 20:59:02 +00:00
jonathan fba8024a86 Add (missing) PAGE_IS_RDONLY() macro to test for readonly pages,
in both mips-I and mips-II versions, and use it in arch/mips/mips/trap.c.
1996-10-13 09:54:39 +00:00
jonathan 6ac1fdec40 Merge mips1 and mips3 pte/pmap code, pass 0;
* Move mips-I pte (TLBlo) definitions from pmax/include/pte.h
      to mips/include/mips1_pte.h

    * Move mips-III pte (TLBlo) definitions from  pica/include/pte.h
      to mips/include/mips3_pte.h

    * Add new mips/include/pte.h, which includes exactly one of
      mips1_pte.h or mips3_pte.h (which still have namespace collisions),
      depending on "options MIPS1" or "options MIPS3". (hack).
      Move soft kvtopte(), ptetovk() definitions to mips/include/pte.h

    * Add macro PTE_TO_PADDR() to hide the different hardware TLB formats
      when mapping from pte to physical address.

   * Add macro PTE_READONLY() to hide lack of SW read-only bit in mips-III
     tlb. (mips1 pmap uses a sw bit in the PTE, mips3 looks up RO bit in
     the kernel pmap.)

   * Use macros (not direct TLB frobbing) in mips/trap.c, to make it
     mips-1/mips-III indepenndet.

    * Change {pmax,pica}/include/pte.h to just do #include <mips/pte.h>.
1996-10-13 09:28:53 +00:00
jonathan a179b23932 Add marker labels to the end of the exception-vector (and exception
jump-table) locore entrypoints, so the stack traceback code can use
the end marker to handle entry points specially when doing  tracebacks,
even if it doesn't know about them  explicitly.
1996-10-13 08:45:15 +00:00
jonathan bc759e3dfb Apply
>backout previous kprintf change
change.
1996-10-13 07:45:01 +00:00
jonathan a49fa844a1 Fix stack traceback code for merged mips1/mips3 support:
add catch-all case, with distinct mips1 and mips3 ranges for locore
entry points,  cases to catch othewise-unknown locore entrypoints and
vector code (which have special entry sequences and require special
support to trace through).   The relevant mips1 and mips3 functions are
of course now distinct.
1996-10-13 07:09:33 +00:00
jonathan bb34d39024 Change pmax port over to using ``mips MI'' trap handler. 1996-10-13 05:28:48 +00:00
jonathan 54766d93cf Merge low-level mips trap handling and move to arch/mips/mips/trap.c. 1996-10-13 05:14:35 +00:00
christos d286889901 backout previous kprintf change 1996-10-13 03:39:27 +00:00
christos e37692f04d backout previous kprintf change 1996-10-13 03:29:05 +00:00
christos de83b4558f use in_addr_t and in_port_t 1996-10-13 03:02:26 +00:00
mhitch 4d1a9465f1 Add arch/mips/mips/mips_machdep.c, it's now compiled as a separate file. 1996-10-12 15:49:15 +00:00
christos 19d8368f2f printf -> kprintf, sprintf -> ksprintf 1996-10-11 00:44:42 +00:00
christos 8f56de03e1 printf -> kprintf 1996-10-11 00:22:09 +00:00
cgd 472889f8e4 moved to aout_machdep.h (via repository copy) 1996-10-08 12:57:37 +00:00
jonathan ba4d6af5fa Merge back MIPS3 locore stack-traceback code. 1996-10-07 11:20:53 +00:00
jonathan 45c47f41aa Fix for elf{32,64} changes: make <mips/reloc.h> re-includable,
Use elf_xxx section names (not elf32_xxx)in mips/mips/elf.c
1996-10-07 03:15:03 +00:00
jonathan fbdaac9a7a Use "MIPS1" and "MIPS3" as preprocessor tokens to select {config,compile}-time
support for mips-1 (r2000 family) and mips-3 (r4000 family) CPUs.
Avoids inconsistent use of CPU_R2000 and CPU_R3000.
1996-10-07 02:17:33 +00:00
jonathan 6c0d846a3d Include <mips/asm.h>, not the Sprite header names. 1996-09-30 02:21:20 +00:00
jonathan 1fc59008c3 Move Decstation-specific locore code (sii DMA copy, vmstat -i counters)
from arch/mips/mips/locore.S to arch/pmax/pmax/locore_machdep.S.
1996-09-30 01:30:21 +00:00
jonathan 0cfd4f8641 Update arch/pmax/Makefile to build in NetBSD rather than 4.4-Lite:
* Create arch/mips/Makefile.inc with source list of generic MIPS-cpu
    files for tags
  * Use mips/Makefile.inc and updated tag list in pmax/Makefile
  * Try building bootblocks in arch/pmax/stand.
1996-09-29 23:51:22 +00:00
cgd 64f4e1937e rename <machine/ecoff.h> to <machine/ecoff_machdep.h> for clarity and
consistency with the way machdep headers for other things are done.
(the creation of the ecoff_machdep.h files was done on the CVS server, to
keep the RCS logs intact.)
1996-09-26 22:39:14 +00:00
cgd 0e097578a2 add and use a machine-dependent header, which currently defines some
macros to use to remove #ifdefs from the machine ID case check.
Eventually, these headers will contain other information, e.g.
machine-dependent relocation information, etc.
1996-09-26 21:50:55 +00:00
jonathan be78089fff * Add missing `UADDR' argument to RESTORE_USER_REGS() macro calls.
* Add back copyright notice and rcs ID from parent of previous
  revision (pre-merge).
1996-09-20 23:44:10 +00:00
jonathan de735d506d Fix for problem report port-pmax/2173: the local variable "inst"
in the branch-emulation  code was uninitialized, due to a misplaced #endif.

Remove the relevant #ifdef (macro version of GetBranchDest), and move the
XXX note about r4000 branch targets to the  function definition.
1996-09-18 11:16:20 +00:00
mycroft e6dd44f034 Use SIGBUS iff we get a legitimate bus fault. Use SIGSEGV for page protection
violations (per Solaris, SVR4, AIX, Linux, Irix, and SunOS).
1996-09-07 22:26:41 +00:00
jonathan 1cc7b834e4 * Add declarations for MIPS-III (r4000) locore entrypoints.
* Add initialization code to set MIPS-III exception vector and runtime
  jump-table for locore functions.
* Clean up for -Wall, pass 1.
1996-08-13 08:19:50 +00:00
jonathan 99b43cc2bc * Apply LOCORE -> _LOCORE change so locore.S doesn't #include struct
definitions.

* Include <mips/cpuregs.h> in <cpu.h> so kern_clock.c has user/kernel
  status bits in scope.  Still needs  work; r2k/r4k previous-mode bits
  are different.

* Include <mips/mips_param.h> in pica/include/param.h, for locore declarations,
  and definitions of vm and  other constants that should be shared across
  NetBSD/mips  systems to esnsure user-level binary compatibility.
1996-08-11 23:30:22 +00:00
mhitch 79fb4c0c30 Add missing #include of "ppp.h" to get definition of NPPP so that the
pppintr() call is actually included.  This fixes ppp so that it actually
works again.
1996-08-09 05:11:02 +00:00
thorpej cc1c24bbec RCS id police. 1996-07-16 23:23:55 +00:00
jonathan 9f364d3a3b Rename unused macro ELF_HDR_SIZE -> MIPS_ELF_HDR_SIZE to avoid clash
with #define of ELF_HDR_SIZE in MI elf code.
1996-06-26 04:41:41 +00:00
jonathan fc7c84da3a Explictly credit Per Fogelstrom for the mips shared library support in elf.c,
which was taken from OpenBSD/pica.

The previous revision of elf.c replaced Ted Lemon's elf exec machinery
with something closer to Christos' MI elf machinery. It turns out
that old NetBSD/pmax elf binaries have three segments, and the newer
elf exec machinery cannot exec them.

The old elf exec machinery is folded back into cpu_exec.c, which falls
back onto using the old machinery if the new machinery fails. The
old-style binaries will be deprecated at the 1.2 release.
1996-06-20 07:06:36 +00:00
jonathan 9fedff95ce Update mipspmax elf exec support:
* Update arch/mips/mips/cpu_exec.c to include MI exec_elf.h header,
    and to use the MI interface exec_elf_makecmds().
  * Replace arch/mips/mips/elf.c (Ted Lemon's elf code) with
    a version of Christos's MI elf exec code, munged to support demand paging
    and mips shared libraries.
1996-06-17 10:51:28 +00:00
jonathan b212f1b0c1 Move cpu_singlestep outside of #ifdef DEBUG/#endif; the process-tracing code
in  mips/mips/process_machdep.c (erroneously) calls cpu_singlestep().
1996-06-17 07:55:13 +00:00
jonathan e0638e0c44 Include <mips/types.h> to bring u_int32_t and u_int16_t in scope for
the argument and return type of  {n,h}to{h,n}{l,s}.
1996-06-05 23:44:31 +00:00
jonathan 4139356a98 Copy the pmax locore.S code into the arch/mips hierarchy and split
it into three pieces:

 * locore.S, which contains generic mips locore code,
   applicable for both r2000/r3000 and r4000s (in 32-bit mode).

 * locore_r2000.S, which contains r2000/r3000 (MIPS-I) versions
   of the locore functions that need mips-generation-specific
   instructions or handling.
 * locore_r4000.S, which contains r4000/r4400/r4600 (MIPS-III?) versions
   of the locore functions that need mips-generation-specific
   instructions or handling.

Much of the code in locore_r4000.S is derived from Per Fogelstrom's Pica port.
locore.S still contains some pmax-specific DMA-buffer copy functions.
1996-05-21 00:20:40 +00:00
jonathan e704a8e1e9 * Move the declarations of mips locore functions from the pmax tree
to the mips tree.
* Add declarations of functions used by vm_machdep.c.
* Add declarations of functions printed by name in stack tracebacks.
* Add declarations of functions used by the model-independnet mips machdep.c
  code.
1996-05-20 23:38:26 +00:00
jonathan 7666d5b36b Check that either CPU_R3000 or CPU_R4000 is defined. Fix the r3k/r2k
symbolic lookup of the CPU-level specific locore entry points to use the
r2k, not the r4k, labels.

Include header files to get prototyped declarations of ipintr() and arpintr().
Remove unused variables and parenthesize assignments in if () expressions.

Gcc warns of a possible && vs || operator-precedence bug in the network
softint dispatch code, which needs more thought.
1996-05-20 23:24:00 +00:00
jonathan baa655bc0f Update the DECstation stack-traceback pretty-printer, KN01 interrupt handler,
and IOCTL ASIC dma-buffer-reservation code to use the reorganized am7990
preprocessor tokens and function names.
1996-05-19 17:58:12 +00:00
jonathan 6d5fbdfbe2 Remove common-across-all-MIPS-cpu definitions (e.g., user-level-visible
page/segment size definitions and macros) from pmax/include/param.h,
and move them to mips/include/mips_param.h.
1996-05-19 17:52:18 +00:00
jonathan e2a698293c Add local declarations for locore functions. Fix pagemove() return
type to be void. Add explicit "int" return types.
Fix format/argument mismatches for vm_offset_t's in diagnostic messages.
1996-05-19 15:55:31 +00:00
jonathan a67936cc04 Declare mips_elf_makecmds(), not pmax_elf_makecmds(). 1996-05-19 04:15:37 +00:00
jonathan bce6b88e9a Include <machine/locore.h>, to force all MIPS cpu-model specific
locore calls to go via a locore-entry jumptable.

Cast the (int) arguments  to MachTLBUpdateEntry() to avoid
warnings.  Variables TLB entries are still type-punned as either structs
or ints, without any regard, when the pmax-specific VM code passes
them as arguments to functions.
1996-05-19 02:00:58 +00:00
jonathan 6bb09a3781 Include <machine/locore.h>, to force all MIPS cpu-model specific
locore calls to go via a locore-entry jumptable.

Use mips_btop(), mips_round_page, mips_trunc_seg() instead
of pmax_btop(), pmax_round_page, pmax_trunc_seg().

Add Per's software-readonly-bit mechanism, since the r2000 and r4000
hardware TLB entries are  very different, and the r4k has no space for
software bits in TLB entries.  That is, this pmap code still won't work
on r4000 machines. Some other solution, like another jump table for
clients of the  pmap code, is necessary.
1996-05-19 01:58:35 +00:00
jonathan b4c4b28e43 Include <machine/locore.h>, to force all MIPS cpu-model specific
locore calls to go via a locore-entry jumptable.

Declare  r2000- and r4000-specific exception-handler functions, to which
trap() and interrupt() dispatch exceptions. Initialize r2000- and r4000-
specific exception-handler vectors, when CPU_R4000 and CPU_R2000 are
defined.

Update the stack-traceback code (partially) to understand and print
the new low-level exception-handler code, via which machine exception-vectors
send exceptions to call trap() or interrupt(). This needs  more work.
1996-05-19 01:54:49 +00:00
jonathan 5a890607de Define the conventional pmax locore entry-point names to be calls through
an vector (struct) of function pointers.  Add prototype declarations for
each vector entry.
Add declarations for the r2000 (MIPS-I) and r4000 (MIPS-III) locore
versions of the relevant functions.
1996-05-19 01:32:56 +00:00
jonathan 0064a12f68 Create mips_machdep.c, which contains Mips-specific functions common
to all mips ports.

So far, this consists of code to initialize a vector, or jump-table, of
pointers to locore functions that require different definitions on different
Mips CPUs (eg., r2000/3000 and r4000); a generic wrapper for setting up
CPU-specific exception vectors; and CPU and FPU identification code.
1996-05-19 00:31:57 +00:00
jonathan 503d421a0a Add alternate "mips_r2000_<XXX>" entry points for the r2000/r3000-specific
locore functions.  The new names are used by C code to construct a jump-table,.
making it less infeasible to have a single kernel image work on both
r3000 and r4000 systems.
1996-05-19 00:25:14 +00:00
cgd d5b0482bb9 update for changed ecoff headers. minor consistency changes for the
ecoff functions, as well.
1996-05-09 23:48:47 +00:00
cgd b10c43013d change structure member names to be in line with what various ECOFF
documentation I have calls them, and update for new definitions in
sys/exec_ecoff.h.
1996-05-09 23:46:18 +00:00
jonathan 368824e74c Fixes for -Wall -Wmissing-prototypes:
Add prototypes to (most of) src/sys/arch/pmax/pmax. (The  un-protytyped
   parts still have pending merges with the Pica port.)
   Fix splx() glitches in pmax/clock.c.
   Delete old cpu/fpu identification from pmax/autoconf.c, use r4400/r4600/idt
   aware code from Pica port, now in mips/mips/mips_machdep.c.
   Delete unused multi-CPU autoconfiguration code; NetBSD/pmax does not
   support decsystem 5800s anyway.
1996-04-10 17:38:18 +00:00
jonathan 8a1933076a Fixes for -Wall -Wmissing-prototypes:
Replace impliclty-sized types (u_long, u_short) used in
	declarations of byteorder functions witho explicitly sized types
	(u_int32_t, u_int16_t).

Avoids problems with using ntohl(foo) as (eg) an argument to printf().
1996-04-09 20:56:45 +00:00
jonathan 08a45c0a18 Fixes for -Wall -Wmissing-prototypes:
Do not define __BDEVSW_DUMP_OLD_TYPE, as it breaks prototyping
	of device dump functions, and should be port-dependent in any case.
The pmax 4.4bsd/pmax-derived drivers are being fixed, and the pica port
uses the MI scsi drivers already.
1996-04-09 20:54:08 +00:00
jonathan d115f89b5f Update arch/pmax/pmax/genassym.c to compile with -Wall: use offsetof().
Move to mips/pmax/genassym.c, as (most of) the assembler locore code is
being merged into a generic-MIPS locore.

Remove the redundant pmax/pmax/genassym.c.
1996-04-07 14:27:00 +00:00
jonathan 5163f64c0f merge mips and pica locore.S, pass 0:
* cut-and-paste all the code for both r2000 (MIPS-I) and r4000 (MIPS-III)
      into both the pica and pmax locore.S.

    * Change the names of the small segments of vector code that are
      bcopied to the machine vector locations, to avoid clashing.
      Get rid of the Sprite MachXXX names for the vector code, and
      use use mips_r2000_xxx and mips_r4000_xxx instead.

      Update the names used in the vector-copying code and trap handlers
      to match.

    * Most of the rest of the pica locore.S was copied from the pmax
      locore.S, and then edited to work on an r4000.  The names of
      functions and of manifest constants stayed the same, although
      both assmbler code and constant values changed.
      cut-and-paste such code into contiguous blocks protected by
      #if / #endif.  Much of the cache and trap-handling code
      needs r3000-only register fields, on the r3000, and r4000-only
      insns and registers on the r4000.

   * change the pmax r2000 exception-handling code to extract a trap
     code with the user/kernel bit at 0x20 rather than 0x10.
     (r2000s have 4-bit execption codes, r4000s have 5-bit.)
     Use the a 16 from-user-space + 16-from-kernel space jump table,
     just like on the r4000 pica port.

   * add NOPs to the common code where required by the r4000 pipeline
     constraints.
   * add _C_LABEL() macros to the r4000 locore.

Comitted to provide a snapshot for others to test, and work on a cleaner merge.
1996-03-31 03:38:21 +00:00
jonathan 34ab2734da Resolve all differences between the Pica and pmax versions of machConst.h:
* add "MIPS_3k_" for the MIPS-I r[23]000-specific register definitions.
    * add "MIPS_4k_" for the MIPS-II/III r4000-specific register definitions.
    * add #defines that provide the old values for locore and user
      code, so the existing code continues  to compile.

Regression-tested against the  old headers by grepping for #define's,
editing out the defined symbols, and preprocessing with both the previous
machConst.h headers and this version.

Some unused symbols (CPU and FPU must-be-zero constants) are no longer defined.
Pica interrupt masks are now constant expressions instead of constant
values.

TODO:
    * factor out the common #defines into src/sys/arch/mips.
    * Get rid of the Sprite coding-style names (MACH_xxx).
    * Separate out the r3k/r4k differences from the Pica/pmax differences.
    * Figure out how to have a run-time choice of r3k vs. r4k support,
     instead of a compile-time choice.
1996-03-28 11:34:05 +00:00
jonathan bfa1f425bc Add mips/mips/mem.c and mips/mips/process_machdep.c 1996-03-26 11:45:59 +00:00
jonathan 97f32908b1 Split trap handler into mips-generic and port-specific functions:
* Delete pmax-specific functions and declarations from trap.c

* Delete mips-geeneric functions and declaratinos from pmax_trap.c

* Rename the function pointer used to handle hardware interrupts to
 "mips_hardware_intr".  Define it in trap.c. Change references elsewhere,
  including machdep.c.

Verified to boot on a 5000/200.
1996-03-25 06:44:17 +00:00
jonathan 458024d39d Random additions from the Pica r4k port:
* Add spl4() and spl5() functions from the Pica port.
* Add MachFPTrap() as an alternate entry point for MachFPInterrupt.
  The r4k reports floating-point execptions as a trap, not an interrupt,
  and the Pica port uses the name MachFPTrap().
* Add nops to the Mach_spl?() functions and MachFPInterrupt, as required
   for the r4k port.
Commit "floppy"  interrupt counter for vmstat -i.
1996-03-25 06:40:39 +00:00
jonathan 522f8705a1 Copy src/sys/arch/pmax/pmax/trap.c to pmax_trap.c.
trap.c will contain the port-independent mips trap-handling functions.
pmax_trap.h will contain the pmax-specific interrupt handlers.
1996-03-25 05:55:30 +00:00
jonathan e920e8f829 Force reporting of memory errors for the 3MAX (aka kn02 aka 5000/200) to
always be eight digits.
Copy the kn02 memory-interrupt reporting function to the kn03 (5k/240)
memory-error handler, since the 3MAXPLUS seems to use the same ECC hardware
as the 3MAX.
1996-03-25 03:18:15 +00:00
jonathan 3b5a818c4e Rename from pmax/include/machAsmDefs.h to mips/include/asm.h.
Update the include-idempotency preprocessor token to match.

References to machAsmDefs in vendor (sprite, 4.4bsd) headers left unchanged,
for historical accuracy.
1996-03-25 02:50:50 +00:00
jonathan 71b212b66a Change pmax T_USER bit (software only) to be 0x20, the same as the
Pica port. (The r4000 CPU used in the pica has more hardware execption types.)
1996-03-24 08:12:53 +00:00
jonathan 893a0b508b fix case typo: CLKF_BASEPRI_R4k to _R4K 1996-03-23 20:28:19 +00:00
jonathan cd58cb9caa Factor out r3000 versus r4000 differences (CLKF_USERMODE() and CLKF_BASEPRI()),
provide r3k and r4k versions of each, and move to sys/arch/mips/include.

Note in comments where each mips-based port should provide
definitions in its own cpu.h after including this file.
1996-03-23 20:21:49 +00:00
jonathan 78aac1c7b9 Merge in additions of missing MIPS-I opcodes, and r4000-in-32-bit mode
opcodes from the Pica port.   Per Fogelstrom claims the latter are all
supposedly  MIPS-II (r6000) instructions, rather than MIPS-III (R4000),
but we haven't checked to be sure.  Are LL/SC really in MIPS-II?
CVS:: ----------------------------------------------------------------------
1996-03-23 18:49:29 +00:00
jonathan bfb10e5bdf Rename "pmax_elf_makecmds()" to "mips_elf_makecmds()".x 1996-03-23 04:59:00 +00:00
jonathan 69a70ec129 Merge in changes from the Pica port.
Still needs more thought for single-stepping and process_write_regs().
1996-03-20 01:30:49 +00:00
jonathan e3bc270a69 Change "XXX_pmax" to "XXX_mips" in preparation for merging with
Pica reloc.h.
1996-03-19 22:18:45 +00:00
jonathan f8342fcf97 Remove #ifdef LANGUAGE_C - protected definition of "struct reg".
(It was a duplicate of the real definition reg.h and was never used.)
1996-03-19 15:20:39 +00:00
jonathan d2c42783a3 Add trap definitions added for the r4000 port.
Note: T_USER is different in the pmax and pica ports!
1996-03-19 04:34:57 +00:00
jonathan ac7c6304db Add eight 32-bit (XXX) words of reserved space to struct sigcontext,
for binary compatibilty with the pica port.
1996-03-19 04:22:04 +00:00
jonathan ad4d94c4f3 Change "pmax_xxx" macros to "mips_xxx" macros, in preparation
for moving to src/sys/arch/mips/include/pmap.h.
1996-03-19 04:15:15 +00:00
jonathan 648169b854 Kernel config file for source code shared by mips-based NetBSD ports. 1996-03-19 03:26:29 +00:00
jonathan dcb272ef6e Remove pmax-specific CLK_TICK to prepare for moving to sys/arch/mips. 1996-03-19 02:45:48 +00:00
jonathan b495cef581 Add additional mips CPU and FPU ids from Pica port:
IDT r3081 family, r4600, MIPS-IV architecture, others.
1996-03-19 02:42:28 +00:00
jonathan 1cc17fc971 Change "pmax" -> "mips" before moving to sys/arch/mips/include. 1996-03-19 02:12:05 +00:00
jonathan c29eb3ea76 NetBSD's ieee FP definitions for the pmax are valid for other mips cpus;
change preprocessor XXX_PMAX_YYY #defines to XXX_MIPS_YYY.
1996-03-18 22:40:21 +00:00
jonathan ffd8d4cdc7 Additional fixes to complete the NetBSD/1.1B config changes:
Update the kn01 (3100 aka pmax) interrupt handler to use XXX_cd instead
of XXXcd.
1996-03-17 22:12:13 +00:00
jtc 2ce5f1478b Add _BSD_WINT_T_ definition so we can handle wint_t type added in NA1. 1996-03-16 01:31:45 +00:00
jonathan dc6fdf6cdc First commit of Per Fogelstrom's port to the Acer pica r4400/isa machine. 1996-03-13 04:58:04 +00:00
jonathan ff27dbbcf9 Revert pmax stdarg.h and varargs.h to versions from 1995-11-13. Those
versions work correctly; at some point between then and the immediately
preceding revisions, the "stylistic" changes to one (or both) stdarg.h
and varargs.h broke passing doubles to printf().
1996-02-26 23:29:05 +00:00
jonathan bf52fa8269 The prototyping `fixes' broke vmapbuf() and vunmapbuf(), due to a "sz"
parameter parameters shadowing locals.  Replace vmapbuf() and vunmapbuf()
with the Alpha-port versions, which are cleaner (use round_page(),
trunc_page(), etc.)
1996-02-06 00:31:51 +00:00
jonathan cb7e6f2e0f Change last argument of ktrsysret() call: pass rval[0], not rval, as
ktrsysret() expects.   Tracing of  rval[1] remains an open problem.
1996-02-06 00:13:04 +00:00
christos 2c8314f73c vm prototype changes 1996-02-05 02:06:38 +00:00
jonathan 1f780158bb Redo the locore interrupt counters reported by vmstat -i:
* add a new enum decstation_intr_t to trap.c, naming each instrumented
  interrupt symbolically, and used to index into intrcnt[].  Change the
  model-specific interrupt handlers to use the decstation_intr_t when
  updating interrupt counters.
* add instrumentation to the kmin and maxine interrupt handlers.
* fix a bug that counted each hardclock interrupts on the kn02 twice.

The hardcoded mapping from locore names to units is gross; but these
counters will hopefully be useful in identifying interrupt hot-spots
and PPP problems on the 3MIN.
1996-02-04 20:14:17 +00:00
mycroft 9db20bf150 Don't define _KERNEL here. 1996-02-02 19:42:08 +00:00
mycroft 9d9a70a5a2 Fix #includes. 1996-02-02 18:05:36 +00:00
mycroft 88e512b693 LOCORE -> _LOCORE 1996-02-01 22:28:24 +00:00
jonathan e229c8d175 Resolve pmax and alpha IOCTL asic driver differences, pass 1:
Rename the ioctl asic register and slot macros from ASIC_<xxx> to
IOASIC_<xxx>, to be compatible with the machine-indpendent names in
sys/dev/tc/ioasicvar.h.  The pmax code still uses
sys/arch/pmax/pmax/asic.h, as some of the registers and offsets
defined there are not yet defined in sys/dev/tc/ioasicvar.h.

Rename the ioctl asic base-address pointer from `asic_base' to `ioasic_base'.
1996-01-31 08:46:42 +00:00
jonathan 5ea2ec2357 Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
  * Change the tc autoconfiguration tables to use a struct tc_attach_args
    instead of the ad-hoc structure.
  * Change all pmax device drivers to use a `struct confargs' that's
    assignment-compatible with  sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
    Devices that can be present on a TC or as ioctl asic/mainbus builtins
    use  the same `struct confargs'.
  * Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
    an old, now-obsolete sys/arch/alpha snapshot.

  * Update the comments and debugging code in interrupt handlers to
    be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
1996-01-29 22:52:15 +00:00
jonathan df51f8395d Change MachEmulateBranch() to be able to read an insn from user space.
Kernel-debugger breakpoints in user space, or FP insns that cause
underflow in a delay slot, should now work properly. Single-stepping
of arbitrary user processes, from user level, should be added.
1995-12-28 16:22:41 +00:00
mycroft cd8fe86bcb Make the type of __builtin_va_list a long. 1995-12-26 01:16:24 +00:00
mycroft 0c00214737 Use __builtin_va_alist. 1995-12-26 00:19:09 +00:00
mycroft fa887628d8 Stylistic changes. 1995-12-25 23:15:31 +00:00
mycroft d1de691efb Stylistic changes. 1995-12-25 22:22:02 +00:00
mycroft 0199e002ad Update for GCC 2.7, and fix bugs. 1995-12-25 21:41:08 +00:00
jonathan 2852152043 Reserve a number in the machine-dependent range for PT_STEP, in
case the kernel-debugger implementation of single-stepping ever works
with user code.
1995-12-21 09:28:36 +00:00
jonathan c0f958f6be Add support for ptrace PT_GETREGS and PT_SETREGS for NetBSD/pmax:
* define PT_GETREGS and PT_SETREGS in pmax/include/ptrace.h
 * Flesh out the stubs in pmax/pmax/process_machdep.c to handle
   those requests.
 * Now that "struct reg" is actually used, remove the bogus
   #ifdef LANGUAGE_C around its definition, and redo pmax/include/reg.h
   so that the definitions needed by locore.S are in a separate file,
   pmax/include/regnum.h.
 * update locore.S to match.
1995-12-20 02:00:23 +00:00
jonathan 00b821d6c2 Change mips __warn_references() macro to use the ELF warning features
in binutils 2.6 and (patched) gcc 2.7.2. Only works with gcc in ANSI C
mode, for now.
1995-12-15 01:17:04 +00:00
mycroft 292120bf63 Define __FORK_BRAINDAMAGE. 1995-12-09 04:41:41 +00:00
jtc 0cd793449e merge in changes from 1.1 release branch 1995-11-30 00:56:23 +00:00
jonathan ae1b64d888 Fix btoc()/ctob() typo in reading physical memory that stopped ps
from reading process argument lists.
Allow kernel-virtual memory reads to read the message buffer, since
dmesg needs it.
1995-09-29 21:53:29 +00:00
jonathan b543578236 Add a missing "nop" in a delay slot in the floating-point exception
handler.  Gradual underflow and fp emulation now work correctly.
Proper denorms also fix strtod() inaccuracies and Gcc's "enquire" program.
1995-09-28 20:02:50 +00:00
jonathan cd887a9930 Add "kvtophys()", which maps MIPS R2000 kernel-virtual addresses to physical addresses,
so they can (e.g.) be written to DMA mapping registers.
1995-09-25 20:36:23 +00:00
jonathan d1234038d4 Rename the force-all-pending-writes to memory function to wbflush().
Keep the old Mach-derived name "MachEmptyWriteBuffer()" as an alternate
entry point.
1995-09-21 23:28:31 +00:00
jonathan 0641f09bfb Include <sys/mount.h>, as the new <sys/syscallargs.h> won't compile without it. 1995-09-20 23:33:25 +00:00
thorpej 7d7396c414 Make system calls conform to a standard prototype and bring those
prototypes into scope.
1995-09-19 22:53:47 +00:00
jonathan 9a914b5b01 Rename the Decstation 2100/3100 interrupt functions from "pmax_<func>"
to "kn01_<func>", to avoid confounding a model name (PMAX) with the name of the
entire port (pmax).


Change the signature of interrupt-handlers to take a void *
(a pointer to the softc) and return an int (indicating spurious
interrupts or other conditions.)

Pass softc pointers to the scsi and ethernet kn01 (DS_PMAX)  drivers,
rather than having unit numbers wired into the base-level interrupt
handler.
1995-09-11 22:03:00 +00:00
mycroft fa13d32c41 Add splsoftnet(). 1995-08-13 00:16:08 +00:00
jonathan 6a99440efd Add prototypes for most functions. Fix typo where statements
intended to increment interrupt counters for vmstat -i (i.e., "ctr++")
on 3100s had just a single "+", and hence had no effect.
1995-08-01 06:58:57 +00:00
jonathan 4525afdaeb Add diagnostics for 5k/240 turbochannel interrupts, and clean up IOASIC clock
declarations.
1995-07-23 20:21:17 +00:00
cgd 479fb9e45b add <sys/cdefs.h> inclusions. namsspace-protect physadr, label_t
def'ns against _POSIX_SOURCE and _ANSI_SOURCE.
1995-07-06 03:39:32 +00:00
paulus 08b7596c51 Add code to interrupt to call pppintr. 1995-07-04 12:22:21 +00:00
cgd c83f9c5568 remove unused cpu_exec() definitions. moved "broken swap" markers, for
ports that still need it, to types.h.
1995-06-28 02:55:18 +00:00
cgd 1c0be437b1 define __BDEVSW_DUMP_OLD_TYPE for ports where it's true. clean up
some m68k ports inclusion of common header.
1995-06-26 05:13:37 +00:00
jtc 55fbbc705d Wrap with #ifndef _XXX_FLOAT_H_/#define _XXX_FLOAT_H_/ ... /#endif. 1995-06-20 20:45:22 +00:00
jtc 1d65cdd4ab #include <sys/cdefs.h>.
Wrap __flt_rounds() declaration with __BEGIN_DECLS/__END_DECLS.
1995-06-20 20:32:22 +00:00
mellon 1305dc32df Put parentheses around macro arguments 1995-06-16 02:07:33 +00:00
jonathan ae4eae4f63 Change reference in asm code from ``__mcount'' to ``___mcount'', to be
consistent with the (default) prepending of underscores to identifiers.

Because this reference is inside an ASM string it's too hairy to
conditionalize to support different toolchains that don't prepend underscores.
(Just don't do profiling with  such  toolchains.)
1995-05-31 00:25:06 +00:00
jtc f90f8d10aa Removing -DKERNEL, transition to _KERNEL has been completed 1995-05-16 22:24:17 +00:00
jonathan 4175c2819f Redo 3MAX+ (5k/240) interrupt enable code.
Instead of being a no-op, kn03_intr_enable() sets the sw copy of the
interrupt-enable mask *and* writes it into the IO asic intr-enable
register.  Boot code sets the sw copy (kn03_tc_imask) to something
sane (KN03_IM0, with tc option slots turned off).  Tested and works.
Interrupt code for other IOASIC machines should be redone so that
interrupts for devices are enabled by drivers, rather than by
cpu-specific boot code.  Functions common to all IOASIC machines
(PSWARN?) should be done by asic_init().

Checked in without the above changes so that 3MAX+, MAXINE and 3MIN
interrupt-(enable,handle) can converge.
1995-05-12 23:27:23 +00:00
mellon 214234c937 Fix MAXine interrupt mask routine 1995-05-05 06:48:14 +00:00
cgd 8703076975 define BROKEN_SWAP and/or cpu_swapout as appropriate. 1995-05-05 03:41:51 +00:00
mellon 3ff601e7a1 Don't conditionalize utility routines based on DEBUG flag 1995-05-05 02:45:31 +00:00
mellon c6a24163a3 Use Alpha cdefs.h 1995-05-03 06:04:54 +00:00
jonathan be2c7f3d13 If we panic inside trap(), Do a stack traceback before printing the trap log.
Also change the stack-traceback code to avoid having multiple returns
(and thus multiple stack pops) because with gcc -O2 that breaks the
heuristic that a "jr ra" preceding the PC precedes code to push the
current stack frame.  Which breaks stacktrace() before it even
traces past itself :-(.  Use a goto instead.
1995-05-02 19:51:52 +00:00
jonathan fb9f07db36 Update MIPS stack backtrace code to trace through locore functions,
traps, and interrupts  The earlier (4.4bsd) code didn't do the first two, and
got the last one wrong.  Also print some functions (e.g., trap handlers)
by name.  Add hook to use something other than printf() as the output
function, e.g,. for kernel debugging.
Tested with the `native' toolset, but not ELF format kernels.
(i.e., unwinding the $GP register is not tested.)

The stack backtrace code that interprets and unwinds stackframes is still
opaque and stylistically awkward.
1995-04-29 21:10:31 +00:00
jonathan b2c7420e5a Fix performance bug in pmax MachFlushDCache(). Old code disabled icache
and wasn't unrolled. This code runs cached and unrolled, giving an order
of magnitude improvement in some cases (e.g., DMA-capable network devices).
In use at Stanford DSG since late January 1995.
1995-04-28 23:17:51 +00:00
jonathan 026a077a5d Check in source code actually containing changes in previous log message--
fixes to turbochannel-based DECstation interrupt enabling.
(I hate network firewalls that break rsh and remote CVS.)
1995-04-28 22:50:29 +00:00
jonathan 523e8bccbc Fix hardware interrupt-mask setup in the 5k/240 (3max)+ interrupt handler.
(A similar fix needs to be applied to the 3min and xine handlers.
This fixes a long-standing problem when booting with a card that
wants to interrupt (e.g., a network interface) would have interrupts
enabled before a handler was set up.

Add interrupt-counting code to model-independent interrupt handler,
and 3max (5k/200) and 3max+ (5k/240) md handlers, for vmstat -i.
Similar changes for 3min and xine are obvious but not done.

Add  code for 5k/240 to read, and latch, the current value of the
IOASIC bus-cycle counter at each timer interrupt.  The latched
counter is needed to accurately interpolate the bus-cycle counter value
as a high-resolution clock.
1995-04-28 21:48:11 +00:00
jonathan ef8023a47b Check in changes suggested by Ralph Campbell: update variable names
to use turbochannel slot numbers, add a couple of extra slots, just
in case.
1995-04-28 03:10:41 +00:00
mellon 1992309f8b Fix a few compat code casualties 1995-04-25 19:16:43 +00:00
mellon 3eca8117f7 Fix up args to scdebug_{call,ret} 1995-04-25 05:30:14 +00:00
christos de42a28a1b - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
1995-04-22 20:24:40 +00:00
mellon a3c29d62df Use _KERNEL, not KERNEL 1995-04-12 01:55:35 +00:00
jtc 32a6db8a76 Mips specific portions of ieeefp.h (fp_rnd, fp_except, constants, etc.). 1995-04-11 18:20:46 +00:00
jtc 600a989fb6 Changed FLT_ROUNDS from constant to a call to __flt_rounds(), so that the
current rounding mode is accurately reported.
1995-04-11 18:18:35 +00:00
mycroft fecbe784d6 Oops; finish that last change. 1995-04-10 12:45:53 +00:00
mycroft 22cefc03bc Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
1995-04-10 12:41:29 +00:00
mycroft 127e0761c9 Add mmopen(), mmclose(), and mmmmap() where appropriate. Lock vmmap when
needed.  Make types consistent.
1995-04-10 11:54:47 +00:00
mellon 404e6bc5c9 Put endif COMPAT_09 inside function definition 1995-04-10 04:47:47 +00:00
mellon 23023327a2 Move cpu-specific exec support to cpu_exec.c; Support 4.4BSD a.out 1995-04-03 04:38:04 +00:00
jtc 8ba211cde0 Added #define _KERNEL 1995-03-28 18:37:27 +00:00
jtc 71ab4ed9dc KERNEL -> _KERNEL 1995-03-28 18:13:48 +00:00
cgd fa2133533d invoke ktrsyscall with (vp, code, argsize, args) as args. 1995-03-26 08:03:29 +00:00
jtc f86410093b Changed name of __weak_reference() to __indr_reference(). They really
are indirect references, and I want to add a real __weak_reference()
macro to <machine/cdefs.h> soon.
1995-03-23 19:58:48 +00:00
mycroft 2f805fa51b copy*str() should use size_t. 1995-03-09 12:05:21 +00:00
jtc 830a53e394 ANSI says that <stdarg.h>'s va_end macro must expand to a void expression.
For consistancy, I'm changing <varargs.h> too.
1995-01-28 01:51:46 +00:00
jtc 9540190d45 This file, which will be included by <sys/cdefs.h>, will contain macros
such as __warn_references() and __weak_reference() which are actually
machine dependant.  This will make it easier for ports that are being
bootstraped with ELF and ECOFF based toolchains.

This change also introduces a new macro, _C_LABEL(x).  _C_LABEL expands
its argument, an identifier, to a character string of the identifier
name as it is represented in an object file.

For most ports, _C_LABEL(x) will expand to "_x", for ELF based ports
_C_LABEL(x) will expand to "x".
1995-01-19 01:38:36 +00:00
mellon 8f24f1259a Write out new-style core files 1995-01-18 06:52:46 +00:00
mellon 9e9d8e5a78 Ultrix pcb_regs compatibility, reorder interrupt handlers (probably futile), use new callv naming 1995-01-18 06:51:46 +00:00
mellon 13301513c1 Add conditional gp support; add interrupt disable before setting or clearing soft ints 1995-01-18 06:45:29 +00:00
mellon 4e0b8e9b63 break mullo and mulhi out of gp regs in sigcontext 1995-01-18 06:42:01 +00:00
mellon 14f5639dca Make register definitions compatible with Ultrix 1995-01-18 06:40:12 +00:00
mellon 09f6d5d141 Make pcb_regs structure compatible with Ultrix 1995-01-18 06:39:43 +00:00
mellon faf867c2b2 Support for alternate compilers and file formats 1995-01-18 06:38:57 +00:00
mellon 2dd8487ae4 Support for loading ELF on NetBSD/pmax - to be combined with elf loader under sys/compat later 1995-01-18 06:16:33 +00:00
mellon 3a011804a6 ELF format (to be combined with elf header in sys/compat later) 1995-01-18 06:15:38 +00:00
mellon 20a4f723d7 4.4BSD binary format 1995-01-18 06:14:58 +00:00
jtc d7a8b2964f Only define sig_atomic_t when _ANSI_SOURCE is defined. 1995-01-10 19:01:00 +00:00
cgd e5049f4d59 make the definition of _JBLEN mach. dep. header-dependent. 1994-12-20 10:36:27 +00:00
mycroft a42208fd05 More underscores... 1994-12-15 17:48:39 +00:00
mycroft 487dab2ff9 Make a new macro _C_LABEL(), which prepends an underscore to the argument unless
NO_UNDERSCORES is defined.  Use it in the *LEAF() and END() macros.
1994-12-15 15:26:26 +00:00
mycroft db904fa0d4 Remove underscores from uses of *LEAF() and END(). Use _C_LABEL() in explicit
symbol references.
1994-12-15 15:18:29 +00:00
dean e5d5a6cf17 thread_wakeup wants (void *) not (int) 1994-11-23 20:46:20 +00:00
dean 342f9cd185 more underscore changes (from J. Stone) 1994-11-23 17:47:53 +00:00
dean e7558eafd1 put #ifdef KERNEL around CLK_TCK define 1994-11-15 19:00:49 +00:00
dean 705ee976cf Prepended underscores 1994-11-14 23:48:58 +00:00
dean add2031dcf Prepended underscores 1994-11-14 23:33:46 +00:00
cgd a63beafc2b new RCS ID format. 1994-10-26 21:08:38 +00:00
cgd 70d91988ab update for new syscall args description mechanism 1994-10-20 05:34:04 +00:00
cgd f501e4e128 make <stdarg.h> a symlink, and clean up ports' stdarg.h and varargs.h files. 1994-10-15 04:57:29 +00:00
jtc badcc17a6d Add constants required by XPG3 1994-10-05 17:16:29 +00:00
cgd cefdccbf31 changes for the new sys_process.c, and some cleanup 1994-08-15 16:37:04 +00:00
cgd 3fbc338a62 define __BIT_TYPES_DEFINED__ for compatibility with things like BIND and nvi 1994-07-20 05:44:19 +00:00
deraadt 50b13742e4 _MACHINE_VARGS_H_ 1994-06-29 00:45:01 +00:00
glass f6143cedc0 assembler problem 1994-06-25 07:05:12 +00:00
glass eff56c22fa much works but untested w/new fs. expect more tomorrow 1994-06-15 05:18:38 +00:00
glass 5e54277664 fix a few integration bugs, add vmfault debugging, more ultrix stuff 1994-06-02 06:14:56 +00:00
glass 8f22e98c12 VM_MIN_ADDR -> 0 1994-06-01 18:51:16 +00:00
glass af77c1caf2 more likely to work now, probably less knf...thats the next project 1994-05-28 20:21:30 +00:00
glass 6b63c739f3 bsd 4.4-lite pmax port as ported to NetBSD 1994-05-27 08:57:32 +00:00
glass 814f4529f3 upgrade to bsd 4.4-lite code base. only mod is rcsids 1994-05-27 08:40:50 +00:00
glass 377b097932 upgrade to bsd 4.4-lite code base. only mod is rcsids 1994-05-27 08:39:00 +00:00
cgd d64461d7d3 add basic integral types (a la sparc port) that new nvi wants.
mark old 'basic integral types' as XXX -- they should be squished
when whoever gets this port working.
1994-03-14 02:12:06 +00:00
deraadt b2c0b0a0c8 add a pmap_kernel() function 1994-01-16 00:58:07 +00:00
deraadt 6db422de7f cpu_exit returns void 1994-01-16 00:53:44 +00:00
deraadt 7c98e17fdb add sysarch() stub 1994-01-16 00:52:47 +00:00
deraadt 405bf3d48d use SYS_syscall instead of SYS_indir
and turn off the 64 bit syscall interface
1994-01-16 00:49:47 +00:00
deraadt 376a5f4108 pullin vm_statistics.h 1994-01-16 00:42:16 +00:00
deraadt aa7ced4bd5 intrframe -> clockframe 1994-01-15 18:46:00 +00:00
deraadt 9fd56d82c3 some pmax updating (Terry Friedrichsen is helping on this now). 1994-01-14 04:53:37 +00:00
deraadt 56cc97cb80 update from rick, tarfile of Oct 11 10:46 1993-10-15 02:56:33 +00:00
deraadt fe806afec2 pmax code from <ralphc@pyramid.com> & <rick@snowhite.cis.uoguelph.ca> 1993-10-12 03:22:19 +00:00