contributed by Ralph Campbell
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 8 Jan 1992 12:48:04 +0000 (04:48 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 8 Jan 1992 12:48:04 +0000 (04:48 -0800)
SCCS-vsn: sys/pmax/include/cpu.h 7.1
SCCS-vsn: sys/pmax/include/dc7085cons.h 7.1
SCCS-vsn: sys/pmax/include/machAsmDefs.h 7.1
SCCS-vsn: sys/pmax/include/machConst.h 7.1
SCCS-vsn: sys/pmax/include/param.h 7.1
SCCS-vsn: sys/pmax/include/pcb.h 7.1
SCCS-vsn: sys/pmax/include/pmap.h 7.1
SCCS-vsn: sys/pmax/include/pmioctl.h 7.1
SCCS-vsn: sys/pmax/dev/pmreg.h 7.1
SCCS-vsn: sys/pmax/include/proc.h 7.1
SCCS-vsn: sys/pmax/include/psl.h 7.1
SCCS-vsn: sys/pmax/include/reg.h 7.1
SCCS-vsn: sys/pmax/include/regdef.h 7.1
SCCS-vsn: sys/pmax/include/signal.h 7.1
SCCS-vsn: sys/pmax/include/trap.h 7.1
SCCS-vsn: sys/pmax/include/types.h 7.1
SCCS-vsn: sys/pmax/include/vmparam.h 7.1
SCCS-vsn: sys/pmax/stand/boot.c 7.1
SCCS-vsn: sys/pmax/stand/coff.c 7.1
SCCS-vsn: sys/pmax/stand/conf.c 7.1
SCCS-vsn: sys/pmax/stand/mkboot.c 7.1
SCCS-vsn: sys/pmax/stand/start.s 7.1
SCCS-vsn: sys/pmax/ultrix/ultrix_sysent.c 7.1

23 files changed:
usr/src/sys/pmax/dev/pmreg.h [new file with mode: 0644]
usr/src/sys/pmax/include/cpu.h [new file with mode: 0644]
usr/src/sys/pmax/include/dc7085cons.h [new file with mode: 0644]
usr/src/sys/pmax/include/machAsmDefs.h [new file with mode: 0644]
usr/src/sys/pmax/include/machConst.h [new file with mode: 0644]
usr/src/sys/pmax/include/param.h [new file with mode: 0644]
usr/src/sys/pmax/include/pcb.h [new file with mode: 0644]
usr/src/sys/pmax/include/pmap.h [new file with mode: 0644]
usr/src/sys/pmax/include/pmioctl.h [new file with mode: 0644]
usr/src/sys/pmax/include/proc.h [new file with mode: 0644]
usr/src/sys/pmax/include/psl.h [new file with mode: 0644]
usr/src/sys/pmax/include/reg.h [new file with mode: 0644]
usr/src/sys/pmax/include/regdef.h [new file with mode: 0644]
usr/src/sys/pmax/include/signal.h [new file with mode: 0644]
usr/src/sys/pmax/include/trap.h [new file with mode: 0644]
usr/src/sys/pmax/include/types.h [new file with mode: 0644]
usr/src/sys/pmax/include/vmparam.h [new file with mode: 0644]
usr/src/sys/pmax/stand/boot.c [new file with mode: 0644]
usr/src/sys/pmax/stand/coff.c [new file with mode: 0644]
usr/src/sys/pmax/stand/conf.c [new file with mode: 0644]
usr/src/sys/pmax/stand/mkboot.c [new file with mode: 0644]
usr/src/sys/pmax/stand/start.s [new file with mode: 0644]
usr/src/sys/pmax/ultrix/ultrix_sysent.c [new file with mode: 0644]

diff --git a/usr/src/sys/pmax/dev/pmreg.h b/usr/src/sys/pmax/dev/pmreg.h
new file mode 100644 (file)
index 0000000..cbf43b5
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)pmreg.h     7.1 (Berkeley) %G%
+ */
+
+/*
+ * Defines for the graphics hardware.
+ */
+
+/*
+ * Structure to descripte the programmable cursor chip (DC503) from DEC.
+ */
+typedef volatile struct PCCRegs {
+       u_short cmdr;   /* cursor command register */
+       short   pad1;
+       u_short xpos;   /* cursor X position */
+       short   pad2;
+       u_short ypos;   /* cursor Y position */
+       short   pad3;
+       u_short xmin1;  /* region 1 left edge */
+       short   pad4;
+       u_short xmax1;  /* region 1 right edge */
+       short   pad5;
+       u_short ymin1;  /* region 1 top edge */
+       short   pad6;
+       u_short ymax1;  /* region 1 bottom edge */
+       short   pad7[9];
+       u_short xmin2;  /* region 2 left edge */
+       short   pad8;
+       u_short xmax2;  /* region 2 right edge */
+       short   pad9;
+       u_short ymin2;  /* region 2 top edge */
+       short   pad10;
+       u_short ymax2;  /* region 2 bottom edge */
+       short   pad11;
+       u_short memory; /* cursor sprite pattern load */
+} PCCRegs;
+
+       /* define bits in pcc_cmdr */
+#define PCC_TEST       0x8000
+#define PCC_HSHI       0x4000
+#define PCC_VBHI       0x2000
+#define PCC_LODSA      0x1000
+#define PCC_FORG2      0x0800
+#define PCC_ENRG2      0x0400
+#define PCC_FORG1      0x0200
+#define PCC_ENRG1      0x0100
+#define PCC_XHWID      0x0080
+#define PCC_XHCL1      0x0040
+#define PCC_XHCLP      0x0020
+#define PCC_XHAIR      0x0010
+#define PCC_FOPB       0x0008
+#define PCC_ENPB       0x0004
+#define PCC_FOPA       0x0002
+#define PCC_ENPA       0x0001
+
+       /* offset for cursor X & Y locations */
+#define PCC_X_OFFSET   212
+#define PCC_Y_OFFSET   34
+
+typedef volatile struct VDACRegs {
+       u_char  mapWA;          /* address register (color map write) */
+       char    pad1[3];
+       u_char  map;            /* color map */
+       char    pad2[3];
+       u_char  mask;           /* pixel read mask */
+       char    pad3[3];
+       u_char  mapRA;          /* address register (color map read) */
+       char    pad4[3];
+       u_char  overWA;         /* address register (overlay map write) */
+       char    pad5[3];
+       u_char  over;           /* overlay map */
+       char    pad6[7];
+       u_char  overRA;         /* address register (overlay map read) */
+} VDACRegs;
diff --git a/usr/src/sys/pmax/include/cpu.h b/usr/src/sys/pmax/include/cpu.h
new file mode 100644 (file)
index 0000000..904c3e0
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)cpu.h       7.1 (Berkeley) %G%
+ */
+
+#ifndef _CPU_H_
+#define _CPU_H_
+
+#include "machConst.h"
+
+/*
+ * Exported definitions unique to pmax/mips cpu support.
+ */
+
+/*
+ * definitions of cpu-dependent requirements
+ * referenced in generic code
+ */
+#undef COPY_SIGCODE            /* copy sigcode above user stack in exec */
+
+/*
+ * function vs. inline configuration;
+ * these are defined to get generic functions
+ * rather than inline or machine-dependent implementations
+ */
+#define        NEED_MINMAX             /* need {,i,l,ul}{min,max} functions */
+#undef NEED_FFS                /* don't need ffs function */
+#undef NEED_BCMP               /* don't need bcmp function */
+#undef NEED_STRLEN             /* don't need strlen function */
+
+#define        cpu_exec(p)     /* nothing */
+#define        cpu_wait(p)     /* nothing */
+
+/*
+ * Arguments to hardclock, softclock and gatherstats
+ * encapsulate the previous machine state in an opaque
+ * clockframe;
+ */
+typedef struct intrframe {
+       int     pc;
+       int     ps;
+} clockframe;
+
+#define        CLKF_USERMODE(framep)   ((framep)->ps & MACH_SR_KU_PREV)
+#define        CLKF_BASEPRI(framep)    \
+       (((framep)->ps & (MACH_INT_MASK | MACH_SR_INT_ENA_PREV)) == \
+       (MACH_INT_MASK | MACH_SR_INT_ENA_PREV))
+#define        CLKF_PC(framep)         ((framep)->pc)
+
+/*
+ * Preempt the current process if in interrupt from user mode,
+ * or after the current trap/syscall if in system mode.
+ */
+#define        need_resched()  { want_resched = 1; aston(); }
+
+/*
+ * Give a profiling tick to the current process from the softclock
+ * interrupt.
+ */
+#define        profile_tick(p, framep) \
+       addupc((framep)->pc, &p->p_stats->p_prof, 1);
+
+/*
+ * Notify the current process (p) that it has a signal pending,
+ * process as soon as possible.
+ */
+#define        signotify(p)    aston()
+
+#define aston()                (astpending = 1)
+
+int    astpending;     /* need to trap before returning to user mode */
+int    want_resched;   /* resched() was called */
+
+/*
+ * CPU identification, from PRID register.
+ */
+union cpuprid {
+       int     cpuprid;
+       struct {
+#if BYTE_ORDER == BIG_ENDIAN
+               u_int   pad1:16;        /* reserved */
+               u_int   cp_imp:8;       /* implementation identifier */
+               u_int   cp_majrev:4;    /* major revision identifier */
+               u_int   cp_minrev:4;    /* minor revision identifier */
+#else
+               u_int   cp_minrev:4;    /* minor revision identifier */
+               u_int   cp_majrev:4;    /* major revision identifier */
+               u_int   cp_imp:8;       /* implementation identifier */
+               u_int   pad1:16;        /* reserved */
+#endif
+       } cpu;
+};
+
+/*
+ * MIPS CPU types (cp_imp).
+ */
+#define        MIPS_R2000      2
+
+/*
+ * MIPS FPU types
+ */
+#define        MIPS_R2010      3
+
+#ifdef KERNEL
+union  cpuprid cpu;
+union  cpuprid fpu;
+u_int  machDataCacheSize;
+u_int  machInstCacheSize;
+#endif
+
+/*
+ * Enable realtime clock (always enabled).
+ */
+#define        enablertclock()
+
+#endif /* _CPU_H_ */
diff --git a/usr/src/sys/pmax/include/dc7085cons.h b/usr/src/sys/pmax/include/dc7085cons.h
new file mode 100644 (file)
index 0000000..0d30322
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)dc7085cons.h        7.1 (Berkeley) %G%
+ *
+ * dc7085.h --
+ *
+ *             Definitions for the dc7085 chip.
+ *
+ *     Copyright (C) 1989 Digital Equipment Corporation.
+ *     Permission to use, copy, modify, and distribute this software and
+ *     its documentation for any purpose and without fee is hereby granted,
+ *     provided that the above copyright notice appears in all copies.
+ *     Digital Equipment Corporation makes no representations about the
+ *     suitability of this software for any purpose.  It is provided "as is"
+ *     without express or implied warranty.
+ *
+ * from: $Header: /sprite/src/kernel/dev/ds3100.md/RCS/dc7085.h,
+ *     v 1.4 89/08/15 19:52:46 rab Exp $ SPRITE (DECWRL)
+ */
+
+#ifndef _DC7085
+#define _DC7085
+
+typedef volatile struct dc7085regs {
+       u_short dc_csr;         /* control and status (R/W) */
+       u_short pad0[3];
+       short   dc_rbuf_lpr;    /* receiver data (R), line params (W) */
+       u_short pad1[3];
+       u_short dc_tcr;         /* transmitter control (R/W) */
+       u_short pad2[3];
+       u_short dc_msr_tdr;     /* modem status (R), transmit data (W) */
+} dcregs;
+#define dc_rbuf        dc_rbuf_lpr
+#define dc_lpr dc_rbuf_lpr
+#define dc_msr dc_msr_tdr
+#define dc_tdr dc_msr_tdr
+
+/*
+ * Control status register bits.
+ */
+#define        CSR_TRDY        0x8000
+#define CSR_TIE                0x4000
+#define        CSR_TX_LINE_NUM 0x0300
+#define        CSR_RDONE       0x0080
+#define        CSR_RIE         0x0040
+#define CSR_MSE                0x0020
+#define CSR_CLR                0x0010
+#define CSR_MAINT      0x0008
+
+/*
+ * Receiver buffer register bits.
+ */
+#define        RBUF_DVAL               0x8000
+#define RBUF_OERR              0x4000
+#define RBUF_FERR              0x2000
+#define RBUF_PERR              0x1000
+#define RBUF_LINE_NUM          0x0300
+#define RBUF_LINE_NUM_SHIFT    8
+#define RBUF_CHAR              0x00FF
+
+/*
+ * Transmit control register values.
+ */
+#define TCR_DTR2               0x400
+#define TCR_EN3                        0x008
+#define TCR_EN2                        0x004
+#define TCR_EN1                        0x002
+#define TCR_EN0                        0x001
+
+/*
+ * Line parameter register bits.
+ */
+#define        LPR_RXENAB      0x1000
+#define LPR_B50                0x0000
+#define LPR_B75                0x0100
+#define LPR_B110       0x0200
+#define LPR_B134       0x0300
+#define LPR_B150       0x0400
+#define LPR_B300       0x0500
+#define LPR_B600       0x0600
+#define LPR_B1200      0x0700
+#define LPR_B1800      0x0800
+#define LPR_B2000      0x0900
+#define LPR_B2400      0x0A00
+#define LPR_B3600      0x0B00
+#define        LPR_B4800       0x0C00
+#define LPR_B7200      0x0D00
+#define LPR_B9600      0x0E00
+#define LPR_B19800     0x0F00
+#define LPR_OPAR       0x0080
+#define LPR_PARENB     0x0040
+#define LPR_2_STOP     0x0020
+#define LPR_8_BIT_CHAR 0x0018
+#define LPR_7_BIT_CHAR 0x0010
+#define LPR_6_BIT_CHAR 0x0008
+#define LPR_5_BIT_CHAR 0x0000
+
+/*
+ * Modem status register bits.
+ */
+#define        MSR_DSR2        0x0200
+
+/*
+ * The four serial ports.
+ */
+#define        KBD_PORT        0
+#define MOUSE_PORT     1
+#define MODEM_PORT     2
+#define PRINTER_PORT   3
+
+/*
+ * Special key values.
+ */
+#define KEY_SHIFT      0xae
+#define KEY_CONTROL    0xaf
+#define KEY_UP         0xb3
+#define KEY_REPEAT     0xb4
+#define KEY_F1         0x56
+#define KEY_COMMAND    KEY_F1
+
+/*
+ * Lk201/301 keyboard
+ */
+#define LK_UPDOWN      0x86            /* bits for setting lk201 modes */
+#define LK_AUTODOWN    0x82
+#define LK_DOWN                0x80
+#define LK_DEFAULTS    0xd3            /* reset mode settings          */
+#define LK_AR_ENABLE   0xe3            /* global auto repeat enable    */
+#define LK_CL_ENABLE   0x1b            /* keyclick enable              */
+#define LK_KBD_ENABLE  0x8b            /* keyboard enable              */
+#define LK_BELL_ENABLE 0x23            /* the bell                     */
+#define LK_LED_ENABLE  0x13            /* light led                    */
+#define LK_LED_DISABLE 0x11            /* turn off led                 */
+#define LK_RING_BELL   0xa7            /* ring keyboard bell           */
+#define LED_1          0x81            /* led bits                     */
+#define LED_2          0x82
+#define LED_3          0x84
+#define LED_4          0x88
+#define LED_ALL                0x8f
+#define LK_HELP                0x7c            /* help key                     */
+#define LK_DO          0x7d            /* do key                       */
+#define LK_KDOWN_ERROR 0x3d            /* key down on powerup error    */
+#define LK_POWER_ERROR 0x3e            /* keyboard failure on pwrup tst*/
+#define LK_OUTPUT_ERROR 0xb5           /* keystrokes lost during inhbt */
+#define LK_INPUT_ERROR 0xb6            /* garbage command to keyboard  */
+#define LK_LOWEST      0x56            /* lowest significant keycode   */
+
+/* max volume is 0, lowest is 0x7 */
+#define        LK_PARAM_VOLUME(v)              (0x80|((v)&0x7))
+
+/* mode command details */
+#define        LK_CMD_MODE(m,div)              ((m)|((div)<<3))
+
+/*
+ * Command characters for the mouse.
+ */
+#define MOUSE_SELF_TEST                'T'
+#define MOUSE_INCREMENTAL      'R'
+
+/*
+ * Mouse output bits.
+ *
+ *             MOUSE_START_FRAME       Start of report frame bit.
+ *     MOUSE_X_SIGN            Sign bit for X.
+ *     MOUSE_Y_SIGN            Sign bit for Y.
+ *     MOUSE_X_OFFSET          X offset to start cursor at.
+ *     MOUSE_Y_OFFSET          Y offset to start cursor at.
+ */
+#define MOUSE_START_FRAME      0x80
+#define MOUSE_X_SIGN           0x10
+#define MOUSE_Y_SIGN           0x08
+
+/*
+ * Definitions for mouse buttons
+ */
+#define EVENT_LEFT_BUTTON      0x01
+#define EVENT_MIDDLE_BUTTON    0x02
+#define EVENT_RIGHT_BUTTON     0x03
+#define RIGHT_BUTTON           0x01
+#define MIDDLE_BUTTON          0x02
+#define LEFT_BUTTON            0x04
+
+/*
+ * Mouse report structure definition
+ */
+typedef struct {
+       char state;                     /* buttons and sign bits        */
+       short dx;                       /* delta X since last change    */
+       short dy;                       /* delta Y since last change    */
+       char byteCount;                 /* mouse report byte count      */
+} MouseReport;
+
+/* bits in dm lsr, copied from dmreg.h */
+#define        DML_DSR         0000400         /* data set ready, not a real DM bit */
+#define        DML_RNG         0000200         /* ring */
+#define        DML_CAR         0000100         /* carrier detect */
+#define        DML_CTS         0000040         /* clear to send */
+#define        DML_SR          0000020         /* secondary receive */
+#define        DML_ST          0000010         /* secondary transmit */
+#define        DML_RTS         0000004         /* request to send */
+#define        DML_DTR         0000002         /* data terminal ready */
+#define        DML_LE          0000001         /* line enable */
+
+#endif /* _DC7085 */
diff --git a/usr/src/sys/pmax/include/machAsmDefs.h b/usr/src/sys/pmax/include/machAsmDefs.h
new file mode 100644 (file)
index 0000000..642bf51
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)machAsmDefs.h       7.1 (Berkeley) %G%
+ *
+ * machAsmDefs.h --
+ *
+ *     Macros used when writing assembler programs.
+ *
+ *     Copyright (C) 1989 Digital Equipment Corporation.
+ *     Permission to use, copy, modify, and distribute this software and
+ *     its documentation for any purpose and without fee is hereby granted,
+ *     provided that the above copyright notice appears in all copies.
+ *     Digital Equipment Corporation makes no representations about the
+ *     suitability of this software for any purpose.  It is provided "as is"
+ *     without express or implied warranty.
+ *
+ * from: $Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAsmDefs.h,
+ *     v 1.2 89/08/15 18:28:24 rab Exp $ SPRITE (DECWRL)
+ */
+
+#ifndef _MACHASMDEFS
+#define _MACHASMDEFS
+
+/*
+ * LEAF(x)
+ *
+ *     Declare a leaf routine.
+ */
+#define LEAF(x) \
+       .globl x; \
+       .ent x, 0; \
+x: ; \
+       .frame sp, 0, ra
+
+/*
+ * ALEAF -- declare alternate entry to leaf routine
+ */
+#define        ALEAF(x)                                        \
+       .globl  x;                                      \
+       .aent   x,0;                                    \
+x:
+
+/*
+ * NON_LEAF(x)
+ *
+ *     Declare a non-leaf routine (a routine that makes other C calls).
+ */
+#define NON_LEAF(x, fsize, retpc) \
+       .globl x; \
+       .ent x, 0; \
+x: ; \
+       .frame sp, fsize, retpc
+
+/*
+ * END(x)
+ *
+ *     Mark end of a procedure.
+ */
+#define END(x) \
+       .end x
+
+#define STAND_FRAME_SIZE       24
+#define STAND_RA_OFFSET                20
+
+/*
+ * Macros to panic and printf from assembly language.
+ */
+#define PANIC(msg) \
+       la      a0, 9f; \
+       jal     panic; \
+       MSG(msg)
+
+#define        PRINTF(msg) \
+       la      a0,9f; \
+       jal     printf; \
+       MSG(msg)
+
+#define        MSG(msg) \
+       .rdata; \
+9:     .asciiz msg; \
+       .text
+
+#endif /* _MACHASMDEFS */
diff --git a/usr/src/sys/pmax/include/machConst.h b/usr/src/sys/pmax/include/machConst.h
new file mode 100644 (file)
index 0000000..cda1027
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)machConst.h 7.1 (Berkeley) %G%
+ *
+ * machConst.h --
+ *
+ *     Machine dependent constants.
+ *
+ *     Copyright (C) 1989 Digital Equipment Corporation.
+ *     Permission to use, copy, modify, and distribute this software and
+ *     its documentation for any purpose and without fee is hereby granted,
+ *     provided that the above copyright notice appears in all copies.
+ *     Digital Equipment Corporation makes no representations about the
+ *     suitability of this software for any purpose.  It is provided "as is"
+ *     without express or implied warranty.
+ *
+ * from: $Header: /sprite/src/kernel/mach/ds3100.md/RCS/machConst.h,
+ *     v 9.2 89/10/21 15:55:22 jhh Exp $ SPRITE (DECWRL)
+ * from: $Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAddrs.h,
+ *     v 1.2 89/08/15 18:28:21 rab Exp $ SPRITE (DECWRL)
+ * from: $Header: /sprite/src/kernel/vm/ds3100.md/RCS/vmPmaxConst.h,
+ *     v 9.1 89/09/18 17:33:00 shirriff Exp $ SPRITE (DECWRL)
+ */
+
+#ifndef _MACHCONST
+#define _MACHCONST
+
+#define MACH_KUSEG_ADDR                        0x0
+#define MACH_CACHED_MEMORY_ADDR                0x80000000
+#define MACH_CACHED_FRAME_BUFFER_ADDR  0x8fc00000
+#define MACH_UNCACHED_MEMORY_ADDR      0xa0000000
+#define MACH_UNCACHED_FRAME_BUFFER_ADDR        0xafc00000
+#define MACH_PLANE_MASK_ADDR           0xb0000000
+#define MACH_CURSOR_REG_ADDR           0xb1000000
+#define MACH_COLOR_MAP_ADDR            0xb2000000
+#define MACH_RESERVED_ADDR             0xb3000000
+#define MACH_WRITE_ERROR_ADDR          0xb7000000
+#define MACH_NETWORK_INTERFACE_ADDR    0xb8000000
+#define MACH_NETWORK_BUFFER_ADDR       0xb9000000
+#define MACH_SCSI_INTERFACE_ADDR       0xba000000
+#define MACH_SCSI_BUFFER_ADDR          0xbb000000
+#define MACH_SERIAL_INTERFACE_ADDR     0xbc000000
+#define MACH_CLOCK_ADDR                        0xbd000000
+#define MACH_SYS_CSR_ADDR              0xbe000000
+#define MACH_ROM_ADDR                  0xbf000000
+#define MACH_KSEG2_ADDR                        0xc0000000
+
+#define MACH_CODE_START                        0x80030000
+
+/*
+ * The bits in the cause register.
+ *
+ *     MACH_CR_BR_DELAY        Exception happened in branch delay slot.
+ *     MACH_CR_COP_ERR         Coprocessor error.
+ *                             Interrupt pending bits defined below.
+ *     MACH_CR_EXC_CODE        The exception type (see exception codes below).
+ */
+#define MACH_CR_BR_DELAY       0x80000000
+#define MACH_CR_COP_ERR                0x30000000
+#define MACH_CR_EXC_CODE       0x0000003C
+#define MACH_CR_EXC_CODE_SHIFT 2
+
+/*
+ * The bits in the status register.  All bits are active when set to 1.
+ *
+ *     MACH_SR_CO_USABILITY    Control the usability of the four coprocessors.
+ *     MACH_SR_BOOT_EXC_VEC    Use alternate exception vectors.
+ *     MACH_SR_TLB_SHUTDOWN    TLB disabled.
+ *     MACH_SR_PARITY_ERR      Parity error.
+ *     MACH_SR_CACHE_MISS      Most recent D-cache load resulted in a miss.
+ *     MACH_SR_PARITY_ZERO     Zero replaces outgoing parity bits.
+ *     MACH_SR_SWAP_CACHES     Swap I-cache and D-cache.
+ *     MACH_SR_ISOL_CACHES     Isolate D-cache from main memory.
+ *                             Interrupt enable bits defined below.
+ *     MACH_SR_KU_OLD          Old kernel/user mode bit. 1 => user mode.
+ *     MACH_SR_INT_ENA_OLD     Old interrupt enable bit.
+ *     MACH_SR_KU_PREV         Previous kernel/user mode bit. 1 => user mode.
+ *     MACH_SR_INT_ENA_PREV    Previous interrupt enable bit.
+ *     MACH_SR_KU_CUR          Current kernel/user mode bit. 1 => user mode.
+ *     MACH_SR_INT_ENA_CUR     Current interrupt enable bit.
+ */
+#define MACH_SR_COP_USABILITY  0xf0000000
+#define MACH_SR_COP_0_BIT      0x10000000
+#define MACH_SR_COP_1_BIT      0x20000000
+#define MACH_SR_BOOT_EXC_VEC   0x00400000
+#define MACH_SR_TLB_SHUTDOWN   0x00200000
+#define MACH_SR_PARITY_ERR     0x00100000
+#define MACH_SR_CACHE_MISS     0x00080000
+#define MACH_SR_PARITY_ZERO    0x00040000
+#define MACH_SR_SWAP_CACHES    0x00020000
+#define MACH_SR_ISOL_CACHES    0x00010000
+#define MACH_SR_KU_OLD         0x00000020
+#define MACH_SR_INT_ENA_OLD    0x00000010
+#define MACH_SR_KU_PREV                0x00000008
+#define MACH_SR_INT_ENA_PREV   0x00000004
+#define MACH_SR_KU_CUR         0x00000002
+#define MACH_SR_INT_ENA_CUR    0x00000001
+#define MACH_SR_MBZ            0x0f8000c0
+
+/*
+ * The interrupt masks.
+ * If a bit in the mask is 1 then the interrupt is enabled (or pending).
+ */
+#define MACH_INT_MASK          0xff00
+#define MACH_INT_MASK_5                0x8000
+#define MACH_INT_MASK_4                0x4000
+#define MACH_INT_MASK_3                0x2000
+#define MACH_INT_MASK_2                0x1000
+#define MACH_INT_MASK_1                0x0800
+#define MACH_INT_MASK_0                0x0400
+#define MACH_HARD_INT_MASK     0xfc00
+#define MACH_SOFT_INT_MASK_1   0x0200
+#define MACH_SOFT_INT_MASK_0   0x0100
+
+/*
+ * The system control status register.
+ */
+#define MACH_CSR_MONO          0x0800
+#define MACH_CSR_MEM_ERR       0x0400
+#define        MACH_CSR_VINT           0x0200
+#define        MACH_CSR_MBZ            0x9800
+
+/*
+ * The bits in the context register.
+ */
+#define MACH_CNTXT_PTE_BASE    0xFFE00000
+#define MACH_CNTXT_BAD_VPN     0x001FFFFC
+
+/*
+ * Location of exception vectors.
+ */
+#define MACH_RESET_EXC_VEC     0xBFC00000
+#define MACH_UTLB_MISS_EXC_VEC 0x80000000
+#define MACH_GEN_EXC_VEC       0x80000080
+
+/*
+ * Coprocessor 0 registers:
+ *
+ *     MACH_COP_0_TLB_INDEX    TLB index.
+ *     MACH_COP_0_TLB_RANDOM   TLB random.
+ *     MACH_COP_0_TLB_LOW      TLB entry low.
+ *     MACH_COP_0_TLB_CONTEXT  TLB context.
+ *     MACH_COP_0_BAD_VADDR    Bad virtual address.
+ *     MACH_COP_0_TLB_HI       TLB entry high.
+ *     MACH_COP_0_STATUS_REG   Status register.
+ *     MACH_COP_0_CAUSE_REG    Exception cause register.
+ *     MACH_COP_0_EXC_PC       Exception PC.
+ *     MACH_COP_0_PRID         Processor revision identifier.
+ */
+#define MACH_COP_0_TLB_INDEX   $0
+#define MACH_COP_0_TLB_RANDOM  $1
+#define MACH_COP_0_TLB_LOW     $2
+#define MACH_COP_0_TLB_CONTEXT $4
+#define MACH_COP_0_BAD_VADDR   $8
+#define MACH_COP_0_TLB_HI      $10
+#define MACH_COP_0_STATUS_REG  $12
+#define MACH_COP_0_CAUSE_REG   $13
+#define MACH_COP_0_EXC_PC      $14
+#define MACH_COP_0_PRID                $15
+
+/*
+ * Values for the code field in a break instruction.
+ */
+#define MACH_BREAK_CODE_FIELD  0x03ffffc0
+#define        MACH_BREAKPOINT_VAL     0
+#define MACH_SIG_RET_VAL       0x00010000
+#define MACH_SSTEP_VAL         0x00020000
+
+/*
+ * Constants to differentiate between a breakpoint trap and all others.
+ */
+#define MACH_OTHER_TRAP_TYPE   0
+#define MACH_BRKPT_TRAP                1
+
+/*
+ * Mininum and maximum cache sizes.
+ */
+#define MACH_MIN_CACHE_SIZE    (16 * 1024)
+#define MACH_MAX_CACHE_SIZE    (64 * 1024)
+
+/*
+ * The floating point version and status registers.
+ */
+#define        MACH_FPC_ID     $0
+#define        MACH_FPC_CSR    $31
+
+/*
+ * The floating point coprocessor status register bits.
+ */
+#define MACH_FPC_ROUNDING_BITS         0x00000003
+#define MACH_FPC_ROUND_RN              0x00000000
+#define MACH_FPC_ROUND_RZ              0x00000001
+#define MACH_FPC_ROUND_RP              0x00000002
+#define MACH_FPC_ROUND_RM              0x00000003
+#define MACH_FPC_STICKY_BITS           0x0000007c
+#define MACH_FPC_STICKY_INEXACT                0x00000004
+#define MACH_FPC_STICKY_UNDERFLOW      0x00000008
+#define MACH_FPC_STICKY_OVERFLOW       0x00000010
+#define MACH_FPC_STICKY_DIV0           0x00000020
+#define MACH_FPC_STICKY_INVALID                0x00000040
+#define MACH_FPC_ENABLE_BITS           0x00000f80
+#define MACH_FPC_ENABLE_INEXACT                0x00000080
+#define MACH_FPC_ENABLE_UNDERFLOW      0x00000100
+#define MACH_FPC_ENABLE_OVERFLOW       0x00000200
+#define MACH_FPC_ENABLE_DIV0           0x00000400
+#define MACH_FPC_ENABLE_INVALID                0x00000800
+#define MACH_FPC_EXCEPTION_BITS                0x0003f000
+#define MACH_FPC_EXCEPTION_INEXACT     0x00001000
+#define MACH_FPC_EXCEPTION_UNDERFLOW   0x00002000
+#define MACH_FPC_EXCEPTION_OVERFLOW    0x00004000
+#define MACH_FPC_EXCEPTION_DIV0                0x00008000
+#define MACH_FPC_EXCEPTION_INVALID     0x00010000
+#define MACH_FPC_EXCEPTION_UNIMPL      0x00020000
+#define MACH_FPC_COND_BIT              0x00800000
+#define MACH_FPC_MBZ_BITS              0xff7c0000
+
+/*
+ * Constants to determine if have a floating point instruction.
+ */
+#define MACH_OPCODE_SHIFT      26
+#define MACH_OPCODE_C1         0x11
+
+/*
+ * The low part of the TLB entry.
+ */
+#define VMMACH_TLB_PF_NUM              0xfffff000
+#define VMMACH_TLB_NON_CACHEABLE_BIT   0x00000800
+#define VMMACH_TLB_MOD_BIT             0x00000400
+#define VMMACH_TLB_VALID_BIT           0x00000200
+#define VMMACH_TLB_GLOBAL_BIT          0x00000100
+
+#define VMMACH_TLB_PHYS_PAGE_SHIFT     12
+
+/*
+ * The high part of the TLB entry.
+ */
+#define VMMACH_TLB_VIRT_PAGE_NUM       0xfffff000
+#define VMMACH_TLB_PID                 0x00000fc0
+#define VMMACH_TLB_PID_SHIFT           6
+#define VMMACH_TLB_VIRT_PAGE_SHIFT     12
+
+/*
+ * The shift to put the index in the right spot.
+ */
+#define VMMACH_TLB_INDEX_SHIFT         8
+
+/*
+ * The number of TLB entries and the first one that write random hits.
+ */
+#define VMMACH_NUM_TLB_ENTRIES         64
+#define VMMACH_FIRST_RAND_ENTRY        8
+
+/*
+ * The number of process id entries.
+ */
+#define        VMMACH_NUM_PIDS                 64
+
+/*
+ * TLB probe return codes.
+ */
+#define VMMACH_TLB_NOT_FOUND           0
+#define VMMACH_TLB_FOUND               1
+#define VMMACH_TLB_FOUND_WITH_PATCH    2
+#define VMMACH_TLB_PROBE_ERROR         3
+
+/*
+ * Kernel virtual address for user page table entries
+ * (i.e., the address for the context register).
+ */
+#define VMMACH_PTE_BASE                0xFFC00000
+
+#endif /* _MACHCONST */
diff --git a/usr/src/sys/pmax/include/param.h b/usr/src/sys/pmax/include/param.h
new file mode 100644 (file)
index 0000000..e519733
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ * from: Utah $Hdr: machparam.h 1.11 89/08/14$
+ *
+ *     @(#)param.h     7.1 (Berkeley) %G%
+ */
+
+/*
+ * Machine dependent constants for DEC Station 3100.
+ */
+#define        MACHINE "mips"
+#define COFF
+
+#define        NBPG            4096            /* bytes/page */
+#define        PGOFSET         (NBPG-1)        /* byte offset into page */
+#define        PGSHIFT         12              /* LOG2(NBPG) */
+#define        NPTEPG          (NBPG/4)
+
+#define        KERNBASE        0x80000000      /* start of kernel virtual */
+#define        BTOPKERNBASE    ((u_long)KERNBASE >> PGSHIFT)
+
+#define        DEV_BSIZE       512
+#define        DEV_BSHIFT      9               /* log2(DEV_BSIZE) */
+#define BLKDEV_IOSIZE  2048
+#define        MAXPHYS         (24 * 1024)     /* max raw I/O transfer size */
+
+#define        CLSIZE          1
+#define        CLSIZELOG2      0
+
+/* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
+#define        SSIZE           1               /* initial stack size/NBPG */
+#define        SINCR           1               /* increment of stack/NBPG */
+
+#define        UPAGES          2               /* pages of u-area */
+#define        UADDR           0xffffc000      /* address of u */
+#define        UVPN            (UADDR>>PGSHIFT)/* virtual page number of u */
+#define        KERNELSTACK     (UADDR+UPAGES*NBPG)     /* top of kernel stack */
+
+/*
+ * Constants related to network buffer management.
+ * MCLBYTES must be no larger than CLBYTES (the software page size), and,
+ * on machines that exchange pages of input or output buffers with mbuf
+ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
+ * of the hardware page size.
+ */
+#define        MSIZE           128             /* size of an mbuf */
+#define        MCLBYTES        1024
+#define        MCLSHIFT        10
+#define        MCLOFSET        (MCLBYTES - 1)
+#ifndef NMBCLUSTERS
+#ifdef GATEWAY
+#define        NMBCLUSTERS     512             /* map size, max cluster allocation */
+#else
+#define        NMBCLUSTERS     256             /* map size, max cluster allocation */
+#endif
+#endif
+
+/*
+ * Size of kernel malloc arena in CLBYTES-sized logical pages
+ */ 
+#ifndef NKMEMCLUSTERS
+#define        NKMEMCLUSTERS   (512*1024/CLBYTES)
+#endif
+
+/* pages ("clicks") (4096 bytes) to disk blocks */
+#define        ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
+#define        dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
+#define        dtob(x) ((x)<<DEV_BSHIFT)
+
+/* pages to bytes */
+#define        ctob(x) ((x)<<PGSHIFT)
+
+/* bytes to pages */
+#define        btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
+
+#define        btodb(bytes)                    /* calculates (bytes / DEV_BSIZE) */ \
+       ((unsigned)(bytes) >> DEV_BSHIFT)
+#define        dbtob(db)                       /* calculates (db * DEV_BSIZE) */ \
+       ((unsigned)(db) << DEV_BSHIFT)
+
+/*
+ * Map a ``block device block'' to a file system block.
+ * This should be device dependent, and should use the bsize
+ * field from the disk label.
+ * For now though just use DEV_BSIZE.
+ */
+#define        bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
+
+/*
+ * Mach derived conversion macros
+ */
+#define pmax_round_page(x)     ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
+#define pmax_trunc_page(x)     ((unsigned)(x) & ~(NBPG-1))
+#define pmax_btop(x)           ((unsigned)(x) >> PGSHIFT)
+#define pmax_ptob(x)           ((unsigned)(x) << PGSHIFT)
+
+#ifdef KERNEL
+#ifndef LOCORE
+extern int cpuspeed;
+#define        DELAY(n)        { register int N = cpuspeed * (n); while (--N > 0); }
+#endif
+
+#else /* !KERNEL */
+#define        DELAY(n)        { register int N = (n); while (--N > 0); }
+#endif /* !KERNEL */
diff --git a/usr/src/sys/pmax/include/pcb.h b/usr/src/sys/pmax/include/pcb.h
new file mode 100644 (file)
index 0000000..674413b
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ * from: Utah $Hdr: pcb.h 1.13 89/04/23$
+ *
+ *     @(#)pcb.h       7.1 (Berkeley) %G%
+ */
+
+/*
+ * PMAX process control block
+ */
+struct pcb
+{
+       int     pcb_regs[69];   /* saved CPU and floating point registers */
+       label_t pcb_context;    /* kernel context for resume */
+       int     pcb_onfault;    /* for copyin/copyout faults */
+};
diff --git a/usr/src/sys/pmax/include/pmap.h b/usr/src/sys/pmax/include/pmap.h
new file mode 100644 (file)
index 0000000..9d9ec33
--- /dev/null
@@ -0,0 +1,92 @@
+/* 
+ * Copyright (c) 1987 Carnegie-Mellon University
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)pmap.h      7.1 (Berkeley) %G%
+ */
+
+#ifndef        _PMAP_MACHINE_
+#define        _PMAP_MACHINE_
+
+/*
+ * TLB hash table values.
+ * SHIFT2 should shift virtual address bit 22 to the high bit of the index.
+ *                     address:        index:
+ *     USRTEXT         0x00400000      10xxxxxxx
+ *     USRDATA         0x10000000      00xxxxxxx
+ *     USRSTACK        0x7FFFFFFF      11xxxxxxx
+ * This gives 1/2 the table to data, 1/4 for text and 1/4 for stack.
+ * Note: the current process has its hash table mapped at PMAP_HASH_UADDR.
+ *     the kernel's hash table is mapped at PMAP_HASH_KADDR.
+ *     The size of the hash table is known in locore.s.
+ * The wired entries in the TLB will contain the following:
+ *     UPAGES                  (for curproc)
+ *     PMAP_HASH_UPAGES        (for curproc)
+ *     PMAP_HASH_KPAGES        (for kernel)
+ * The kernel doesn't actual use a pmap_hash_t, the pm_hash field is NULL and
+ * all the PTE entries are stored in a single array at PMAP_HASH_KADDR.
+ * If we need more KPAGES that the TLB has wired entries, then we can switch
+ * to a global pointer for the kernel TLB table.
+ * If we try to use a hash table for the kernel, wired TLB entries become a
+ * problem.
+ * Note: PMAP_HASH_UPAGES should be a multiple of MACH pages (see pmap_enter()).
+ */
+#define PMAP_HASH_UPAGES       1
+#define PMAP_HASH_KPAGES       2
+#define PMAP_HASH_UADDR                (UADDR - PMAP_HASH_UPAGES * NBPG)
+#define PMAP_HASH_KADDR                (UADDR - (PMAP_HASH_UPAGES + PMAP_HASH_KPAGES) * NBPG)
+#define PMAP_HASH_NUM_ENTRIES  512
+#define PMAP_HASH_SIZE_SHIFT   3
+#define PMAP_HASH_SHIFT1       12
+#define PMAP_HASH_SHIFT2       14
+#define PMAP_HASH_MASK1                0x07f
+#define PMAP_HASH_MASK2                0x180
+#define PMAP_HASH_SIZE         (PMAP_HASH_NUM_ENTRIES*sizeof(struct pmap_hash))
+
+/* compute pointer to pmap hash table */
+#define PMAP_HASH(va) \
+       ((((va) >> PMAP_HASH_SHIFT1) & PMAP_HASH_MASK1) | \
+        (((va) >> PMAP_HASH_SHIFT2) & PMAP_HASH_MASK2))
+
+/*
+ * A TLB hash entry.
+ */
+typedef struct pmap_hash {
+       u_int   low;            /* The TLB low register value. */
+       u_int   high;           /* The TLB high register value. */
+} *pmap_hash_t;
+
+/*
+ * Machine dependent pmap structure.
+ */
+typedef struct pmap {
+       int                     pm_count;       /* pmap reference count */
+       simple_lock_data_t      pm_lock;        /* lock on pmap */
+       struct pmap_statistics  pm_stats;       /* pmap statistics */
+       int                     pm_flags;       /* see below */
+       int                     pm_tlbpid;      /* address space tag */
+       pmap_hash_t             pm_hash;        /* TLB cache */
+       unsigned                pm_hash_ptes[PMAP_HASH_UPAGES];
+} *pmap_t;
+
+#define PM_MODIFIED    1               /* flush tlbpid before resume() */
+
+/*
+ * Defines for pmap_attributes[phys_mach_page];
+ */
+#define PMAP_ATTR_MOD  0x01    /* page has been modified */
+#define PMAP_ATTR_REF  0x02    /* page has been referenced */
+
+#ifdef KERNEL
+#define        pmap_kernel()   (kernel_pmap)
+
+extern pmap_t kernel_pmap;
+extern char *pmap_attributes;          /* reference and modify bits */
+#endif KERNEL
+#endif _PMAP_MACHINE_
diff --git a/usr/src/sys/pmax/include/pmioctl.h b/usr/src/sys/pmax/include/pmioctl.h
new file mode 100644 (file)
index 0000000..bd023b9
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)pmioctl.h   7.1 (Berkeley) %G%
+ *
+ * graphics.h --
+ *
+ *             Defines for the graphics device.
+ *
+ * Copyright (C) 1989 by Digital Equipment Corporation, Maynard MA
+ *
+ *                     All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its 
+ * documentation for any purpose and without fee is hereby granted, 
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in 
+ * supporting documentation, and that the name of Digital not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  
+ *
+ * Digitial disclaims all warranties with regard to this software, including
+ * all implied warranties of merchantability and fitness.  In no event shall
+ * Digital be liable for any special, indirect or consequential damages or
+ * any damages whatsoever resulting from loss of use, data or profits,
+ * whether in an action of contract, negligence or other tortious action,
+ * arising out of or in connection with the use or performance of this
+ * software.
+ *
+ * from: $Header: devSerialPmax.c,
+ *     v 1.4 89/05/22 13:31:07 mnelson Exp $ SPRITE (DECWRL)
+ */
+
+#include <sys/ioctl.h>
+
+/*
+ * Events.
+ */
+typedef struct {
+        short          x;              /* x position */
+        short          y;              /* y position */
+        unsigned int    time;          /* 1 millisecond units */
+        unsigned char   type;          /* button up/down/raw or motion */
+        unsigned char   key;           /* the key (button only) */
+        unsigned char   index;         /* which instance of device */
+        unsigned char   device;                /* which device */
+} pmEvent;
+
+/*
+ * type field
+ */
+#define BUTTON_UP_TYPE          0
+#define BUTTON_DOWN_TYPE        1
+#define BUTTON_RAW_TYPE         2
+#define MOTION_TYPE             3
+
+/*
+ * device field
+ */
+#define NULL_DEVICE            0       /* NULL event (for QD_GETEVENT ret) */
+#define MOUSE_DEVICE           1       /* mouse */
+#define KEYBOARD_DEVICE                2       /* main keyboard */
+#define TABLET_DEVICE          3       /* graphics tablet */
+#define AUX_DEVICE             4       /* auxiliary */
+#define CONSOLE_DEVICE         5       /* console */
+#define KNOB_DEVICE            8
+#define JOYSTICK_DEVICE                9
+
+#define PM_MAXEVQ              64      /* must be power of 2 */
+#define PM_EVROUND(x)          ((x) & (PM_MAXEVQ - 1))
+#define MOTION_BUFFER_SIZE     100
+
+typedef struct {
+       unsigned int    time;
+       short           x, y;
+} pmTimeCoord;
+
+/*
+ * The event queue. This structure is normally included in the info
+ * returned by the device driver.
+ */
+typedef struct {
+       pmEvent         *events;
+       unsigned int    eSize;
+        unsigned int    eHead;
+        unsigned int    eTail;
+       unsigned        long    timestamp_ms;
+       pmTimeCoord     *tcs;   /* history of pointer motions */
+       unsigned int    tcSize;
+       unsigned int    tcNext; /* simple ring buffer, old events are tossed */
+} pmEventQueue;
+
+/*
+ * mouse cursor position
+ */
+typedef struct {
+        short  x;
+        short  y;
+} pmCursor;
+
+/*
+ * mouse motion rectangle
+ */
+typedef struct {
+        short  bottom;
+        short  right;
+        short  left;
+        short  top;
+} pmBox;
+
+/*
+ * Structures used by ioctl's.
+ */
+typedef struct pm_kpcmd {
+       char nbytes;            /* number of bytes in parameter */
+       unsigned char cmd;      /* command to be sent, peripheral bit will */
+                               /* be forced by driver */
+       unsigned char par[2];   /* bytes of parameters to be sent */
+} pmKpCmd;
+
+typedef struct pm_info {
+       pmEventQueue qe;                /* event & motion queues        */
+       short   mswitches;              /* current value of mouse buttons */
+       pmCursor tablet;                /* current tablet position      */
+       short   tswitches;              /* current tablet buttons NI!   */
+       pmCursor cursor;                /* current cursor position      */
+       short   row;                    /* screen row                   */
+       short   col;                    /* screen col                   */
+       short   max_row;                /* max character row            */
+       short   max_col;                /* max character col            */
+       short   max_x;                  /* max x position               */
+       short   max_y;                  /* max y position               */
+       short   max_cur_x;              /* max cursor x position        */
+       short   max_cur_y;              /* max cursor y position        */
+       int     version;                /* version of driver            */
+       char    *bitmap;                /* bit map position             */
+        short   *scanmap;               /* scanline map position        */
+       short   *cursorbits;            /* cursor bit position          */
+       short   *pmaddr;                /* virtual address              */
+       char    *planemask;             /* plane mask virtual location  */
+       pmCursor mouse;                 /* atomic read/write            */
+       pmBox   mbox;                   /* atomic read/write            */
+       short   mthreshold;             /* mouse motion parameter       */
+       short   mscale;                 /* mouse scale factor (if 
+                                          negative, then do square).   */
+       short   min_cur_x;              /* min cursor x position        */
+       short   min_cur_y;              /* min cursor y position        */
+} PM_Info;
+
+typedef struct {
+       short           Map;
+       unsigned short  index;
+       struct {
+               unsigned short red;
+               unsigned short green;
+               unsigned short blue;
+       } Entry;
+} ColorMap;
+
+/*
+ * CAUTION:
+ *     The numbers of these ioctls must match
+ *     the ioctls in qvioctl.h
+ */
+#define QIOCGINFO      _IOR('q', 1, struct pm_info *)  /* get the info  */
+#define QIOCPMSTATE    _IOW('q', 2, pmCursor)          /* set mouse pos */
+#define        QIOWCURSORCOLOR _IOW('q', 3, unsigned int [6])  /* bg/fg r/g/b */
+#define QIOCINIT       _IO('q', 4)                     /* init screen   */
+#define QIOCKPCMD      _IOW('q', 5, struct pm_kpcmd)   /* keybd. per. cmd */
+#define QIOCADDR       _IOR('q', 6, struct pm_info *)  /* get address */
+#define        QIOWCURSOR      _IOW('q', 7, short [32])        /* write cursor bit map */
+#define QIOKERNLOOP    _IO('q', 8)   /* re-route kernel console output */
+#define QIOKERNUNLOOP  _IO('q', 9)   /* don't re-route kernel console output */
+#define QIOVIDEOON     _IO('q', 10)                    /* turn on the video */
+#define        QIOVIDEOOFF     _IO('q', 11)                    /* turn off the video */
+#define QIOSETCMAP      _IOW('q', 12, ColorMap)
diff --git a/usr/src/sys/pmax/include/proc.h b/usr/src/sys/pmax/include/proc.h
new file mode 100644 (file)
index 0000000..e86c1f0
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)proc.h      7.1 (Berkeley) %G%
+ */
+
+/*
+ * Machine-dependent part of the proc structure for DEC Station.
+ */
+struct mdproc {
+       int     md_flags;               /* machine-dependent flags */
+       int     md_upte[UPAGES];        /* ptes for mapping u page */
+};
+
+/* md_flags */
+#define        MDP_FPUSED      0x0001  /* floating point coprocessor used */
+#define        MDP_ULTRIX      0x0002  /* ULTRIX process (ULTRIXCOMPAT) */
diff --git a/usr/src/sys/pmax/include/psl.h b/usr/src/sys/pmax/include/psl.h
new file mode 100644 (file)
index 0000000..360e7d6
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)psl.h       7.1 (Berkeley) %G%
+ */
+
+#include "machConst.h"
+
+#define        PSL_LOWIPL      (MACH_INT_MASK | MACH_SR_INT_ENA_CUR)
+
+#define        PSL_USERSET (   \
+       MACH_SR_KU_OLD |        \
+       MACH_SR_INT_ENA_OLD |   \
+       MACH_SR_KU_PREV |       \
+       MACH_SR_INT_ENA_PREV |  \
+       MACH_INT_MASK)
+
+#define        PSL_USERCLR (   \
+       MACH_SR_COP_USABILITY | \
+       MACH_SR_BOOT_EXC_VEC |  \
+       MACH_SR_TLB_SHUTDOWN |  \
+       MACH_SR_PARITY_ERR |    \
+       MACH_SR_CACHE_MISS |    \
+       MACH_SR_PARITY_ZERO |   \
+       MACH_SR_SWAP_CACHES |   \
+       MACH_SR_ISOL_CACHES |   \
+       MACH_SR_KU_CUR |        \
+       MACH_SR_INT_ENA_CUR |   \
+       MACH_SR_MBZ)
+
+/*
+ * Macros to decode processor status word.
+ */
+#define        USERMODE(ps)    ((ps) & MACH_SR_KU_PREV)
+#define        BASEPRI(ps)     (((ps) & (MACH_INT_MASK | MACH_SR_INT_ENA_PREV)) \
+                       == (MACH_INT_MASK | MACH_SR_INT_ENA_PREV))
diff --git a/usr/src/sys/pmax/include/reg.h b/usr/src/sys/pmax/include/reg.h
new file mode 100644 (file)
index 0000000..005f166
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ * from: Utah $Hdr: reg.h 1.1 90/07/09$
+ *
+ *     @(#)reg.h       7.1 (Berkeley) %G%
+ */
+
+/*
+ * Location of the users' stored
+ * registers relative to ZERO.
+ * Usage is p->p_regs[XX].
+ */
+#define ZERO   0
+#define AST    1
+#define V0     2
+#define V1     3
+#define A0     4
+#define A1     5
+#define A2     6
+#define A3     7
+#define T0     8
+#define T1     9
+#define T2     10
+#define T3     11
+#define T4     12
+#define T5     13
+#define T6     14
+#define T7     15
+#define S0     16
+#define S1     17
+#define S2     18
+#define S3     19
+#define S4     20
+#define S5     21
+#define S6     22
+#define S7     23
+#define T8     24
+#define T9     25
+#define K0     26
+#define K1     27
+#define GP     28
+#define SP     29
+#define S8     30
+#define RA     31
+#define MULLO  32
+#define MULHI  33
+#define        PC      34
+#define        SR      35
+#define        PS      35      /* alias for SR */
+#define        F0      36
+#define        F1      37
+#define        F2      38
+#define        F3      39
+#define        F4      40
+#define        F5      41
+#define        F6      42
+#define        F7      43
+#define        F8      44
+#define        F9      45
+#define        F10     46
+#define        F11     47
+#define        F12     48
+#define        F13     49
+#define        F14     50
+#define        F15     51
+#define        F16     52
+#define        F17     53
+#define        F18     54
+#define        F19     55
+#define        F20     56
+#define        F21     57
+#define        F22     58
+#define        F23     59
+#define        F24     60
+#define        F25     61
+#define        F26     62
+#define        F27     63
+#define        F28     64
+#define        F29     65
+#define        F30     66
+#define        F31     67
+#define        FSR     68
+
+#ifdef IPCREG
+#define        NIPCREG 69
+int ipcreg[NIPCREG] = {
+       ZERO, AST, V0, V1, A0, A1, A2, A3, T0, T1, T2, T3, T4, T5, T6, T7,
+       S0, S1, S2, S3, S4, S5, S6, S7, T8, T9, K0, K1, GP, SP, S8, RA,
+       MULLO, MULHI, PC,
+       F0, F1, F2, F3, F4, F5, F6, F7,
+       F8, F9, F10, F11, F12, F13, F14, F15,
+       F16, F17, F18, F19, F20, F21, F22, F23,
+       F24, F25, F26, F27, F28, F29, F30, F31, FSR,
+};
+#endif
diff --git a/usr/src/sys/pmax/include/regdef.h b/usr/src/sys/pmax/include/regdef.h
new file mode 100644 (file)
index 0000000..71d7b6a
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell. This file is derived from the MIPS RISC
+ * Architecture book by Gerry Kane.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)regdef.h    7.1 (Berkeley) %G%
+ */
+
+#define zero   $0      /* always zero */
+#define AT     $at     /* assembler temp */
+#define v0     $2      /* return value */
+#define v1     $3
+#define a0     $4      /* argument registers */
+#define a1     $5
+#define a2     $6
+#define a3     $7
+#define t0     $8      /* temp registers (not saved across subroutine calls) */
+#define t1     $9
+#define t2     $10
+#define t3     $11
+#define t4     $12
+#define t5     $13
+#define t6     $14
+#define t7     $15
+#define s0     $16     /* saved across subroutine calls (callee saved) */
+#define s1     $17
+#define s2     $18
+#define s3     $19
+#define s4     $20
+#define s5     $21
+#define s6     $22
+#define s7     $23
+#define t8     $24     /* two more temp registers */
+#define t9     $25
+#define k0     $26     /* kernel temporary */
+#define k1     $27
+#define gp     $28     /* global pointer */
+#define sp     $29     /* stack pointer */
+#define s8     $30     /* one more callee saved */
+#define ra     $31     /* return address */
diff --git a/usr/src/sys/pmax/include/signal.h b/usr/src/sys/pmax/include/signal.h
new file mode 100644 (file)
index 0000000..a5de5ce
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)signal.h    7.1 (Berkeley) %G%
+ */
+
+/*
+ * Machine-dependent signal definitions
+ */
+
+typedef int sig_atomic_t;
+
+/*
+ * Information pushed on stack when a signal is delivered.
+ * This is used by the kernel to restore state following
+ * execution of the signal handler.  It is also made available
+ * to the handler to allow it to restore state properly if
+ * a non-standard exit is performed.
+ */
+struct sigcontext {
+       int     sc_onstack;     /* sigstack state to restore */
+       int     sc_mask;        /* signal mask to restore */
+       int     sc_pc;          /* pc at time of signal */
+       int     sc_regs[34];    /* processor regs 0 to 31, mullo, mullhi */
+       int     sc_fpused;      /* fp has been used */
+       int     sc_fpregs[33];  /* fp regs 0 to 31 and csr */
+       int     sc_fpc_eir;     /* floating point exception instruction reg */
+};
diff --git a/usr/src/sys/pmax/include/trap.h b/usr/src/sys/pmax/include/trap.h
new file mode 100644 (file)
index 0000000..2edc41a
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ * from: Utah $Hdr: trap.h 1.1 90/07/09$
+ *
+ *     @(#)trap.h      7.1 (Berkeley) %G%
+ */
+
+/*
+ * Trap codes
+ * also known in trap.c for name strings
+ */
+
+#define T_INT                  0       /* Interrupt pending */
+#define T_TLB_MOD              1       /* TLB modified fault */
+#define T_TLB_LD_MISS          2       /* TLB miss on load or ifetch */
+#define T_TLB_ST_MISS          3       /* TLB miss on a store */
+#define T_ADDR_ERR_LD          4       /* Address error on a load or ifetch */
+#define T_ADDR_ERR_ST          5       /* Address error on a store */
+#define T_BUS_ERR_IFETCH       6       /* Bus error on an ifetch */
+#define T_BUS_ERR_LD_ST                7       /* Bus error on a load or store */
+#define T_SYSCALL              8       /* System call */
+#define T_BREAK                        9       /* Breakpoint */
+#define T_RES_INST             10      /* Reserved instruction exception */
+#define T_COP_UNUSABLE         11      /* Coprocessor unusable */
+#define T_OVFLOW               12      /* Arithmetic overflow */
+
+#define        T_USER                  0x10    /* user-mode flag or'ed with type */
diff --git a/usr/src/sys/pmax/include/types.h b/usr/src/sys/pmax/include/types.h
new file mode 100644 (file)
index 0000000..1e23ddb
--- /dev/null
@@ -0,0 +1,27 @@
+/*-
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)types.h     7.1 (Berkeley) %G%
+ */
+
+#ifndef        _MACHTYPES_H_
+#define        _MACHTYPES_H_
+
+typedef struct _physadr {
+       int r[1];
+} *physadr;
+
+typedef struct label_t {
+       int val[12];
+} label_t;
+
+typedef        u_long  vm_offset_t;
+typedef        u_long  vm_size_t;
+
+#endif /* _MACHTYPES_H_ */
diff --git a/usr/src/sys/pmax/include/vmparam.h b/usr/src/sys/pmax/include/vmparam.h
new file mode 100644 (file)
index 0000000..f062572
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
+ *
+ *     @(#)vmparam.h   7.1 (Berkeley) %G%
+ */
+
+/*
+ * Machine dependent constants for DEC Station 3100.
+ */
+/*
+ * USRTEXT is the start of the user text/data space, while USRSTACK
+ * is the top (end) of the user stack.  LOWPAGES and HIGHPAGES are
+ * the number of pages from the beginning of the P0 region to the
+ * beginning of the text and from the beginning of the P1 region to the
+ * beginning of the stack respectively.
+ */
+#define        USRTEXT         0x00400000
+#define        USRDATA         0x10000000
+#define        USRSTACK        0x80000000      /* Start of user stack */
+#define        BTOPUSRSTACK    0x80000         /* btop(USRSTACK) */
+#define        LOWPAGES        0x00400
+#define        MIDPAGES        0x10000
+#define        HIGHPAGES       0
+
+/*
+ * Virtual memory related constants, all in bytes
+ */
+#ifndef MAXTSIZ
+#define        MAXTSIZ         (24*1024*1024)          /* max text size */
+#endif
+#ifndef DFLDSIZ
+#define        DFLDSIZ         (32*1024*1024)          /* initial data size limit */
+#endif
+#ifndef MAXDSIZ
+#define        MAXDSIZ         (32*1024*1024)          /* max data size */
+#endif
+#ifndef        DFLSSIZ
+#define        DFLSSIZ         (1024*1024)             /* initial stack size limit */
+#endif
+#ifndef        MAXSSIZ
+#define        MAXSSIZ         MAXDSIZ                 /* max stack size */
+#endif
+
+/*
+ * Default sizes of swap allocation chunks (see dmap.h).
+ * The actual values may be changed in vminit() based on MAXDSIZ.
+ * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
+ * DMMIN should be at least ctod(1) so that vtod() works.
+ * vminit() insures this.
+ */
+#define        DMMIN   32                      /* smallest swap allocation */
+#define        DMMAX   4096                    /* largest potential swap allocation */
+
+/*
+ * Sizes of the system and user portions of the system page table.
+ */
+/* SYSPTSIZE IS SILLY; (really number of buffers for I/O) */
+#define        SYSPTSIZE       1228
+#define        USRPTSIZE       1024
+
+/*
+ * PTEs for mapping user space into the kernel for phyio operations.
+ * 16 pte's are enough to cover 8 disks * MAXBSIZE.
+ */
+#ifndef USRIOSIZE
+#define USRIOSIZE      32
+#endif
+
+/*
+ * PTEs for system V style shared memory.
+ * This is basically slop for kmempt which we actually allocate (malloc) from.
+ */
+#ifndef SHMMAXPGS
+#define SHMMAXPGS      1024            /* 4mb */
+#endif
+
+/*
+ * Boundary at which to place first MAPMEM segment if not explicitly
+ * specified.  Should be a power of two.  This allows some slop for
+ * the data segment to grow underneath the first mapped segment.
+ */
+#define MMSEG          0x200000
+
+/*
+ * The size of the clock loop.
+ */
+#define        LOOPPAGES       (maxfree - firstfree)
+
+/*
+ * The time for a process to be blocked before being very swappable.
+ * This is a number of seconds which the system takes as being a non-trivial
+ * amount of real time.  You probably shouldn't change this;
+ * it is used in subtle ways (fractions and multiples of it are, that is, like
+ * half of a ``long time'', almost a long time, etc.)
+ * It is related to human patience and other factors which don't really
+ * change over time.
+ */
+#define        MAXSLP          20
+
+/*
+ * A swapped in process is given a small amount of core without being bothered
+ * by the page replacement algorithm.  Basically this says that if you are
+ * swapped in you deserve some resources.  We protect the last SAFERSS
+ * pages against paging and will just swap you out rather than paging you.
+ * Note that each process has at least UPAGES+CLSIZE pages which are not
+ * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
+ * number just means a swapped in process is given around 25k bytes.
+ * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
+ * so we loan each swapped in process memory worth 100$, or just admit
+ * that we don't consider it worthwhile and swap it out to disk which costs
+ * $30/mb or about $0.75.
+ */
+#define        SAFERSS         4               /* nominal ``small'' resident set size
+                                          protected against replacement */
+
+/*
+ * DISKRPM is used to estimate the number of paging i/o operations
+ * which one can expect from a single disk controller.
+ */
+#define        DISKRPM         60
+
+/*
+ * Klustering constants.  Klustering is the gathering
+ * of pages together for pagein/pageout, while clustering
+ * is the treatment of hardware page size as though it were
+ * larger than it really is.
+ *
+ * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
+ * units.  Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h.
+ * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c)
+ * unless you like "big push" panics.
+ */
+
+#ifdef notdef /* XXX */
+#define        KLMAX   (4/CLSIZE)
+#define        KLSEQL  (2/CLSIZE)              /* in klust if vadvise(VA_SEQL) */
+#define        KLIN    (4/CLSIZE)              /* default data/stack in klust */
+#define        KLTXT   (4/CLSIZE)              /* default text in klust */
+#define        KLOUT   (4/CLSIZE)
+#else
+#define        KLMAX   (1/CLSIZE)
+#define        KLSEQL  (1/CLSIZE)
+#define        KLIN    (1/CLSIZE)
+#define        KLTXT   (1/CLSIZE)
+#define        KLOUT   (1/CLSIZE)
+#endif
+
+/*
+ * KLSDIST is the advance or retard of the fifo reclaim for sequential
+ * processes data space.
+ */
+#define        KLSDIST 3               /* klusters advance/retard for seq. fifo */
+
+/*
+ * Paging thresholds (see vm_sched.c).
+ * Strategy of 1/19/85:
+ *     lotsfree is 512k bytes, but at most 1/4 of memory
+ *     desfree is 200k bytes, but at most 1/8 of memory
+ *     minfree is 64k bytes, but at most 1/2 of desfree
+ */
+#define        LOTSFREE        (512 * 1024)
+#define        LOTSFREEFRACT   4
+#define        DESFREE         (200 * 1024)
+#define        DESFREEFRACT    8
+#define        MINFREE         (64 * 1024)
+#define        MINFREEFRACT    2
+
+/*
+ * There are two clock hands, initially separated by HANDSPREAD bytes
+ * (but at most all of user memory).  The amount of time to reclaim
+ * a page once the pageout process examines it increases with this
+ * distance and decreases as the scan rate rises.
+ */
+#define        HANDSPREAD      (2 * 1024 * 1024)
+
+/*
+ * The number of times per second to recompute the desired paging rate
+ * and poke the pagedaemon.
+ */
+#define        RATETOSCHEDPAGING       4
+
+/*
+ * Believed threshold (in megabytes) for which interleaved
+ * swapping area is desirable.
+ */
+#define        LOTSOFMEM       2
+
+#define        mapin(pte, v, pfnum, prot) \
+       (*(int *)(pte) = ((pfnum) << PG_SHIFT) | (prot), MachTLBFlushAddr(v))
+
+/*
+ * Mach derived constants
+ */
+
+/* user/kernel map constants */
+#define VM_MIN_ADDRESS         ((vm_offset_t)0)
+#define VM_MAXUSER_ADDRESS     ((vm_offset_t)0x80000000)
+#define VM_MAX_ADDRESS         ((vm_offset_t)0x80000000)
+#define VM_MIN_KERNEL_ADDRESS  ((vm_offset_t)0xC0000000)
+#define VM_MAX_KERNEL_ADDRESS  ((vm_offset_t)0xFFFFC000)
+
+/* virtual sizes (bytes) for various kernel submaps */
+#define VM_MBUF_SIZE           (NMBCLUSTERS*MCLBYTES)
+#define VM_KMEM_SIZE           (NKMEMCLUSTERS*CLBYTES)
+#define VM_PHYS_SIZE           (USRIOSIZE*CLBYTES)
+
+/* pcb base */
+#define        pcbb(p)         ((u_int)(p)->p_addr)
diff --git a/usr/src/sys/pmax/stand/boot.c b/usr/src/sys/pmax/stand/boot.c
new file mode 100644 (file)
index 0000000..94a6c24
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)boot.c      7.1 (Berkeley) %G%
+ */
+
+#include "reboot.h"
+#include "exec.h"
+
+#ifndef TEST
+#define DEF_MONFUNCS
+#include "../include/machMon.h"
+#endif
+
+char   line[1024];
+
+/*
+ * This gets arguments from the PROM, calls other routines to open
+ * and load the program to boot, and then transfers execution to that
+ * new program.
+ * Argv[0] should be something like "rz(0,0,0)vmunix"
+ * The argument "-a" means we were invoked by the 'auto' command from the prom.
+ */
+void
+main(argc, argv, argenv)
+       int argc;
+       char **argv;
+       char **argenv;
+{
+       register char *cp;
+       int howto, entry;
+
+       for (entry = 0; entry < argc; entry++)
+               printf("%d: '%s'\n", entry, argv[entry]);
+#ifdef JUSTASK
+       howto = RB_ASKNAME | RB_SINGLE;
+#else
+       howto = (argc > 1 && strcmp(argv[1], "-a") == 0) ?
+               0 : RB_SINGLE;
+       for (cp = argv[0]; *cp; cp++) {
+               if (*cp == ')' && cp[1]) {
+                       cp = argv[0];
+                       goto fnd;
+               }
+       }
+       howto |= RB_ASKNAME;
+fnd:
+       ;
+#endif
+       for (;;) {
+               if (howto & RB_ASKNAME) {
+                       printf("Boot: ");
+                       gets(line);
+                       if (line[0] == '\0')
+                               continue;
+                       cp = line;
+               } else
+                       printf("Boot: %s\n", cp);
+               entry = loadfile(cp);
+               if (entry != -1)
+                       break;
+               howto = RB_ASKNAME | RB_SINGLE;
+       }
+#ifndef TEST
+       Boot_Transfer(argc, argv, argenv, entry);
+#endif
+}
+
+/*
+ * Open 'filename', read in program and return the entry point or -1 if error.
+ */
+loadfile(fname)
+       register char *fname;
+{
+       register struct devices *dp;
+       register int fd, i, n;
+       struct exec aout;
+
+       if ((fd = Open(fname, 0)) < 0)
+               goto err;
+
+       /* read the COFF header */
+       i = Read(fd, (char *)&aout, sizeof(aout));
+       if (i != sizeof(aout)) {
+               printf("No a.out header\n");
+               goto cerr;
+       } else if (aout.a_magic != OMAGIC) {
+               printf("A.out? magic 0%o size %d+%d+%d\n", aout.a_magic,
+                       aout.a_text, aout.a_data, aout.a_bss);
+               goto cerr;
+       }
+
+       /* read the code and initialized data */
+       printf("Size: %d+%d", aout.a_text, aout.a_data);
+       if (Lseek(fd, N_TXTOFF(aout), 0) < 0) {
+               printf("\nSeek error\n");
+               goto cerr;
+       }
+       i = aout.a_text + aout.a_data;
+#ifndef TEST
+       n = Read(fd, (char *)aout.ex_aout.codeStart, i);
+#else
+       n = i;
+#endif
+       (void) Close(fd);
+       if (n < 0) {
+               printf("\nRead error\n");
+               goto err;
+       } else if (n != i) {
+               printf("\nShort read (%d)\n", n);
+               goto err;
+       }
+
+       /* kernel will zero out its own bss */
+       n = aout.a_bss;
+       printf("+%d\n", n);
+
+       return ((int)aout.a_entry);
+
+cerr:
+       (void) Close(fd);
+err:
+       return (-1);
+}
diff --git a/usr/src/sys/pmax/stand/coff.c b/usr/src/sys/pmax/stand/coff.c
new file mode 100644 (file)
index 0000000..2e86cdb
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)coff.c      7.1 (Berkeley) %G%
+ */
+
+#define COFF
+#include <sys/exec.h>
+
+/*
+ * Print header info for coff files.
+ */
+void
+main(argc, argv)
+       int argc;
+       char **argv;
+{
+       register struct devices *dp;
+       register int fd, i, n;
+       char *fname;
+       struct exec aout;
+
+       if (argc < 2) {
+               printf("usage: %s <file>\n");
+               goto err;
+       }
+       if ((fd = open(fname = argv[1], 0)) < 0)
+               goto err;
+
+       /* read the COFF header */
+       i = read(fd, (char *)&aout, sizeof(aout));
+       if (i != sizeof(aout)) {
+               printf("No a.out header\n");
+               goto cerr;
+       }
+       printf("HDR: magic 0x%x(0%o) nsec %d nsym %d optheader %d textoff %x\n",
+               aout.ex_fhdr.magic,
+               aout.ex_fhdr.magic,
+               aout.ex_fhdr.numSections,
+               aout.ex_fhdr.numSyms,
+               aout.ex_fhdr.optHeader,
+               N_TXTOFF(aout));
+       printf("A.out: magic 0x%x(0%o) ver %d entry %x gprM %x gpV %x\n",
+               aout.ex_aout.magic,
+               aout.ex_aout.magic,
+               aout.ex_aout.verStamp,
+               aout.ex_aout.entry,
+               aout.ex_aout.gprMask,
+               aout.ex_aout.gpValue);
+       printf("\tstart %x,%x,%x size %d+%d+%d\n",
+               aout.ex_aout.codeStart,
+               aout.ex_aout.heapStart,
+               aout.ex_aout.bssStart,
+               aout.ex_aout.codeSize,
+               aout.ex_aout.heapSize,
+               aout.ex_aout.bssSize);
+
+cerr:
+       close(fd);
+err:
+       exit(0);
+}
diff --git a/usr/src/sys/pmax/stand/conf.c b/usr/src/sys/pmax/stand/conf.c
new file mode 100644 (file)
index 0000000..b17423f
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)conf.c      7.1 (Berkeley) %G%
+ */
+
+#include "saio.h"
+#include "../include/machMon.h"
+
+devread(io)
+       register struct iob *io;
+{
+
+       if (lseek(io->i_unit, (io->i_bn + io->i_boff) * DEV_BSIZE, 0) < 0)
+               return (-1);
+       return (read(io->i_unit, io->i_ma, io->i_cc));
+}
+
+#ifndef SMALL
+devwrite(io)
+       register struct iob *io;
+{
+
+       if (lseek(io->i_unit, (io->i_bn + io->i_boff) * DEV_BSIZE, 0) < 0)
+               return (-1);
+       return (write(io->i_unit, io->i_ma, io->i_cc));
+}
+#endif
+
+struct devsw devsw[] = {
+       "rz",
+       "tz",
+       0,
+};
diff --git a/usr/src/sys/pmax/stand/mkboot.c b/usr/src/sys/pmax/stand/mkboot.c
new file mode 100644 (file)
index 0000000..8a78a1a
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1992 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif not lint
+
+#ifndef lint
+static char sccsid[] = "@(#)mkboot.c   7.1 (Berkeley) %G%";
+#endif not lint
+
+#include <stdio.h>
+#include "types.h"
+#include "exec.h"
+#include "../include/param.h"
+#include "../dev/devDiskLabel.h"
+
+/* this is the size of the standard ULTRIX boot */
+#define MAXBOOTSIZE (15 * DEV_BSIZE)
+
+char   block[DEV_BSIZE];
+char   *dev, *bootfname;
+
+/*
+ * installboot bootprog device
+ */
+main(argc, argv)
+       int argc;
+       char *argv[];
+{
+       register int i, n;
+       int ifd, ofd;
+       Dec_DiskBoot decBootInfo;
+       int nsectors;
+       long loadAddr;
+       long execAddr;
+       long length;
+
+       if (argc != 3)
+               usage();
+       dev = argv[2];
+       i = strlen(dev);
+       bootfname = argv[1];
+       ifd = open(bootfname, 0, 0);
+       if (ifd < 0) {
+               perror(bootfname);
+               exit(1);
+       }
+       ofd = open(dev, 2, 0);
+       if (ofd < 0) {
+       deverr:
+               perror(dev);
+               exit(1);
+       }
+
+       /*
+        * Check for exec header and skip to code segment.
+        */
+       if (!DecHeader(ifd, &loadAddr, &execAddr, &length)) {
+               fprintf(stderr, "Need impure text format (OMAGIC) file\n");
+               exit(1);
+       }
+       if (length > MAXBOOTSIZE) {
+               fprintf(stderr, "boot program is too big (%d > %d)\n",
+                       length, MAXBOOTSIZE);
+               exit(1);
+       }
+
+       /*
+        * Write the boot information block.
+        */
+       decBootInfo.magic = DEC_BOOT_MAGIC;
+       decBootInfo.mode = 0;
+       decBootInfo.loadAddr = loadAddr;
+       decBootInfo.execAddr = execAddr;
+       decBootInfo.map[0].numBlocks = nsectors =
+               (length + DEV_BSIZE - 1) >> DEV_BSHIFT;
+       decBootInfo.map[0].startBlock = 1;
+       decBootInfo.map[1].numBlocks = 0;
+       if (lseek(ofd, (long)(DEC_BOOT_SECTOR * DEV_BSIZE), 0) < 0 ||
+           write(ofd, (char *)&decBootInfo, sizeof(decBootInfo)) !=
+           sizeof(decBootInfo)) {
+               perror(dev);
+               fprintf(stderr, "Sector write %d failed: ", DEC_BOOT_SECTOR);
+               exit(1);
+       }
+       if (lseek(ofd, (long)(1 * DEV_BSIZE), 0) < 0)
+               goto deverr;
+
+       /*
+        * Write the remaining code to the correct place on the disk.
+        */
+       for (i = 0; i < nsectors && length > 0; i++) {
+               bzero(block, DEV_BSIZE);
+               n = length < DEV_BSIZE ? length : DEV_BSIZE;
+               if (read(ifd, block, n) != n) {
+                       perror(bootfname);
+                       break;
+               }
+               length -= n;
+               if (write(ofd, block, DEV_BSIZE) != DEV_BSIZE) {
+                       perror(dev);
+                       break;
+               }
+       }
+       printf("Wrote %d sectors\n", i);
+       if (length > 0)
+               printf("Warning: didn't reach end of boot program!\n");
+       exit(0);
+}
+
+usage()
+{
+       printf("Usage: installboot bootprog device\n");
+       printf("where:\n");
+       printf("\t\"bootprog\" is a -N format file < %d bytes long\n",
+              MAXBOOTSIZE);
+       printf("\t\"device\" should be the 'a' partition of a bootable disk\n");
+       printf("WARNING!!  If the 'c' partition contains a file system, %s\n",
+              "DON'T RUN THIS!!");
+       exit(1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DecHeader -
+ *
+ *     Check if the header is a dec (coff) file.
+ *
+ * Results:
+ *     Return true if all went ok.
+ *
+ * Side effects:
+ *     None.
+ *
+ *----------------------------------------------------------------------
+ */
+DecHeader(bootFID, loadAddr, execAddr, length)
+       int bootFID;    /* Handle on the boot program */
+       long *loadAddr; /* Address to start loading boot program. */
+       long *execAddr; /* Address to start executing boot program. */
+       long *length;   /* Length of the boot program. */
+{
+       struct exec aout;
+       int bytesRead;
+
+       if (lseek(bootFID, 0, 0) < 0) {
+               perror(bootfname);
+               return 0;
+       }
+       bytesRead = read(bootFID, (char *)&aout, sizeof(aout));
+       if (bytesRead != sizeof(aout) || aout.ex_fhdr.magic != COFF_MAGIC ||
+           aout.a_magic != OMAGIC)
+               return 0;
+       *loadAddr = aout.ex_aout.codeStart;
+       *execAddr = aout.a_entry;
+       *length = aout.a_text + aout.a_data;
+       if (lseek(bootFID, N_TXTOFF(aout), 0) < 0) {
+               perror(bootfname);
+               return 0;
+       }
+       printf("Input file is coff format\n");
+       printf("load %x, start %x, len %d\n", *loadAddr, *execAddr, *length);
+       return 1;
+}
diff --git a/usr/src/sys/pmax/stand/start.s b/usr/src/sys/pmax/stand/start.s
new file mode 100644 (file)
index 0000000..098d53b
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 1992 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)start.s     7.1 (Berkeley) %G%
+ *
+ * start.s -
+ *
+ *     Contains code that is the first executed at boot time.
+ *
+ *     Copyright (C) 1989 Digital Equipment Corporation.
+ *     Permission to use, copy, modify, and distribute this software and
+ *     its documentation for any purpose and without fee is hereby granted,
+ *     provided that the above copyright notice appears in all copies.  
+ *     Digital Equipment Corporation makes no representations about the
+ *     suitability of this software for any purpose.  It is provided "as is"
+ *     without express or implied warranty.
+ *
+ * from: $Header: /sprite/src/boot/decprom/ds3100.md/RCS/start.s,
+ *     v 1.1 90/02/16 16:19:39 shirriff Exp $ SPRITE (DECWRL)
+ */
+
+#include <regdef.h>
+#include "../include/machConst.h"
+
+/*
+ * Amount to take off of the stack for the benefit of the debugger.
+ */
+#define START_FRAME    ((4 * 4) + 4 + 4)
+#define Init   0xbfc00018
+
+    .globl     start
+start:
+    .set noreorder
+    mtc0       zero, MACH_COP_0_STATUS_REG     # Disable interrupts
+    li         sp, MACH_CODE_START - START_FRAME
+    la         gp, _gp
+    sw         zero, START_FRAME - 4(sp)       # Zero out old ra for debugger
+    sw         zero, START_FRAME - 8(sp)       # Zero out old fp for debugger
+    jal                main                            # main(argc, argv, envp)
+    nop
+    li         a0, Init                        # done, so call prom
+    j          a0
+
+    .globl     Boot_Transfer
+Boot_Transfer:
+    mtc0       zero, MACH_COP_0_STATUS_REG     # Disable interrupts
+    li         sp, MACH_CODE_START - START_FRAME
+    la         gp, _gp
+    sw         zero, START_FRAME - 4(sp)       # Zero out old ra for debugger
+    sw         zero, START_FRAME - 8(sp)       # Zero out old fp for debugger
+    jal                a3                              # Jump to routine
+    nop
diff --git a/usr/src/sys/pmax/ultrix/ultrix_sysent.c b/usr/src/sys/pmax/ultrix/ultrix_sysent.c
new file mode 100644 (file)
index 0000000..17717ea
--- /dev/null
@@ -0,0 +1,402 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ *
+ * from: Utah $Hdr: hpux_sysent.c 1.1 90/07/09$
+ *
+ *     @(#)ultrix_sysent.c     7.1 (Berkeley) %G%
+ */
+
+/*
+ * System call switch table.
+ */
+
+#include "param.h"
+#include "systm.h"
+
+int    nosys(),notimp();
+
+int    rexit();
+int    fork();
+int    read();
+int    write();
+int    open();
+int    close();
+int    ocreat();
+int    link();
+int    unlink();
+int    ultrixexecv();
+int    chdir();
+int    mknod();
+int    chmod();
+int    chown();
+int    obreak();
+int    lseek();
+int    getpid();
+int    getuid();
+int    ptrace();
+int    saccess();
+int    sync();
+int    kill();
+int    stat();
+int    lstat();
+int    dup();
+int    pipe();
+int    profil();
+int    ultrixtobsd();
+int    getgid();
+int    ioctl();
+int    reboot();
+int    symlink();
+int    readlink();
+int    execve();
+int    umask();
+int    chroot();
+int    fstat();
+int    getpagesize();
+int    vfork();
+int    sbrk();
+int    sstk();
+int    getgroups();
+int    setgroups();
+int    ultrixgetpgrp();
+int    ultrixsetpgrp();
+int    setitimer();
+int    ultrixwait3();
+int    getitimer();
+int    gethostname();
+int    sethostname();
+int    getdtablesize();
+int    dup2();
+int    fcntl();
+int    select();
+int    fsync();
+int    setpriority();
+int    socket();
+int    connect();
+int    oaccept();
+int    getpriority();
+int    osend();
+int    orecv();
+int    ultrixsigreturn();
+int    bind();
+int    setsockopt();
+int    listen();
+int    ultrixsigvec();
+int    osigblock();
+int    osigsetmask();
+int    sigsuspend();
+int    sigstack();
+int    orecvmsg();
+int    osendmsg();
+int    gettimeofday();
+int    getrusage();
+int    getsockopt();
+int    readv();
+int    writev();
+int    settimeofday();
+int    fchown();
+int    fchmod();
+int    orecvfrom();
+int    osetreuid();
+int    osetregid();
+int    rename();
+int    truncate();
+int    ftruncate();
+int    flock();
+int    sendto();
+int    shutdown();
+int    socketpair();
+int    mkdir();
+int    rmdir();
+int    utimes();
+int    ultrixsigcleanup();
+int    adjtime();
+int    ogetpeername();
+int    gethostid();
+int    sethostid();
+int    getrlimit();
+int    setrlimit();
+int    okillpg();
+int    ogetsockname();
+int    getdirentries();
+int    ultrixgetsysinfo();
+
+/*
+ * Reserved/unimplemented system calls in the range 0-150 inclusive
+ * are reserved for use in future Berkeley releases.
+ * Additional system calls implemented in vendor and other
+ * redistributions should be placed in the reserved range at the end
+ * of the current calls.
+ */
+struct sysent ultrixsysent[] = {
+       0, nosys,                       /*   0 = out of range */
+       1, rexit,                       /*   1 = exit */
+       0, fork,                        /*   2 = fork */
+       3, read,                        /*   3 = read */
+       3, write,                       /*   4 = write */
+       3, open,                        /*   5 = open */
+       1, close,                       /*   6 = close */
+       0, nosys,                       /*   7 = old wait */
+       2, ocreat,                      /*   8 = creat */
+       2, link,                        /*   9 = link */
+       1, unlink,                      /*  10 = unlink */
+       0, nosys,                       /*  11 = old execv */
+       1, chdir,                       /*  12 = chdir */
+       0, nosys,                       /*  13 = old time */
+       3, mknod,                       /*  14 = mknod */
+       2, chmod,                       /*  15 = chmod */
+       3, chown,                       /*  16 = chown */
+       1, obreak,                      /*  17 = old break */
+       0, nosys,                       /*  18 = old stat */
+       3, lseek,                       /*  19 = lseek */
+       0, getpid,                      /*  20 = getpid */
+       3, notimp,                      /*  21 = mount */
+       1, notimp,                      /*  22 = umount */
+       0, nosys,                       /*  23 = old setuid */
+       0, getuid,                      /*  24 = getuid */
+       0, nosys,                       /*  25 = old stime */
+       4, ptrace,                      /*  26 = ptrace */
+       0, nosys,                       /*  27 = old alarm */
+       0, nosys,                       /*  28 = old fstat */
+       0, nosys,                       /*  29 = old pause */
+       0, nosys,                       /*  30 = old utime */
+       0, nosys,                       /*  31 = old stty */
+       0, nosys,                       /*  32 = old gtty */
+       2, saccess,                     /*  33 = access */
+       0, nosys,                       /*  34 = old nice */
+       0, nosys,                       /*  35 = old ftime */
+       0, sync,                        /*  36 = sync */
+       2, kill,                        /*  37 = kill */
+       2, stat,                        /*  38 = stat */
+       0, nosys,                       /*  39 = old setpgrp */
+       2, lstat,                       /*  40 = lstat */
+       1, dup,                         /*  41 = dup */
+       1, pipe,                        /*  42 = pipe */
+       0, nosys,                       /*  43 = old times */
+       4, profil,                      /*  44 = profil */
+       0, ultrixtobsd,                 /*  45 = unused */
+       0, nosys,                       /*  46 = old setgid */
+       0, getgid,                      /*  47 = getgid */
+       0, nosys,                       /*  48 = old sigsys */
+       0, nosys,                       /*  49 = reserved for USG */
+       0, nosys,                       /*  50 = reserved for USG */
+       1, notimp,                      /*  51 = acct */
+       0, nosys,                       /*  52 = old set phys addr */
+       0, nosys,                       /*  53 = old lock in core */
+       3, ioctl,                       /*  54 = ioctl */
+       1, reboot,                      /*  55 = reboot */
+       0, nosys,                       /*  56 = old mpxchan */
+       2, symlink,                     /*  57 = symlink */
+       3, readlink,                    /*  58 = readlink */
+       3, execve,                      /*  59 = execve */
+       1, umask,                       /*  60 = umask */
+       1, chroot,                      /*  61 = chroot */
+       2, fstat,                       /*  62 = fstat */
+       0, nosys,                       /*  63 = unused */
+       0, getpagesize,                 /*  64 = getpagesize */
+       0, notimp,                      /*  65 = mremap */
+       0, vfork,                       /*  66 = vfork */
+       0, nosys,                       /*  67 = old vread */
+       0, nosys,                       /*  68 = old vwrite */
+       1, sbrk,                        /*  69 = sbrk */
+       1, sstk,                        /*  70 = sstk */
+       0, nosys,                       /*  71 = mmap */
+       0, nosys,                       /*  72 = old vadvise */
+       0, notimp,                      /*  73 = munmap */
+       0, notimp,                      /*  74 = mprotect */
+       0, notimp,                      /*  75 = madvise */
+       0, notimp,                      /*  76 = vhangup */
+       0, nosys,                       /*  77 = old vlimit */
+       0, nosys,                       /*  78 = mincore */
+       2, getgroups,                   /*  79 = getgroups */
+       2, setgroups,                   /*  80 = setgroups */
+       1, ultrixgetpgrp,               /*  81 = getpgrp */
+       2, ultrixsetpgrp,               /*  82 = setpgrp */
+       3, setitimer,                   /*  83 = setitimer */
+       3, ultrixwait3,                 /*  84 = wait3 */
+       1, notimp,                      /*  85 = swapon */
+       2, getitimer,                   /*  86 = getitimer */
+       2, gethostname,                 /*  87 = gethostname */
+       2, sethostname,                 /*  88 = sethostname */
+       0, getdtablesize,               /*  89 = getdtablesize */
+       2, dup2,                        /*  90 = dup2 */
+       0, notimp,                      /*  91 = getdopt */
+       3, fcntl,                       /*  92 = fcntl */
+       5, select,                      /*  93 = select */
+       0, notimp,                      /*  94 = setdopt */
+       1, fsync,                       /*  95 = fsync */
+       3, setpriority,                 /*  96 = setpriority */
+       3, socket,                      /*  97 = socket */
+       3, connect,                     /*  98 = connect */
+       3, oaccept,                     /*  99 = accept */
+       2, getpriority,                 /* 100 = getpriority */
+       4, osend,                       /* 101 = send */
+       4, orecv,                       /* 102 = recv */
+       1, ultrixsigreturn,             /* 103 = sigreturn */
+       3, bind,                        /* 104 = bind */
+       5, setsockopt,                  /* 105 = setsockopt */
+       2, listen,                      /* 106 = listen */
+       0, nosys,                       /* 107 = old vtimes */
+       4, ultrixsigvec,                /* 108 = sigvec */
+       1, osigblock,                   /* 109 = sigblock */
+       1, osigsetmask,                 /* 110 = sigsetmask */
+       1, sigsuspend,                  /* 111 = sigpause */
+       2, sigstack,                    /* 112 = sigstack */
+       3, orecvmsg,                    /* 113 = recvmsg */
+       3, osendmsg,                    /* 114 = sendmsg */
+       0, nosys,                       /* 115 = old vtrace */
+       2, gettimeofday,                /* 116 = gettimeofday */
+       2, getrusage,                   /* 117 = getrusage */
+       5, getsockopt,                  /* 118 = getsockopt */
+       0, nosys,                       /* 119 = old resuba */
+       3, readv,                       /* 120 = readv */
+       3, writev,                      /* 121 = writev */
+       2, settimeofday,                /* 122 = settimeofday */
+       3, fchown,                      /* 123 = fchown */
+       2, fchmod,                      /* 124 = fchmod */
+       6, orecvfrom,                   /* 125 = recvfrom */
+       2, osetreuid,                   /* 126 = setreuid */
+       2, osetregid,                   /* 127 = setregid */
+       2, rename,                      /* 128 = rename */
+       2, truncate,                    /* 129 = truncate */
+       2, ftruncate,                   /* 130 = ftruncate */
+       2, flock,                       /* 131 = flock */
+       0, nosys,                       /* 132 = nosys */
+       6, sendto,                      /* 133 = sendto */
+       2, shutdown,                    /* 134 = shutdown */
+       5, socketpair,                  /* 135 = socketpair */
+       2, mkdir,                       /* 136 = mkdir */
+       1, rmdir,                       /* 137 = rmdir */
+       2, utimes,                      /* 138 = utimes */
+       1, ultrixsigcleanup,            /* 139 = internal (4.2 sigreturn) */
+       2, adjtime,                     /* 140 = adjtime */
+       3, ogetpeername,                /* 141 = getpeername */
+       2, gethostid,                   /* 142 = gethostid */
+       2, sethostid,                   /* 143 = sethostid */
+       2, getrlimit,                   /* 144 = getrlimit */
+       2, setrlimit,                   /* 145 = setrlimit */
+       2, okillpg,                     /* 146 = killpg */
+       0, nosys,                       /* 147 = nosys */
+       0, notimp,                      /* 148 = setquota */
+       0, notimp,                      /* 149 = quota */
+       3, ogetsockname,                        /* 150 = getsockname */
+       /*
+        * ULTRIX specific syscalls
+        */
+       0, notimp,                      /* 151 = sysmips */
+       0, notimp,                      /* 152 = cacheflush */
+       0, notimp,                      /* 153 = cachectl */
+       0, notimp,                      /* 154 = debug */
+       0, nosys,                       /* 155 = nosys */
+       0, nosys,                       /* 156 = nosys */
+       0, nosys,                       /* 157 = nosys */
+       0, notimp,                      /* 158 = nfs_svc */
+       4, getdirentries,               /* 159 = getdirentries */
+       0, nosys,                       /* 160 = nosys */
+       0, nosys,                       /* 161 = nosys */
+       0, nosys,                       /* 162 = nosys */
+       0, notimp,                      /* 163 = nfs_biod */
+       0, notimp,                      /* 164 = nfs_getfh */
+       0, notimp,                      /* 165 = getdomainname */
+       0, notimp,                      /* 166 = setdomainname */
+       0, nosys,                       /* 167 = nosys */
+       0, nosys,                       /* 168 = nosys */
+       0, notimp,                      /* 169 = exportfs */
+       0, nosys,                       /* 170 = nosys */
+       0, nosys,                       /* 171 = nosys */
+       0, notimp,                      /* 172 = msgctl */
+       0, notimp,                      /* 173 = msgget */
+       0, notimp,                      /* 174 = msgrcv */
+       0, notimp,                      /* 175 = msgsnd */
+       0, notimp,                      /* 176 = semctl */
+       0, notimp,                      /* 177 = semget */
+       0, notimp,                      /* 178 = semop */
+       0, notimp,                      /* 179 = uname */
+       0, notimp,                      /* 180 = shmsys */
+       0, notimp,                      /* 181 = plock */
+       0, notimp,                      /* 182 = lockf */
+       0, notimp,                      /* 183 = ustat */
+       0, notimp,                      /* 184 = getmnt */
+       0, notimp,                      /* 185 = mount */
+       0, notimp,                      /* 186 = umount */
+       0, notimp,                      /* 187 = sigpending */
+       0, nosys,                       /* 188 = nosys */
+       0, nosys,                       /* 189 = nosys */
+       0, nosys,                       /* 190 = nosys */
+       0, nosys,                       /* 191 = nosys */
+       0, nosys,                       /* 192 = nosys */
+       0, nosys,                       /* 193 = nosys */
+       0, nosys,                       /* 194 = nosys */
+       0, nosys,                       /* 195 = nosys */
+       0, nosys,                       /* 196 = nosys */
+       0, nosys,                       /* 197 = nosys */
+       0, nosys,                       /* 198 = nosys */
+       0, nosys,                       /* 199 = nosys */
+       0, nosys,                       /* 200 = nosys */
+       0, nosys,                       /* 201 = nosys */
+       0, nosys,                       /* 202 = nosys */
+       0, nosys,                       /* 203 = nosys */
+       0, nosys,                       /* 204 = nosys */
+       0, nosys,                       /* 205 = nosys */
+       0, nosys,                       /* 206 = nosys */
+       0, nosys,                       /* 207 = nosys */
+       0, nosys,                       /* 208 = nosys */
+       0, nosys,                       /* 209 = nosys */
+       0, nosys,                       /* 210 = nosys */
+       0, nosys,                       /* 211 = nosys */
+       0, nosys,                       /* 212 = nosys */
+       0, nosys,                       /* 213 = nosys */
+       0, nosys,                       /* 214 = nosys */
+       0, nosys,                       /* 215 = nosys */
+       0, nosys,                       /* 216 = nosys */
+       0, nosys,                       /* 217 = nosys */
+       0, nosys,                       /* 218 = nosys */
+       0, nosys,                       /* 219 = nosys */
+       0, nosys,                       /* 220 = nosys */
+       0, nosys,                       /* 221 = nosys */
+       0, nosys,                       /* 222 = nosys */
+       0, nosys,                       /* 223 = nosys */
+       0, nosys,                       /* 224 = nosys */
+       0, nosys,                       /* 225 = nosys */
+       0, nosys,                       /* 226 = nosys */
+       0, nosys,                       /* 227 = nosys */
+       0, nosys,                       /* 228 = nosys */
+       0, nosys,                       /* 229 = nosys */
+       0, nosys,                       /* 230 = nosys */
+       0, nosys,                       /* 231 = nosys */
+       0, nosys,                       /* 232 = nosys */
+       0, notimp,                      /* 233 = nosys */
+       0, notimp,                      /* 234 = nosys */
+       0, notimp,                      /* 235 = nosys */
+       0, nosys,                       /* 236 = nosys */
+       0, notimp,                      /* 237 = nosys */
+       0, notimp,                      /* 238 = nosys */
+       0, nosys,                       /* 239 = nosys */
+       0, nosys,                       /* 240 = nosys */
+       0, nosys,                       /* 241 = nosys */
+       0, nosys,                       /* 242 = nosys */
+       0, nosys,                       /* 243 = nosys */
+       0, nosys,                       /* 244 = nosys */
+       0, nosys,                       /* 245 = nosys */
+       0, nosys,                       /* 246 = nosys */
+       0, nosys,                       /* 247 = nosys */
+       0, nosys,                       /* 248 = nosys */
+       0, nosys,                       /* 249 = nosys */
+       0, nosys,                       /* 250 = nosys */
+       0, nosys,                       /* 251 = nosys */
+       0, nosys,                       /* 252 = nosys */
+       0, nosys,                       /* 253 = nosys */
+       0, nosys,                       /* 254 = nosys */
+       0, nosys,                       /* 255 = nosys */
+       0, ultrixgetsysinfo,            /* 256 = getsysinfo */
+       0, notimp,                      /* 257 = setsysinfo */
+};
+int    ultrixnsysent = sizeof(ultrixsysent) / sizeof (ultrixsysent[0]);