Commit Graph

145 Commits

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