Commit Graph

366 Commits

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