diff options
author | Thomas Graichen <graichen@cvs.openbsd.org> | 1997-07-07 08:28:32 +0000 |
---|---|---|
committer | Thomas Graichen <graichen@cvs.openbsd.org> | 1997-07-07 08:28:32 +0000 |
commit | 854362522c28951105dc5588a6e88de30a7ae7b9 (patch) | |
tree | 7781c30629a4f28bee09c5eb0ad8f787dbc286cc | |
parent | aedfad4a095252e84c92176ce2b4e8049511e913 (diff) |
go back to versions before the last NetBSD merge - it has broken
current kernels somehow - per or me has to look deeper at the diffs
-rw-r--r-- | sys/arch/pmax/pmax/autoconf.c | 7 | ||||
-rw-r--r-- | sys/arch/pmax/pmax/machdep.c | 190 | ||||
-rw-r--r-- | sys/arch/pmax/pmax/trap.c | 8 |
3 files changed, 73 insertions, 132 deletions
diff --git a/sys/arch/pmax/pmax/autoconf.c b/sys/arch/pmax/pmax/autoconf.c index 6a108f39695..d0e7c884dc9 100644 --- a/sys/arch/pmax/pmax/autoconf.c +++ b/sys/arch/pmax/pmax/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.24 1997/05/25 08:17:00 jonathan Exp $ */ +/* $NetBSD: autoconf.c,v 1.18 1996/10/13 03:39:44 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -61,7 +61,6 @@ #include <sys/device.h> #include <machine/cpu.h> -#include <machine/autoconf.h> #include <pmax/dev/device.h> #include <pmax/pmax/pmaxtype.h> #include <pmax/pmax/turbochannel.h> @@ -81,6 +80,10 @@ void xconsinit __P((void)); /* XXX console-init continuation */ int spl0 __P((void)); #endif +void configure __P((void)); +void makebootdev __P((char *cp)); + + /* * The following several variables are related to diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c index 94ba8f7dcba..d32568af5cc 100644 --- a/sys/arch/pmax/pmax/machdep.c +++ b/sys/arch/pmax/pmax/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.76 1997/05/31 20:33:30 mhitch Exp $ */ +/* $NetBSD: machdep.c,v 1.67 1996/10/23 20:04:40 mhitch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -77,12 +77,12 @@ #endif #include <vm/vm_kern.h> -#include <ufs/mfs/mfs_extern.h> /* mfs_initminiroot() */ #include <machine/cpu.h> #include <machine/reg.h> #include <machine/psl.h> #include <machine/pte.h> +#include <machine/dc7085cons.h> #include <pmax/stand/dec_prom.h> @@ -100,9 +100,9 @@ #include <pmax/pmax/asic.h> #include <pmax/pmax/turbochannel.h> #include <pmax/pmax/pmaxtype.h> -#include <pmax/pmax/trap.h> /* mboard-specific interrupt fns */ #include <pmax/pmax/cons.h> + #include "pm.h" #include "cfb.h" #include "mfb.h" @@ -115,7 +115,6 @@ extern void fbPutc(); -#if defined(DS5000_25) || defined(DS5000_100) || defined(DS5000_240) /* Will scan from max to min, inclusive */ static int tc_max_slot = KN02_TC_MAX; static int tc_min_slot = KN02_TC_MIN; @@ -126,7 +125,6 @@ static u_int tc_slot_phys_base [TC_MAX_SLOTS] = { KN02_PHYS_TC_4_START, KN02_PHYS_TC_5_START, KN02_PHYS_TC_6_START, KN02_PHYS_TC_7_START }; -#endif /* the following is used externally (sysctl_hw) */ char machine[] = "pmax"; /* cpu "architecture" */ @@ -164,7 +162,12 @@ extern void (*tc_enable_interrupt) __P ((u_int slotno, void (*tc_enable_interrupt) __P ((u_int slotno, int (*handler) __P ((void *sc)), void *sc, int onoff)); +extern int (*mips_hardware_intr)(); + +int kn02_intr(), kmin_intr(), xine_intr(); + #ifdef DS3100 +extern int kn01_intr(); void kn01_enable_intr __P ((u_int slotno, int (*handler) __P ((intr_arg_t sc)), intr_arg_t sc, int onoff)); @@ -174,59 +177,28 @@ void kn01_enable_intr __P ((u_int slotno, # include <pmax/pmax/kn230var.h> /* kn230_establish_intr(), kn230_intr() */ #endif -/* - * Interrupt-blocking functions defined in locore. These names aren't used - * directly except here and in interrupt handlers. - */ - -/* Block out one hardware interrupt-enable bit. */ -extern int Mach_spl0 __P((void)), Mach_spl1 __P((void)); -extern int Mach_spl2 __P((void)), Mach_spl3 __P((void)); - -/* Block out nested interrupt-enable bits. */ -extern int cpu_spl0 __P((void)), cpu_spl1 __P((void)); -extern int cpu_spl2 __P((void)), cpu_spl3 __P((void)); -extern int splhigh __P((void)); - -/* - * Instead, we declare the standard splXXX names as function pointers, - * and initialie them to point to the above functions to match - * the way a specific motherboard is wired up. - */ -int (*Mach_splbio) __P((void)) = splhigh; -int (*Mach_splnet)__P((void)) = splhigh; -int (*Mach_spltty)__P((void)) = splhigh; -int (*Mach_splimp)__P((void)) = splhigh; -int (*Mach_splclock)__P((void)) = splhigh; -int (*Mach_splstatclock)__P((void)) = splhigh; +#ifdef DS5000_240 +int kn03_intr(); +#endif +extern int Mach_spl0(), Mach_spl1(), Mach_spl2(), Mach_spl3(), splhigh(); +int (*Mach_splbio)() = splhigh; +int (*Mach_splnet)() = splhigh; +int (*Mach_spltty)() = splhigh; +int (*Mach_splimp)() = splhigh; +int (*Mach_splclock)() = splhigh; +int (*Mach_splstatclock)() = splhigh; extern volatile struct chiptime *Mach_clock_addr; u_long kmin_tc3_imask, xine_tc3_imask; -int savectx __P((struct user *up)); /* XXX save state b4 crash*/ - - -tc_option_t tc_slot_info[TC_MAX_LOGICAL_SLOTS]; - - -/* - * Local functions. - */ -#ifdef DS5000_240 /* XXX */ -static void asic_init __P((int isa_maxine)); -#endif -extern int atoi __P((const char *cp)); -int initcpu __P((void)); #ifdef DS5000_240 -static u_long clkread __P((void)); /* get usec-resolution clock */ +u_long kn03_tc3_imask; +extern u_long latched_cycle_cnt; #endif -void dumpsys __P((void)); /* do a dump */ - -/* initialize bss, etc. from kernel start, before main() is called. */ -extern void -mach_init __P((int argc, char *argv[], u_int code, - const struct callback *cv)); +tc_option_t tc_slot_info[TC_MAX_LOGICAL_SLOTS]; +static void asic_init(); +extern void RemconsInit(); #ifdef DS5000_200 void kn02_enable_intr __P ((u_int slotno, @@ -245,9 +217,6 @@ void xine_enable_intr __P ((u_int slotno, int (*handler) (intr_arg_t sc), #endif /*DS5000_25*/ #ifdef DS5000_240 -u_long kn03_tc3_imask; -extern u_long latched_cycle_cnt; -void kn03_tc_reset __P((void)); /* XXX unused? */ void kn03_enable_intr __P ((u_int slotno, int (*handler) (intr_arg_t sc), intr_arg_t sc, int onoff)); #endif /*DS5000_240*/ @@ -260,11 +229,6 @@ volatile u_int *Mach_reset_addr; void prom_halt __P((int, char *)) __attribute__((__noreturn__)); -#ifdef DEBUG -/* stacktrace code violates prototypes to get callee's registers */ -extern void stacktrace __P((void)); /*XXX*/ -#endif - /* * safepri is a safe priority for sleep to set for a spin-wait @@ -275,15 +239,6 @@ int safepri = PSL_LOWIPL; struct user *proc0paddr; struct proc nullproc; /* for use by swtch_exit() */ - -/* - * XXX locore callback-vector setup should be done via mips_vector_init() - * using CPU-family information, but that doesn't work yet, so for now we - * explicitly call the mips1 setup function. - */ -extern void mips1_vector_init __P((void)); - - /* * Do all the stuff that locore normally does before calling main(). * Process arguments passed to us by the prom monitor. @@ -302,6 +257,8 @@ mach_init(argc, argv, code, cv) register caddr_t v; caddr_t start; extern char edata[], end[]; + extern char MachUTLBMiss[], MachUTLBMissEnd[]; + extern char mips_R2000_exception[], mips_R2000_exceptionEnd[]; /* clear the BSS segment */ v = (caddr_t)mips_round_page(end); @@ -424,8 +381,7 @@ mach_init(argc, argv, code, cv) i = (*cv->_getsysid)(); cp = ""; } else { - cp = (*callv->_getenv)("systype"); - if (cp) + if (cp = (*callv->_getenv)("systype")) i = atoi(cp); else { cp = ""; @@ -456,13 +412,12 @@ mach_init(argc, argv, code, cv) */ mips_hardware_intr = kn01_intr; tc_enable_interrupt = kn01_enable_intr; /*XXX*/ - Mach_splbio = cpu_spl0; - Mach_splnet = cpu_spl1; - Mach_spltty = cpu_spl2; + Mach_splbio = Mach_spl0; + Mach_splnet = Mach_spl1; + Mach_spltty = Mach_spl2; Mach_splimp = splhigh; /*XXX Mach_spl1(), if not for malloc()*/ - Mach_splclock = cpu_spl3; - Mach_splstatclock = cpu_spl3; - + Mach_splclock = Mach_spl3; + Mach_splstatclock = Mach_spl3; Mach_clock_addr = (volatile struct chiptime *) MACH_PHYS_TO_UNCACHED(KN01_SYS_CLOCK); strcpy(cpu_model, "3100"); @@ -514,8 +469,8 @@ mach_init(argc, argv, code, cv) Mach_splnet = Mach_spl0; Mach_spltty = Mach_spl0; Mach_splimp = Mach_spl0; - Mach_splclock = cpu_spl1; - Mach_splstatclock = cpu_spl1; + Mach_splclock = Mach_spl1; + Mach_splstatclock = Mach_spl1; Mach_clock_addr = (volatile struct chiptime *) MACH_PHYS_TO_UNCACHED(KN02_SYS_CLOCK); @@ -591,24 +546,12 @@ mach_init(argc, argv, code, cv) ioasic_base = MACH_PHYS_TO_UNCACHED(XINE_SYS_ASIC); mips_hardware_intr = xine_intr; tc_enable_interrupt = xine_enable_intr; - - /* On the MAXINE ioasic interrupts at level 3. */ Mach_splbio = Mach_spl3; Mach_splnet = Mach_spl3; Mach_spltty = Mach_spl3; Mach_splimp = Mach_spl3; - - /* - * Note priority inversion of ioasic and clock: - * clock interrupts are at hw priority 1, and when blocking - * clock interrups we we must block hw priority 3 - * (bio,net,tty) also. - * - * XXX hw priority 2 is used for memory errors, we - * should not disable memory errors during clock interrupts! - */ - Mach_splclock = cpu_spl3; - Mach_splstatclock = cpu_spl3; + Mach_splclock = Mach_spl1; + Mach_splstatclock = Mach_spl1; Mach_clock_addr = (volatile struct chiptime *) MACH_PHYS_TO_UNCACHED(XINE_SYS_CLOCK); @@ -642,16 +585,13 @@ mach_init(argc, argv, code, cv) /* * Reset interrupts, clear any errors from newconf probes */ + Mach_splbio = Mach_spl0; Mach_splnet = Mach_spl0; Mach_spltty = Mach_spl0; - Mach_splimp = Mach_spl0; /* XXX */ - /* - * Clock interrupts at hw priority 1 must block bio,net,tty - * at hw priority 0. - */ - Mach_splclock = cpu_spl1; - Mach_splstatclock = cpu_spl1; + Mach_splimp = Mach_spl0; + Mach_splclock = Mach_spl1; + Mach_splstatclock = Mach_spl1; Mach_clock_addr = (volatile struct chiptime *) MACH_PHYS_TO_UNCACHED(KN03_SYS_CLOCK); @@ -828,6 +768,7 @@ mach_init(argc, argv, code, cv) * Initialize the virtual memory system. */ pmap_bootstrap((vm_offset_t)v); + } @@ -840,6 +781,7 @@ void cpu_startup() { register unsigned i; + register caddr_t v; int base, residual; vm_offset_t minaddr, maxaddr; vm_size_t size; @@ -905,8 +847,12 @@ cpu_startup() VM_PHYS_SIZE, TRUE); /* - * Finally, allocate mbuf cluster submap. + * Finally, allocate mbuf pool. Since mclrefcnt is an off-size + * we use the more space efficient malloc in place of kmem_alloc. */ + mclrefcnt = (char *)malloc(NMBCLUSTERS+CLBYTES/MCLBYTES, + M_MBUF, M_NOWAIT); + bzero(mclrefcnt, NMBCLUSTERS+CLBYTES/MCLBYTES); mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr, VM_MBUF_SIZE, FALSE); /* @@ -920,7 +866,7 @@ cpu_startup() #ifdef DEBUG pmapdebug = opmapdebug; #endif - printf("avail mem = %ld\n", ptoa(cnt.v_free_count)); + printf("avail mem = %d\n", ptoa(cnt.v_free_count)); printf("using %d buffers containing %d bytes of memory\n", nbuf, bufpages * CLBYTES); @@ -940,11 +886,9 @@ cpu_startup() configure(); } - /* * machine dependent system variables. */ -int cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) int *name; u_int namelen; @@ -969,7 +913,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) /* NOTREACHED */ } - /* * Set registers on exec. * Clear all registers except sp, pc, and t9. @@ -991,7 +934,7 @@ setregs(p, pack, stack, retval) p->p_md.md_regs[PC] = pack->ep_entry & ~3; p->p_md.md_regs[T9] = pack->ep_entry & ~3; /* abicall requirement */ p->p_md.md_regs[PS] = PSL_USERSET; - p->p_md.md_flags &= ~MDP_FPUSED; + p->p_md.md_flags & ~MDP_FPUSED; if (machFPCurProcPtr == p) machFPCurProcPtr = (struct proc *)0; } @@ -1060,8 +1003,8 @@ sendsig(catcher, sig, mask, code, type, val) (void)grow(p, (unsigned)fp); #ifdef DEBUG if ((sigdebug & SDB_FOLLOW) || - ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)) - printf("sendsig(%d): sig %d ssp %p usp %p scp %p\n", + (sigdebug & SDB_KSTACK) && p->p_pid == sigpid) + printf("sendsig(%d): sig %d ssp %x usp %x scp %x\n", p->p_pid, sig, &oonstack, fp, &fp->sf_sc); #endif /* @@ -1125,7 +1068,7 @@ bail: regs[RA] = (int)PS_STRINGS - (esigcode - sigcode); #ifdef DEBUG if ((sigdebug & SDB_FOLLOW) || - ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)) + (sigdebug & SDB_KSTACK) && p->p_pid == sigpid) printf("sendsig(%d): sig %d returns\n", p->p_pid, sig); #endif @@ -1159,7 +1102,7 @@ sys_sigreturn(p, v, retval) scp = SCARG(uap, sigcntxp); #ifdef DEBUG if (sigdebug & SDB_FOLLOW) - printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp); + printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp); #endif regs = p->p_md.md_regs; /* @@ -1170,7 +1113,7 @@ sys_sigreturn(p, v, retval) if (error || ksc.sc_regs[ZERO] != 0xACEDBADE) { #ifdef DEBUG if (!(sigdebug & SDB_FOLLOW)) - printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp); + printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp); printf(" old sp %x ra %x pc %x\n", regs[SP], regs[RA], regs[PC]); printf(" new sp %x ra %x pc %x err %d z %x\n", @@ -1200,7 +1143,7 @@ sys_sigreturn(p, v, retval) } int waittime = -1; -struct user dumppcb; /* Actually, struct pcb would do. */ +struct pcb dumppcb; /* @@ -1242,7 +1185,7 @@ dumpsys() int error; /* Save registers. */ - savectx(&dumppcb); + savectx(&dumppcb, 0); msgbufmapped = 0; if (dumpdev == NODEV) @@ -1255,7 +1198,7 @@ dumpsys() dumpconf(); if (dumplo < 0) return; - printf("\ndumping to dev %x, offset %ld\n", dumpdev, dumplo); + printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo); printf("dump "); /* * XXX @@ -1307,13 +1250,11 @@ prom_halt(howto, bootstr) (*callv->_rex)('b'); } } else if (howto & RB_HALT) { - volatile void (*f) __P((void)) = - (volatile void (*) __P((void))) DEC_PROM_REINIT; + volatile void (*f)() = (volatile void (*)())DEC_PROM_REINIT; (*f)(); /* jump back to prom monitor */ } else { - volatile void (*f) __P((void)) = - (volatile void (*) __P((void)))DEC_PROM_AUTOBOOT; + volatile void (*f)() = (volatile void (*)())DEC_PROM_AUTOBOOT; (*f)(); /* jump back to prom monitor and do 'auto' cmd */ } @@ -1329,7 +1270,7 @@ boot(howto) /* take a snap shot before clobbering any registers */ if (curproc) - savectx(curproc->p_addr); + savectx(curproc->p_addr, 0); #ifdef DEBUG if (panicstr) @@ -1377,11 +1318,10 @@ boot(howto) #endif dumpsys(); -haltsys: - /* run any shutdown hooks */ doshutdownhooks(); +haltsys: /* Finally, halt/reboot the system. */ printf("%s\n\n", howto & RB_HALT ? "halted." : "rebooting..."); @@ -1477,6 +1417,8 @@ microtime(tvp) { int s = splclock(); static struct timeval lasttime; + register long usec; + *tvp = time; tvp->tv_usec += clkread(); @@ -1499,7 +1441,7 @@ int initcpu() { register volatile struct chiptime *c; - int i = 0; + int i; #if defined(DS5000_200) || defined(DS5000_25) || defined(DS5000_100) || \ defined(DS5000_240) @@ -1548,7 +1490,7 @@ initcpu() */ int atoi(s) - const char *s; + char *s; { int c; unsigned base = 10, d; @@ -1736,7 +1678,7 @@ kmin_enable_intr(slotno, handler, sc, on) } #if defined(DEBUG) || defined(DIAGNOSTIC) - printf("3MIN: imask %lx, %sabling slot %d, sc %p handler %p\n", + printf("3MIN: imask %x, %sabling slot %d, sc %x addr 0x%x\n", kmin_tc3_imask, (on? "en" : "dis"), slotno, sc, handler); #endif @@ -1940,7 +1882,6 @@ done: #endif /* DS5000_240 */ -#ifdef DS5000_240 /* XXX */ /* * Initialize the I/O asic */ @@ -1958,4 +1899,3 @@ asic_init(isa_maxine) decoder = (volatile u_int *) IOASIC_REG_SCSI_DECODE(ioasic_base); (*decoder) = 0x00000000e; } -#endif /* DS5000_240 XXX */ diff --git a/sys/arch/pmax/pmax/trap.c b/sys/arch/pmax/pmax/trap.c index e59dfc99cc3..88ba03e83dc 100644 --- a/sys/arch/pmax/pmax/trap.c +++ b/sys/arch/pmax/pmax/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.55 1997/05/25 10:01:38 jonathan Exp $ */ +/* $NetBSD: trap.c,v 1.50 1996/10/13 21:37:49 jonathan Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -346,8 +346,6 @@ extern void MachSwitchFPState __P((struct proc *from, struct user *to)); /* only called by locore */ extern u_int trap __P((u_int status, u_int cause, u_int vaddr, u_int pc, int args)); -extern void interrupt __P((u_int status, u_int cause, u_int pc)); -extern void softintr __P((unsigned statusReg, unsigned pc)); #ifdef DEBUG /* stack trace code, also useful to DDB one day */ @@ -1046,7 +1044,7 @@ interrupt(statusReg, causeReg, pc /* XXX what, args */ ) /* process network interrupt if we trapped or will very soon */ /* XXX fixme: operator precedence botch? */ if ((mask & MACH_SOFT_INT_MASK_1) || - (netisr && (statusReg & MACH_SOFT_INT_MASK_1))) { + netisr && (statusReg & MACH_SOFT_INT_MASK_1)) { clearsoftnet(); cnt.v_soft++; intrcnt[SOFTNET_INTR]++; @@ -1327,7 +1325,7 @@ MachEmulateBranch(regsPtr, instPC, fpcCSR, allowNonBranch) * resuming execution, and then restoring the old instruction. */ int -mips_singlestep(p) +cpu_singlestep(p) register struct proc *p; { register unsigned va; |