Commit Graph

326 Commits

Author SHA1 Message Date
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