Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pmax - Have 'promcall.c' for various utilities by P...



details:   https://anonhg.NetBSD.org/src/rev/654577abffd1
branches:  trunk
changeset: 472880:654577abffd1
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Tue May 11 05:06:35 1999 +0000

description:
- Have 'promcall.c' for various utilities by PROM calls.
- Adjust files.pmax.

diffstat:

 sys/arch/pmax/conf/files.pmax |   41 ++---
 sys/arch/pmax/pmax/machdep.c  |  268 +++++++++--------------------------------
 sys/arch/pmax/pmax/promcall.c |  270 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 347 insertions(+), 232 deletions(-)

diffs (truncated from 749 to 300 lines):

diff -r fbe807256c69 -r 654577abffd1 sys/arch/pmax/conf/files.pmax
--- a/sys/arch/pmax/conf/files.pmax     Tue May 11 05:06:17 1999 +0000
+++ b/sys/arch/pmax/conf/files.pmax     Tue May 11 05:06:35 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pmax,v 1.64 1999/04/26 04:32:05 ad Exp $
+#      $NetBSD: files.pmax,v 1.65 1999/05/11 05:06:35 nisimura Exp $
 # DECstation-specific configuration info
 
 # maxpartitions must be first item in files.${ARCH}.
@@ -16,21 +16,18 @@
 attach cpu at mainbus
 file arch/pmax/pmax/cpu.c              cpu
 
-# CPU support option headers
-defopt DEC_3100        # "kn01":       3100, 2100 (kn01)
-defopt DEC_3MAX        # "kn02":       Decstation 5000/200
-defopt DEC_3MIN        # "kn02ba":     Decstation 5000/{20,25,33,50}
-defopt DEC_MAXINE      # "kn02ca":     Decstation 5000/{20,25,33,50}
-defopt DEC_3MAXPLUS    # "kn03":       Decstation 5000/240, 5000/260
+# Model support option headers
+defopt         DEC_3100        # DECstation 2100, 3100 (kn01)
+defopt         DEC_5100        # DECsystem 5100 (kn230)
+defopt         DEC_3MAX        # DECstation 5000/200 (kn02)
+defopt         DEC_3MIN        # DECstation 5000/1xx (kn02ba), 5000/150 (kn04)
+defopt         DEC_MAXINE      # Personal DECstation 5000/xx (kn02ca)
+defopt         DEC_3MAXPLUS    # DECstation 5000/240 (kn03), 5000/260 (kn05)
+defopt DEC_5800        # DECsystem 5800 isis (kn5800) XMI
+defopt DEC_5400        # DECsystem 5400 mipsfair (kn210) Qbus
+defopt DEC_5500        # DECsystem 5500 mipsfair2 (kn220) Qbus
 
-defopt DEC_5800        # "kn5800":     Decstation 5800 isis (XMI)
-defopt DEC_5400        # "kn210":      Decstation 5400 mipsfair
-defopt DEC_5500        # "kn220":      Decstation 5500 mipsfair2
-defopt DEC_5100        # "kn230":      Decstation 5100 mipsmate
-
-#
-# CPU-dependent files
-#
+# Model dependent files
 file   arch/pmax/pmax/dec_3100.c       dec_3100        # DS3100, pmax
 file   arch/pmax/pmax/dec_3max.c       dec_3max        # DS5000/200, 3max
 file   arch/pmax/pmax/dec_3maxplus.c   dec_3maxplus    # DS5000/240, 3maxplus
@@ -235,19 +232,15 @@
 file   arch/pmax/pmax/bus_dma.c
 file   arch/pmax/pmax/bus_space.c
 file   arch/pmax/pmax/conf.c
-#file  arch/pmax/pmax/kadb.c                   optional kadb
-#file  arch/pmax/pmax/machdep.c                standard config-dependent
+file   arch/pmax/pmax/disksubr.c
 file   arch/pmax/pmax/machdep.c
-file   arch/pmax/pmax/disksubr.c
-file   arch/pmax/stand/lib/callvec.c
 file   arch/pmax/pmax/mainbus.c
+file   arch/pmax/pmax/promcall.c
 file   arch/pmax/pmax/sysconf.c
-
-
-# Console code.
+file   arch/pmax/stand/lib/callvec.c
 file   dev/cons.c
