diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-25 21:41:32 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-25 21:41:32 +0000 |
commit | 725770a94c4ecf9f891a8054cd0cb28e2676f53b (patch) | |
tree | 0fa4f2cc25bdee91cfb027da2da3efb8b7c309f0 /sys/arch/mvmeppc | |
parent | 87fcaaa7c3c1c0c0dd898f12de2d379baafb0ed1 (diff) |
Get rid of ppc_[gs]et_msr(), use ppc_m[ft]msr() instead.
Diffstat (limited to 'sys/arch/mvmeppc')
-rw-r--r-- | sys/arch/mvmeppc/dev/bugio.c | 63 | ||||
-rw-r--r-- | sys/arch/mvmeppc/include/cpu.h | 4 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/machdep.c | 63 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/ppc1_machdep.c | 8 |
4 files changed, 55 insertions, 83 deletions
diff --git a/sys/arch/mvmeppc/dev/bugio.c b/sys/arch/mvmeppc/dev/bugio.c index d3ee34ca413..8cb2c12aabd 100644 --- a/sys/arch/mvmeppc/dev/bugio.c +++ b/sys/arch/mvmeppc/dev/bugio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bugio.c,v 1.4 2004/01/24 21:10:29 miod Exp $ */ +/* $OpenBSD: bugio.c,v 1.5 2004/01/25 21:41:26 miod Exp $ */ /* * bug routines -- assumes that the necessary sections of memory @@ -54,14 +54,14 @@ void mvmeprom_brdid(id) struct mvmeprom_brdid *id; { - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); MVMEPROM_CALL(MVMEPROM_BRD_ID); asm volatile ("mr %0, 3": "=r" (id):); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); } /* returns 0 if no characters ready to read */ @@ -69,14 +69,14 @@ int mvmeprom_getchar() { int ret; - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); MVMEPROM_CALL(MVMEPROM_INCHR); asm volatile ("mr %0, 3" : "=r" (ret)); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); return ret; } @@ -85,14 +85,14 @@ int mvmeprom_instat() { int ret; - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); MVMEPROM_CALL(MVMEPROM_INSTAT); asm volatile ("mr %0, 3" : "=r" (ret)); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); return (!(ret & 0x4)); } @@ -100,57 +100,57 @@ void mvmeprom_outln(start, end) char *start, *end; { - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); asm volatile ("mr 3, %0": : "r" (start)); asm volatile ("mr 4, %0": : "r" (end)); MVMEPROM_CALL(MVMEPROM_OUTLN); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); } void mvmeprom_outstr(start, end) char *start, *end; { - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); asm volatile ("mr 3, %0": : "r" (start)); asm volatile ("mr 4, %0": : "r" (end)); MVMEPROM_CALL(MVMEPROM_OUTSTR); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); } void mvmeprom_outchar(c) int c; { - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); asm volatile ("mr 3, %0" :: "r" (c)); MVMEPROM_CALL(MVMEPROM_OUTCHR); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); } /* BUG - return to bug routine */ void mvmeprom_return() { - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); MVMEPROM_CALL(MVMEPROM_RETURN); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); /*NOTREACHED*/ } @@ -159,12 +159,12 @@ void mvmeprom_rtc_rd(ptime) struct mvmeprom_time *ptime; { - unsigned long omsr = ppc_get_msr(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + unsigned long omsr = ppc_mfmsr(); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); asm volatile ("mr 3, %0": : "r" (ptime)); MVMEPROM_CALL(MVMEPROM_RTC_RD); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); } int @@ -173,17 +173,17 @@ bugenvsz(void) register int ret; char tmp[1]; void *ptr = tmp; - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); BUGCTXT(); - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); asm volatile ("mr 3, %0": : "r" (ptr)); asm volatile ("li 5, 0x1"); asm volatile ("li 5, 0x0"); /* get size */ MVMEPROM_CALL(MVMEPROM_ENVIRON); asm volatile ("mr %0, 3" : "=r" (ret)); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); return(ret); } @@ -245,7 +245,7 @@ mvmeprom_envrd(void) char *ptr, *dptr, *ptr_end; int env_size = 0; int pkt_typ, pkt_len; - unsigned long omsr = ppc_get_msr(); + unsigned long omsr = ppc_mfmsr(); env_size = bugenvsz(); bzero(&bugenviron, sizeof(struct bugenviron)); @@ -254,7 +254,7 @@ mvmeprom_envrd(void) if (ptr != NULL) { - ppc_set_msr(((omsr | PSL_IP) &~ PSL_EE)); + ppc_mtmsr(((omsr | PSL_IP) & ~PSL_EE)); BUGCTXT(); asm volatile ("mr 3, %0": : "r" (ptr)); asm volatile ("mr 4, %0": : "r" (env_size)); @@ -262,7 +262,7 @@ mvmeprom_envrd(void) MVMEPROM_CALL(MVMEPROM_ENVIRON); asm volatile ("mr %0, 3" : "=r" (ret)); OSCTXT(); - ppc_set_msr(omsr); + ppc_mtmsr(omsr); if (ret) return NULL; @@ -276,7 +276,6 @@ mvmeprom_envrd(void) case BUG_ENV_END: bugenv_init = 1; /* we have read the env */ bug_printenv(); - ppc_set_msr(omsr); return(&bugenviron); break; case BUG_STARTUP_PARAM: diff --git a/sys/arch/mvmeppc/include/cpu.h b/sys/arch/mvmeppc/include/cpu.h index 71e8e9a7cb7..81320fba161 100644 --- a/sys/arch/mvmeppc/include/cpu.h +++ b/sys/arch/mvmeppc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.5 2002/06/08 15:45:31 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.6 2004/01/25 21:41:28 miod Exp $ */ /* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */ /* @@ -36,8 +36,6 @@ #include <powerpc/cpu.h> -u_int32_t ppc_set_msr(u_int32_t); -u_int32_t ppc_get_msr(void); void install_extint(void (*)(void)); #endif /* _MACHINE_CPU_H_ */ diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c index 78c13a4532a..2d1d3f57e70 100644 --- a/sys/arch/mvmeppc/mvmeppc/machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.39 2004/01/24 21:10:33 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.40 2004/01/25 21:41:30 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -111,9 +111,6 @@ static struct consdev bootcons = { 1 }; -u_int32_t ppc_get_msr(void); -u_int32_t ppc_set_msr(u_int32_t); - /* * Declare these as initialized data so we can patch them. */ @@ -139,7 +136,6 @@ struct bat battable[16]; struct vm_map *exec_map = NULL; struct vm_map *phys_map = NULL; -int astpending; int ppc_malloc_ok = 0; #ifndef SYS_TYPE @@ -175,16 +171,16 @@ initppc(startkernel, endkernel, args) u_int startkernel, endkernel; char *args; { - extern caddr_t trapcode, trapsize; - extern caddr_t dsitrap, dsisize; - extern caddr_t isitrap, isisize; - extern caddr_t alitrap, alisize; - extern caddr_t decrint, decrsize; - extern caddr_t tlbimiss, tlbimsize; - extern caddr_t tlbdlmiss, tlbdlmsize; - extern caddr_t tlbdsmiss, tlbdsmsize; + extern void *trapcode; extern int trapsize; + extern void *dsitrap; extern int dsisize; + extern void *isitrap; extern int isisize; + extern void *alitrap; extern int alisize; + extern void *decrint; extern int decrsize; + extern void *tlbimiss; extern int tlbimsize; + extern void *tlbdlmiss; extern int tlbdlmsize; + extern void *tlbdsmiss; extern int tlbdsmsize; #ifdef DDB - extern caddr_t ddblow, ddbsize; + extern void *ddblow; extern int ddbsize; #endif extern void consinit(void); extern void *msgbuf_addr; @@ -202,7 +198,7 @@ initppc(startkernel, endkernel, args) /* startup fake console driver. It will be replaced by consinit() */ cn_tab = &bootcons; - + /* * Initialize BAT registers to unmapped to not generate * overlapping mappings below. @@ -273,25 +269,25 @@ initppc(startkernel, endkernel, args) break; case EXC_DSI: - bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize); + bcopy(&dsitrap, (void *)exc, (size_t)&dsisize); break; case EXC_ISI: - bcopy(&isitrap, (void *)EXC_ISI, (size_t)&isisize); + bcopy(&isitrap, (void *)exc, (size_t)&isisize); break; case EXC_ALI: - bcopy(&alitrap, (void *)EXC_ALI, (size_t)&alisize); + bcopy(&alitrap, (void *)exc, (size_t)&alisize); break; case EXC_DECR: - bcopy(&decrint, (void *)EXC_DECR, (size_t)&decrsize); + bcopy(&decrint, (void *)exc, (size_t)&decrsize); break; case EXC_IMISS: - bcopy(&tlbimiss, (void *)EXC_IMISS, (size_t)&tlbimsize); + bcopy(&tlbimiss, (void *)exc, (size_t)&tlbimsize); break; case EXC_DLMISS: - bcopy(&tlbdlmiss, (void *)EXC_DLMISS, (size_t)&tlbdlmsize); + bcopy(&tlbdlmiss, (void *)exc, (size_t)&tlbdlmsize); break; case EXC_DSMISS: - bcopy(&tlbdsmiss, (void *)EXC_DSMISS, (size_t)&tlbdsmsize); + bcopy(&tlbdsmiss, (void *)exc, (size_t)&tlbdsmsize); break; #ifdef DDB case EXC_PGM: @@ -408,7 +404,6 @@ initppc(startkernel, endkernel, args) * 0xf0000000 - kernel map segment (user space mapped here) */ - prep_bus_space_init(); devio_ex = extent_create("devio", 0x80000000, 0xffffffff, M_DEVBUF, (caddr_t)devio_ex_storage, sizeof(devio_ex_storage), EX_NOCOALESCE|EX_NOWAIT); @@ -425,10 +420,6 @@ initppc(startkernel, endkernel, args) printf("kernel does not support -c; continuing..\n"); #endif } - /* - * Replace with real console. - */ - cninit(); #ifdef DDB if (boothowto & RB_KDB) @@ -550,6 +541,7 @@ cpu_startup() */ bufinit(); + prep_bus_space_init(); devio_malloc_safe = 1; } @@ -919,23 +911,6 @@ ppc_intr_setup(intr_establish_t *establish, intr_disestablish_t *disestablish) intr_disestablish_func = disestablish; } -u_int32_t -ppc_get_msr(void) -{ - u_int32_t msr; - __asm__ volatile("mfmsr %0" : "=r"(msr)); - return(msr); -} - -u_int32_t -ppc_set_msr(msr) - u_int32_t msr; -{ - __asm__ volatile("mtmsr %0" :: "r"(msr)); - __asm__ volatile("mfmsr %0" : "=r"(msr)); - return(msr); -} - vaddr_t ppc_kvm_stolen = VM_KERN_ADDRESS_SIZE; #if 0 diff --git a/sys/arch/mvmeppc/mvmeppc/ppc1_machdep.c b/sys/arch/mvmeppc/mvmeppc/ppc1_machdep.c index 165273516cb..b658a7eb66c 100644 --- a/sys/arch/mvmeppc/mvmeppc/ppc1_machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/ppc1_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppc1_machdep.c,v 1.10 2004/01/24 22:15:58 miod Exp $ */ +/* $OpenBSD: ppc1_machdep.c,v 1.11 2004/01/25 21:41:31 miod Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -85,7 +85,7 @@ struct firmware ppc1_firmware = { }; #define PPC1_REGIONS 32 -static struct mem_region PPC1mem[PPC1_REGIONS + 1], PPC1avail[PPC1_REGIONS + 3]; +struct mem_region PPC1mem[PPC1_REGIONS + 1], PPC1avail[PPC1_REGIONS + 3]; /* * 1 - Figure and find the end of local memory. This is now a Bug call. @@ -199,9 +199,9 @@ PPC1_boot(bootspec) u_int32_t msr, i = 10000; /* set exception prefix high - to the prom */ - msr = ppc_get_msr(); + msr = ppc_mfmsr(); msr |= PSL_IP; - ppc_set_msr(msr); + ppc_mtmsr(msr); /* make sure bit 0 (reset) is a 0 */ outb(0x80000092, inb(0x80000092) & ~1L); |