diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-12-03 16:52:17 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-12-03 16:52:17 +0000 |
commit | 734d8d431c424e5467db4143f21b9249f5900059 (patch) | |
tree | 4a628532590d6911eceb5c99174166eb74d57839 /sys/arch | |
parent | 0bb51708ca93656d09152d5fc091b30525016c1e (diff) |
Turn read_processor_identification_register() into a simple macro with a
much, much, much shorter name. It is only used to print cpu revision anyway...
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/luna88k/include/locore.h | 3 | ||||
-rw-r--r-- | sys/arch/m88k/include/asm_macro.h | 19 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/m8820x_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/subr.S | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/locore.h | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m88110.c | 4 |
6 files changed, 20 insertions, 19 deletions
diff --git a/sys/arch/luna88k/include/locore.h b/sys/arch/luna88k/include/locore.h index eeaacb50714..00d85fab2c1 100644 --- a/sys/arch/luna88k/include/locore.h +++ b/sys/arch/luna88k/include/locore.h @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.h,v 1.6 2005/12/03 14:30:02 miod Exp $ */ +/* $OpenBSD: locore.h,v 1.7 2005/12/03 16:52:14 miod Exp $ */ #ifndef _MACHINE_LOCORE_H_ #define _MACHINE_LOCORE_H_ @@ -9,7 +9,6 @@ /* subr.S */ -unsigned read_processor_identification_register(void); int badaddr(vaddr_t addr, int size); #define badwordaddr(x) badaddr(x, 4) void doboot(void); diff --git a/sys/arch/m88k/include/asm_macro.h b/sys/arch/m88k/include/asm_macro.h index 597fe42fb31..2ece4e147d1 100644 --- a/sys/arch/m88k/include/asm_macro.h +++ b/sys/arch/m88k/include/asm_macro.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm_macro.h,v 1.2 2005/04/30 16:42:36 miod Exp $ */ +/* $OpenBSD: asm_macro.h,v 1.3 2005/12/03 16:52:16 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -26,8 +26,8 @@ * rights to redistribute these changes. */ -#ifndef __MACHINE_M88K_ASM_MACRO_H__ -#define __MACHINE_M88K_ASM_MACRO_H__ +#ifndef __M88K_ASM_MACRO_H__ +#define __M88K_ASM_MACRO_H__ /* * Various compiler macros used for speed and efficiency. @@ -58,7 +58,7 @@ static __inline__ u_int get_psr(void) { u_int psr; __asm__ __volatile__ ("ldcr %0, cr1" : "=r" (psr)); - return psr; + return (psr); } #define disable_interrupt(psr) set_psr(((psr) = get_psr()) | PSR_IND) @@ -69,7 +69,14 @@ static __inline__ u_int get_psr(void) static __inline__ unsigned ff1(unsigned val) { __asm__ __volatile__ ("ff1 %0, %0" : "=r" (val) : "0" (val)); - return val; + return (val); } -#endif /* __MACHINE_M88K_ASM_MACRO_H__ */ +static __inline__ u_int get_cpu_pid(void) +{ + u_int pid; + __asm__ __volatile__ ("ldcr %0, cr0" : "=r" (pid)); + return (pid); +} + +#endif /* __M88K_ASM_MACRO_H__ */ diff --git a/sys/arch/m88k/m88k/m8820x_machdep.c b/sys/arch/m88k/m88k/m8820x_machdep.c index 9fb1c42b758..929e7711f4e 100644 --- a/sys/arch/m88k/m88k/m8820x_machdep.c +++ b/sys/arch/m88k/m88k/m8820x_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m8820x_machdep.c,v 1.12 2005/12/02 21:16:45 miod Exp $ */ +/* $OpenBSD: m8820x_machdep.c,v 1.13 2005/12/03 16:52:16 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * @@ -262,7 +262,7 @@ void m8820x_cpu_configuration_print(int master) { struct m8820x_cmmu *cmmu; - int pid = read_processor_identification_register(); + int pid = get_cpu_pid(); int proctype = (pid & PID_ARN) >> ARN_SHIFT; int procvers = (pid & PID_VN) >> VN_SHIFT; int mmu, cnt, cpu = cpu_number(); diff --git a/sys/arch/m88k/m88k/subr.S b/sys/arch/m88k/m88k/subr.S index 247190c49dd..cd2e9ad3167 100644 --- a/sys/arch/m88k/m88k/subr.S +++ b/sys/arch/m88k/m88k/subr.S @@ -1,4 +1,4 @@ -/* $OpenBSD: subr.S,v 1.9 2005/12/03 14:30:06 miod Exp $ */ +/* $OpenBSD: subr.S,v 1.10 2005/12/03 16:52:16 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -1544,10 +1544,6 @@ ENTRY(longjmp) jmp.n r1 or r2,r0,1 -ENTRY(read_processor_identification_register) - jmp.n r1 - ldcr r2, PID - /* * Trampoline code. Gets copied to the top of * user stack in exec. diff --git a/sys/arch/mvme88k/include/locore.h b/sys/arch/mvme88k/include/locore.h index d73a4e53f2a..62b60dbb683 100644 --- a/sys/arch/mvme88k/include/locore.h +++ b/sys/arch/mvme88k/include/locore.h @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.h,v 1.29 2005/12/03 14:30:06 miod Exp $ */ +/* $OpenBSD: locore.h,v 1.30 2005/12/03 16:52:16 miod Exp $ */ #ifndef _MACHINE_LOCORE_H_ #define _MACHINE_LOCORE_H_ @@ -9,7 +9,6 @@ /* subr.S */ -unsigned read_processor_identification_register(void); int badaddr(vaddr_t addr, int size); #define badwordaddr(x) badaddr(x, 4) void doboot(void); diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c index e4d8726e9b4..8143c73b07d 100644 --- a/sys/arch/mvme88k/mvme88k/m88110.c +++ b/sys/arch/mvme88k/mvme88k/m88110.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m88110.c,v 1.29 2005/12/03 14:30:06 miod Exp $ */ +/* $OpenBSD: m88110.c,v 1.30 2005/12/03 16:52:16 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * All rights reserved. @@ -199,7 +199,7 @@ m88110_setup_board_config(void) void m88110_cpu_configuration_print(int master) { - int pid = read_processor_identification_register(); + int pid = get_cpu_pid(); int proctype = (pid & PID_ARN) >> ARN_SHIFT; int procvers = (pid & PID_VN) >> VN_SHIFT; int cpu = cpu_number(); |