-file   arch/pmax/dev/promio.c                  # default console
-file   arch/pmax/dev/findcons.c                # find and set up console.
+file   arch/pmax/dev/findcons.c        # find and set up console.
+#file  arch/pmax/pmax/kadb.c           # obsolute kadb
 
 # pmax configuration glue for rconsole. Requires fb pseudo-device.
 
diff -r fbe807256c69 -r 654577abffd1 sys/arch/pmax/pmax/machdep.c
--- a/sys/arch/pmax/pmax/machdep.c      Tue May 11 05:06:17 1999 +0000
+++ b/sys/arch/pmax/pmax/machdep.c      Tue May 11 05:06:35 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.140 1999/05/07 18:04:36 thorpej Exp $    */
+/*     $NetBSD: machdep.c,v 1.141 1999/05/11 05:06:35 nisimura Exp $   */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.140 1999/05/07 18:04:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.141 1999/05/11 05:06:35 nisimura Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -53,7 +53,6 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/signalvar.h>
 #include <sys/kernel.h>
 #include <sys/map.h>
 #include <sys/proc.h>
@@ -89,6 +88,8 @@
 #include <machine/sysconf.h>
 #include <machine/bootinfo.h>
 #include <machine/locore.h>
+#include <pmax/pmax/pmaxtype.h>
+#include <pmax/pmax/clockreg.h>
 
 #ifdef DDB
 #include <sys/exec_aout.h>             /* XXX backwards compatilbity for DDB */
@@ -98,38 +99,6 @@
 #include <ddb/db_extern.h>
 #endif
 
-#include <pmax/pmax/clockreg.h>
-#include <pmax/pmax/pmaxtype.h>
-#include <pmax/dev/promiovar.h>                /* prom console I/O vector */
-#include <pmax/pmax/machdep.h>         /* splXXX() function pointer hack */
-
-/* Motherboard or system-specific initialization vector */
-void           unimpl_os_init __P((void));
-void           unimpl_bus_reset __P((void));
-void           unimpl_enable_intr
-                  __P ((u_int slotno, int (*handler) __P((intr_arg_t sc)),
-                        intr_arg_t sc, int onoff));
-
-int            unimpl_intr __P((u_int mask, u_int pc,
-                             u_int statusReg, u_int causeReg));
-
-void           unimpl_cons_init __P((void));
-void           unimpl_device_register __P((struct device *, void *));
-const char*    unimpl_model_name __P((void));
-void           unimpl_iointr __P ((void *, u_long));
-void           unimpl_clockintr __P ((void *));
-void           unimpl_errintr __P ((void));
-
-struct platform  platform = {
-       "iobus not set",
-       unimpl_os_init,
-       unimpl_bus_reset,
-       unimpl_cons_init,
-       unimpl_device_register,
-       unimpl_iointr,
-       unimpl_clockintr
-};
-
 /* the following is used externally (sysctl_hw) */
 char   machine[] = MACHINE;            /* from <machine/param.h> */
 char   machine_arch[] = MACHINE_ARCH;  /* from <machine/param.h> */
@@ -140,11 +109,11 @@
 vm_map_t mb_map = NULL;
 vm_map_t phys_map = NULL;
 
+int    systype;                /* mother board type */
 char   *bootinfo = NULL;       /* pointer to bootinfo structure */
-int    systype;                /* Mother board type */
 int    maxmem;                 /* max memory per process */
 int    physmem;                /* max supported memory, changes to actual */
-int    physmem_boardmax;       /* {model,simm}-specific bound on physmem */
+int    physmem_boardmax;       /* {model,SIMM}-specific bound on physmem */
 int    mem_cluster_cnt;
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
 
@@ -157,20 +126,15 @@
  */
 int    safepri = MIPS3_PSL_LOWIPL;     /* XXX */
 
-unsigned (*clkread) __P((void)); /* high resolution timer if available */
+void   mach_init __P((int, char *[], int, int, u_int, char *));
 
-void   mach_init __P((int, char *[], int, int, u_int, char *));
-int    initcpu __P((void));
+unsigned (*clkread) __P((void)); /* high resolution timer if available */
 unsigned nullclkread __P((void));
-int    atoi __P((const char *cp));
+
 void   prom_haltbutton __P((void));
 void   prom_halt __P((int, char *)) __attribute__((__noreturn__));
 int    prom_systype __P((void));
