diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 2001-12-20 06:07:29 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 2001-12-20 06:07:29 +0000 |
commit | 114e8abc12f5fa4603001f0a6eb0a059ba421d04 (patch) | |
tree | 581e9ab7af4fead7f3e81edb8a2d3b48510e7cc4 /sys/arch | |
parent | 99f6bbd894a8f39be6e3ac6ef157f316e9887ebe (diff) |
machine dependant pointer changes.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme88k/dev/clock.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwo.c | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sclock.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/cpu.h | 16 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore_c_routines.c | 25 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 51 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/trap.c | 8 |
7 files changed, 56 insertions, 65 deletions
diff --git a/sys/arch/mvme88k/dev/clock.c b/sys/arch/mvme88k/dev/clock.c index 3d9f772e23c..15ff3fc734c 100644 --- a/sys/arch/mvme88k/dev/clock.c +++ b/sys/arch/mvme88k/dev/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.15 2001/12/19 07:04:41 smurph Exp $ */ +/* $OpenBSD: clock.c,v 1.16 2001/12/20 06:07:28 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -191,7 +191,7 @@ clockattach(parent, self, args) sc->sc_profih.ih_ipl = ca->ca_ipl; prof_reset = ca->ca_ipl | PCC2_IRQ_IEN | PCC2_IRQ_ICLR; pcctwointr_establish(PCC2V_TIMER1, &sc->sc_profih); - mdfp.clock_init_func = &sbc_initclock; + md.clock_init_func = sbc_initclock; printf(": VME1x7"); break; #endif /* NPCCTWO */ @@ -202,7 +202,7 @@ clockattach(parent, self, args) sc->sc_profih.ih_wantframe = 1; sc->sc_profih.ih_ipl = ca->ca_ipl; sysconintr_establish(SYSCV_TIMER1, &sc->sc_profih); - mdfp.clock_init_func = &m188_initclock; + md.clock_init_func = m188_initclock; printf(": VME188"); break; #endif /* NSYSCON */ diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c index 42b0abd49b7..9d889c57a11 100644 --- a/sys/arch/mvme88k/dev/pcctwo.c +++ b/sys/arch/mvme88k/dev/pcctwo.c @@ -1,6 +1,4 @@ - -/* $OpenBSD: pcctwo.c,v 1.13 2001/12/19 07:04:41 smurph Exp $ */ - +/* $OpenBSD: pcctwo.c,v 1.14 2001/12/20 06:07:28 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt * All rights reserved. @@ -190,11 +188,6 @@ void *args; sc->sc_pcc2->pcc2_vecbase = PCC2_VECBASE; sc->sc_pcc2->pcc2_genctl |= PCC2_GENCTL_IEN; /* global irq enable */ - /* - * Set pcc2intr_mask and pcc2intr_ipl. - */ - pcc2intr_ipl = (u_char *)&(sc->sc_pcc2->pcc2_ipl); - pcc2intr_mask = (u_char *)&(sc->sc_pcc2->pcc2_mask); config_search(pcctwo_scan, self, args); } diff --git a/sys/arch/mvme88k/dev/sclock.c b/sys/arch/mvme88k/dev/sclock.c index 1da18472c19..b3015601d56 100644 --- a/sys/arch/mvme88k/dev/sclock.c +++ b/sys/arch/mvme88k/dev/sclock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sclock.c,v 1.8 2001/12/16 23:49:46 miod Exp $ */ +/* $OpenBSD: sclock.c,v 1.9 2001/12/20 06:07:28 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * @@ -191,7 +191,7 @@ sclockattach(parent, self, args) sc->sc_statih.ih_ipl = ca->ca_ipl; stat_reset = ca->ca_ipl | PCC2_IRQ_IEN | PCC2_IRQ_ICLR; pcctwointr_establish(PCC2V_TIMER2, &sc->sc_statih); - mdfp.statclock_init_func = &sbc_initstatclock; + md.statclock_init_func = sbc_initstatclock; printf(": VME1x7"); break; #endif /* NPCCTWO */ @@ -202,7 +202,7 @@ sclockattach(parent, self, args) sc->sc_statih.ih_wantframe = 1; sc->sc_statih.ih_ipl = ca->ca_ipl; sysconintr_establish(SYSCV_TIMER2, &sc->sc_statih); - mdfp.statclock_init_func = &m188_initstatclock; + md.statclock_init_func = m188_initstatclock; printf(": VME188"); break; #endif /* NSYSCON */ diff --git a/sys/arch/mvme88k/include/cpu.h b/sys/arch/mvme88k/include/cpu.h index 1206fe23b69..4731c9e8c79 100644 --- a/sys/arch/mvme88k/include/cpu.h +++ b/sys/arch/mvme88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.15 2001/12/16 23:49:46 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.16 2001/12/20 06:07:28 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -184,18 +184,20 @@ struct switchframe { void *sf_proc; /* proc pointer */ }; -/* This struct defines the machine dependant function pointers */ - -struct funcp { +/* This struct defines the machine dependant pointers */ +struct md_p { void (*clock_init_func) __P((void)); /* interval clock init function */ void (*statclock_init_func) __P((void)); /* statistics clock init function */ void (*delayclock_init_func) __P((void)); /* delay clock init function */ void (*delay_func) __P((void)); /* delay clock function */ - void (*interrupt_func) __P((u_int, struct m88100_saved_state *)); /* interrupt func */ - void (*fp_precise_func) __P((void)); /* floating point precise function */ + void (*interrupt_func) __P((u_int, struct m88100_saved_state *)); /* interrupt func */ + volatile u_char *intr_mask; + volatile u_char *intr_ipl; + volatile u_char *intr_src; }; -extern struct funcp mdfp; +extern struct md_p md; + int badvaddr __P((vm_offset_t va, int size)); void nmihand __P((void *framep)); diff --git a/sys/arch/mvme88k/mvme88k/locore_c_routines.c b/sys/arch/mvme88k/mvme88k/locore_c_routines.c index 68f2aadd38a..279c9976299 100644 --- a/sys/arch/mvme88k/mvme88k/locore_c_routines.c +++ b/sys/arch/mvme88k/mvme88k/locore_c_routines.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locore_c_routines.c,v 1.17 2001/12/19 07:04:41 smurph Exp $ */ +/* $OpenBSD: locore_c_routines.c,v 1.18 2001/12/20 06:07:28 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -28,14 +28,16 @@ #include "assym.h" +#include <sys/param.h> #include <sys/types.h> #include <sys/systm.h> +#include <machine/cpu_number.h> /* cpu_number() */ +#include <machine/board.h> /* m188 bit defines */ #include <machine/asm.h> /* END_OF_VECTOR_LIST, etc. */ #include <machine/asm_macro.h> /* enable/disable interrupts */ #include <machine/mmu.h> -#include <machine/board.h> /* m188 bit defines */ -#include <machine/cmmu.h> +#include <machine/cmmu.h> /* DMT_VALID */ #include <machine/cpu_number.h> /* cpu_number() */ #include <machine/locore.h> #include <machine/m88100.h> /* DMT_VALID */ @@ -70,11 +72,6 @@ typedef struct { extern volatile unsigned int * int_mask_reg[MAX_CPUS]; /* in machdep.c */ extern unsigned master_cpu; /* in cmmu.c */ -#if defined(MVME187) || defined(MVME197) -extern u_char *int_mask_level; -extern u_char *int_pri_level; -#endif /* defined(MVME187) || defined(MVME197) */ - /* FORWARDS */ void vector_init(m88k_exception_vector_area *vector, unsigned *vector_init_list); @@ -503,7 +500,7 @@ spl(void) #if defined(MVME187) || defined(MVME197) case BRD_187: case BRD_197: - curspl = *int_mask_level; + curspl = *md.intr_mask; break; #endif /* defined(MVME187) || defined(MVME197) */ } @@ -532,7 +529,7 @@ db_spl(void) #if defined(MVME187) || defined(MVME197) case BRD_187: case BRD_197: - curspl = *int_mask_level; + curspl = *md.intr_mask; break; #endif /* defined(MVME187) || defined(MVME197) */ } @@ -579,8 +576,8 @@ setipl(unsigned level) #if defined(MVME187) || defined(MVME197) case BRD_187: case BRD_197: - curspl = *int_mask_level; - *int_mask_level = level; + curspl = *md.intr_mask; + *md.intr_mask = level; break; #endif /* defined(MVME187) || defined(MVME197) */ } @@ -617,8 +614,8 @@ db_setipl(unsigned level) #if defined(MVME187) || defined(MVME197) case BRD_187: case BRD_197: - curspl = *int_mask_level; - *int_mask_level = level; + curspl = *md.intr_mask; + *md.intr_mask = level; break; #endif /* defined(MVME187) || defined(MVME197) */ } diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index acf5f522730..f7f4878538e 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.76 2001/12/19 07:04:42 smurph Exp $ */ +/* $OpenBSD: machdep.c,v 1.77 2001/12/20 06:07:28 smurph Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -123,7 +123,7 @@ struct intrhand *intr_handlers[256]; vm_offset_t interrupt_stack[MAX_CPUS] = {0}; /* machine dependant function pointers. */ -struct funcp mdfp; +struct md_p md; /* prototypes */ void m88100_Xfp_precise __P((void)); @@ -165,18 +165,9 @@ volatile unsigned int *int_mask_reg[MAX_CPUS] = { }; #endif -#if defined(MVME187) || defined(MVME197) -u_char *int_mask_level = (u_char *)INT_MASK_LEVEL; -u_char *int_pri_level = (u_char *)INT_PRI_LEVEL; -#endif /* defined(MVME187) || defined(MVME197) */ - -#if defined(MVME187) || defined(MVME197) -volatile u_char *pcc2intr_mask; -volatile u_char *pcc2intr_ipl; volatile vm_offset_t bugromva; volatile vm_offset_t sramva; volatile vm_offset_t obiova; -#endif /* defined(MVME187) || defined(MVME197) */ #ifdef MVME188 volatile vm_offset_t utilva; #endif @@ -249,9 +240,9 @@ struct kernel { extern char *esym; #endif -int boothowto; /* read in locore.S */ -int bootdev; /* read in locore.S */ -int cputyp; +int boothowto; /* set in locore.S */ +int bootdev; /* set in locore.S */ +int cputyp; /* set in locore.S */ int brdtyp; /* set in locore.S */ int cpumod = 0; /* set in mvme_bootstrap() */ int cpuspeed = 25; /* 25 MHZ XXX should be read from NVRAM */ @@ -443,17 +434,17 @@ cpu_initclocks() #ifdef DEBUG printf("cpu_initclocks(): "); #endif - if (mdfp.clock_init_func != NULL) { + if (md.clock_init_func != NULL) { #ifdef DEBUG printf("[interval clock] "); #endif - (*mdfp.clock_init_func)(); + (*md.clock_init_func)(); } - if (mdfp.statclock_init_func != NULL) { + if (md.statclock_init_func != NULL) { #ifdef DEBUG printf("[statistics clock]"); #endif - (*mdfp.statclock_init_func)(); + (*md.statclock_init_func)(); } #ifdef DEBUG printf("\n"); @@ -1704,8 +1695,8 @@ sbc_ext_int(u_int v, struct m88100_saved_state *eframe) u_char vec; /* get level and mask */ - asm volatile("ld.b %0,%1" : "=r" (mask) : "" (*pcc2intr_mask)); - asm volatile("ld.b %0,%1" : "=r" (level) : "" (*pcc2intr_ipl)); + asm volatile("ld.b %0,%1" : "=r" (mask) : "" (*md.intr_mask)); + asm volatile("ld.b %0,%1" : "=r" (level) : "" (*md.intr_ipl)); /* * It is really bizarre for the mask and level to the be the same. @@ -2188,7 +2179,7 @@ mvme_bootstrap() struct bugbrdid brdid; /* zreo out the machine dependant function pointers */ - bzero(&mdfp, sizeof(struct funcp)); + bzero(&md, sizeof(struct md_p)); buginit(); /* init the bug routines */ bugbrdid(&brdid); @@ -2205,8 +2196,10 @@ mvme_bootstrap() switch (brdtyp) { #ifdef MVME188 case BRD_188: - mdfp.interrupt_func = &m188_ext_int; - mdfp.fp_precise_func = &m88100_Xfp_precise; + md.interrupt_func = &m188_ext_int; + md.intr_mask = NULL; + md.intr_ipl = NULL; + md.intr_src = NULL; /* clear and disable all interrupts */ *int_mask_reg[0] = 0; *int_mask_reg[1] = 0; @@ -2216,14 +2209,18 @@ mvme_bootstrap() #endif /* MVME188 */ #ifdef MVME187 case BRD_187: - mdfp.interrupt_func = &sbc_ext_int; - mdfp.fp_precise_func = &m88100_Xfp_precise; + md.interrupt_func = &sbc_ext_int; + md.intr_mask = (u_char *)M187_IMASK; + md.intr_ipl = (u_char *)M187_ILEVEL; + md.intr_src = NULL; break; #endif /* MVME187 */ #ifdef MVME197 case BRD_197: - mdfp.interrupt_func = &sbc_ext_int; - mdfp.fp_precise_func = &m88110_Xfp_precise; + md.interrupt_func = &sbc_ext_int; + md.intr_mask = (u_char *)M197_IMASK; + md.intr_ipl = (u_char *)M197_ILEVEL; + md.intr_src = (u_char *)M197_ISRC; set_tcfp(); /* Set Time Critical Floating Point Mode */ break; #endif /* MVME197 */ diff --git a/sys/arch/mvme88k/mvme88k/trap.c b/sys/arch/mvme88k/mvme88k/trap.c index 554d5d8afde..606cbe43f41 100644 --- a/sys/arch/mvme88k/mvme88k/trap.c +++ b/sys/arch/mvme88k/mvme88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.29 2001/12/16 23:49:47 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.30 2001/12/20 06:07:28 smurph Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -59,8 +59,10 @@ #include <machine/bugio.h> /* bugreturn() */ #include <machine/cpu.h> /* DMT_VALID, etc. */ #include <machine/locore.h> +#ifdef M88100 #include <machine/m88100.h> /* DMT_VALID, etc. */ -#ifdef MVME197 +#endif +#ifdef M88110 #include <machine/m88110.h> /* DMT_VALID, etc. */ #endif #include <machine/pcb.h> /* FIP_E, etc. */ @@ -271,7 +273,7 @@ trap18x(unsigned type, struct m88100_saved_state *frame) /* This function pointer is set in machdep.c It calls m188_ext_int or sbc_ext_int depending on the value of cputyp - smurph */ - (*mdfp.interrupt_func)(T_INT, frame); + (*md.interrupt_func)(T_INT, frame); return; case T_MISALGNFLT: |