diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 2001-02-01 03:38:24 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 2001-02-01 03:38:24 +0000 |
commit | 8e8d908c6c5754fd0205eb089e6c5822f92d4473 (patch) | |
tree | 29b74cfdddc396e8a0985b07dd1affefefd062bf /sys/arch/mvme88k/include/asm_macro.h | |
parent | be6f95e73cf569c2b374d15432a35d294774c196 (diff) |
Major changes to get MVME188 working. More header and code cleanups. The
kernel is tested on MVME188A/2P256 and MVME188A/1P64.
Diffstat (limited to 'sys/arch/mvme88k/include/asm_macro.h')
-rw-r--r-- | sys/arch/mvme88k/include/asm_macro.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/sys/arch/mvme88k/include/asm_macro.h b/sys/arch/mvme88k/include/asm_macro.h index c437fb7a0cf..1ece66a5ab7 100644 --- a/sys/arch/mvme88k/include/asm_macro.h +++ b/sys/arch/mvme88k/include/asm_macro.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm_macro.h,v 1.8 2001/01/15 19:50:38 deraadt Exp $ */ +/* $OpenBSD: asm_macro.h,v 1.9 2001/02/01 03:38:17 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -59,12 +59,12 @@ typedef unsigned long m88k_psr_type; */ static __inline__ m88k_psr_type disable_interrupts_return_psr(void) { - m88k_psr_type temp, oldpsr; - __asm__ __volatile__ ("ldcr %0, cr1" : "=r" (oldpsr)); - __asm__ __volatile__ ("set %1, %0, 1<1>" : "=r" (oldpsr), "=r" (temp)); - __asm__ __volatile__ ("stcr %0, cr1" : "=r" (temp)); - __asm__ __volatile__ ("tcnd ne0, r0, 0"); - return oldpsr; + m88k_psr_type temp, oldpsr; + __asm__ __volatile__ ("ldcr %0, cr1" : "=r" (oldpsr)); + __asm__ __volatile__ ("set %1, %0, 1<1>" : "=r" (oldpsr), "=r" (temp)); + __asm__ __volatile__ ("stcr %0, cr1" : "=r" (temp)); + __asm__ __volatile__ ("tcnd ne0, r0, 0"); + return oldpsr; } #define disable_interrupt() (void)disable_interrupts_return_psr() @@ -73,7 +73,7 @@ static __inline__ m88k_psr_type disable_interrupts_return_psr(void) */ static __inline__ void set_psr(m88k_psr_type psr) { - __asm__ __volatile__ ("stcr %0, cr1" :: "r" (psr)); + __asm__ __volatile__ ("stcr %0, cr1" :: "r" (psr)); } /* @@ -81,11 +81,11 @@ static __inline__ void set_psr(m88k_psr_type psr) */ static __inline__ m88k_psr_type enable_interrupts_return_psr(void) { - m88k_psr_type temp, oldpsr; /* need a temporary register */ - __asm__ __volatile__ ("ldcr %0, cr1" : "=r" (oldpsr)); - __asm__ __volatile__ ("clr %1, %0, 1<1>" : "=r" (oldpsr), "=r" (temp)); - __asm__ __volatile__ ("stcr %0, cr1" : "=r" (temp)); - return oldpsr; + m88k_psr_type temp, oldpsr; /* need a temporary register */ + __asm__ __volatile__ ("ldcr %0, cr1" : "=r" (oldpsr)); + __asm__ __volatile__ ("clr %1, %0, 1<1>" : "=r" (oldpsr), "=r" (temp)); + __asm__ __volatile__ ("stcr %0, cr1" : "=r" (temp)); + return oldpsr; } #define enable_interrupt() (void)enable_interrupts_return_psr() @@ -97,8 +97,19 @@ static __inline__ m88k_psr_type enable_interrupts_return_psr(void) */ static __inline__ void flush_pipeline() { - __asm__ __volatile__ ("tcnd ne0, r0, 0"); + __asm__ __volatile__ ("tcnd ne0, r0, 0"); } #define db_flush_pipeline flush_pipeline +/* + * gets the current stack pointer. + */ +static inline unsigned long stack_pointer() +{ + register unsigned long sp; + __asm__ __volatile__ ("or %0,r0,r31" : "=r" (sp)); + return(sp); +} + + #endif __MACHINE_M88K_ASM_MACRO_H__ |