-
-extern caddr_t esym;
-
-/* locore callback-vector setup */
-extern void mips_vector_init  __P((void));
+int    initcpu __P((void));
 
 /* XXX XXX XXX */
 u_long le_iomem;               /* 128K for lance chip via. ASIC */
@@ -181,6 +145,7 @@
      __P ((u_int slotno, int (*handler) __P((void *sc)),
           void *sc, int onoff));
 
+#include <pmax/pmax/machdep.h>         /* splXXX() function pointer hack */
 /*
  * pmax still doesnt have code to build spl masks for both CPU hard-interrupt
  * register and baseboard interrupt-control registers at runtime.
@@ -204,6 +169,28 @@
 extern void stacktrace __P((void)); /*XXX*/
 #endif
 
+/* Motherboard or system-specific initialization vector */
+void   unimpl_os_init __P((void));
+void   unimpl_bus_reset __P((void));
+int    unimpl_intr __P((unsigned, unsigned, unsigned, unsigned));
+void   unimpl_cons_init __P((void));
+void   unimpl_device_register __P((struct device *, void *));
+void   unimpl_iointr __P ((void *, u_long));
+void   unimpl_clockintr __P ((void *));
+
+struct platform platform = {
+       "iobus not set",
+       unimpl_os_init,
+       unimpl_bus_reset,
+       unimpl_cons_init,
+       unimpl_device_register,
+       unimpl_iointr,
+       unimpl_clockintr
+};
+
+extern caddr_t esym;
+extern struct consdev promcd;
+
 /*
  * Do all the stuff that locore normally does before calling main().
  * Process arguments passed to us by the prom monitor.
@@ -359,8 +346,8 @@
         */
        db_machine_init();
        /* init symbols if present */
-       if (nsym && ssym && esym)
-               ddb_init(nsym, (int *)ssym, (int *)esym);
+       if (esym)
+               ddb_init(*(int *)&end, ((int *)&end) + 1, (int*)esym);
        if (boothowto & RB_KDB)
                Debugger();
 #endif
@@ -404,7 +391,7 @@
         * Find out how much memory is available.
         * Be careful to save and restore the original contents for msgbuf.
         */
-       physmem = btoc((vaddr_t)kernend - MIPS_KSEG0_START);
+       physmem = btoc((paddr_t)kernend - MIPS_KSEG0_START);
        cp = (char *)MIPS_PHYS_TO_KSEG1(physmem << PGSHIFT);
        while (cp < (char *)physmem_boardmax) {
                int j;
@@ -685,56 +672,6 @@
        return (NULL);
 }
 
-/*
- * PROM reset callback for reset switch.
- * XXX enter ddb instead?
- */
-void
-prom_haltbutton()
-{
-       (*callv->_halt)((int *)0, 0);
-}
-
-/*
- * Call PROM to halt or reboot.
- */
-volatile void
-prom_halt(howto, bootstr)
-       int howto;
-       char *bootstr;
-
-{
-       if (callv != &callvec)
-               (*callv->_rex)((howto & RB_HALT) ? 'h' : 'b');
-       else {
-               volatile void (*f) __P((void));
-
-               f = (howto & RB_HALT)
-                       ? (void *)DEC_PROM_REINIT
-                       : (void *)DEC_PROM_AUTOBOOT;
-               (*f)();
-       }
-
-       while(1) ;      /* fool gcc */
-       /*NOTREACHED*/
-}
-
-/*
- * Get 32bit system type of Digital hardware.
- *     From highest order byte to lowest;
- *     'cputype,' 'systype,' 'firmware revision' and 'hardware revision.'
- */
-int
-prom_systype()
-{
-       char *cp;
-
-       if (callv != &callvec)
-               return (*callv->_getsysid)();
-       cp = (*callv->_getenv)("systype");
-       return (cp != NULL) ? atoi(cp) : 0;
-}
-
 void
 cpu_reboot(howto, bootstr)
        volatile int howto;     /* XXX volatile to keep gcc happy */
@@ -815,7 +752,7 @@
        static struct timeval lasttime;
 
        *tvp = time;
-#if (DEC_3MIN + DEC_3MAXPLUS + DEC_MAXINE) > 1
+#if (DEC_3MIN + DEC_MAXINE + DEC_3MAXPLUS) > 0



Home | Main Index | Thread Index | Old Index