diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2001-10-28 00:58:30 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2001-10-28 00:58:30 +0000 |
commit | 5ee6c68ff158d9a02a87401bd468e0269476b731 (patch) | |
tree | 2f5e598dc3ceb07904c60a4b7c409d27e5a0c340 | |
parent | 8584646f48809d22fe10939a0372642cd4b7ea40 (diff) |
Use the same pipeline flush instruction everywhere.
-rw-r--r-- | sys/arch/mvme88k/include/asm.h | 11 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/asm_macro.h | 29 |
2 files changed, 22 insertions, 18 deletions
diff --git a/sys/arch/mvme88k/include/asm.h b/sys/arch/mvme88k/include/asm.h index b43bc8b1d1e..00336ad80c3 100644 --- a/sys/arch/mvme88k/include/asm.h +++ b/sys/arch/mvme88k/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.14 2001/09/21 02:19:31 miod Exp $ */ +/* $OpenBSD: asm.h,v 1.15 2001/10/28 00:58:29 miod Exp $ */ /* * Mach Operating System @@ -136,11 +136,14 @@ * will never actually take the trap). */ #if 0 -#define FLUSH_PIPELINE tcnd ne0, r0, 0 +#define FLUSH_PIPELINE tcnd ne0, r0, 0 +#define FLUSH_PIPELINE_STRING "tcnd ne0, r0, 0" #else -#define FLUSH_PIPELINE tb1 0, r0, 0 +#define FLUSH_PIPELINE tb1 0, r0, 0 +#define FLUSH_PIPELINE_STRING "tb1 0, r0, 0" #endif -#define NOP or r0, r0, r0 +#define NOP or r0, r0, r0 +#define NOP_STRING "or r0, r0, r0" /* * Useful in some situations. diff --git a/sys/arch/mvme88k/include/asm_macro.h b/sys/arch/mvme88k/include/asm_macro.h index e2f951a21f1..c9245754166 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.14 2001/08/12 12:03:02 heko Exp $ */ +/* $OpenBSD: asm_macro.h,v 1.15 2001/10/28 00:58:29 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -35,6 +35,16 @@ */ /* + * Flushes the data pipeline. + */ +static __inline__ void flush_pipeline(void) +{ + __asm__ __volatile__ (FLUSH_PIPELINE_STRING); +} + +#define db_flush_pipeline flush_pipeline + +/* * PSR_TYPE is the type of the Process Status Register. */ typedef unsigned long m88k_psr_type; @@ -63,7 +73,7 @@ static __inline__ m88k_psr_type disable_interrupts_return_psr(void) __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"); + __asm__ __volatile__ (FLUSH_PIPELINE_STRING); return oldpsr; } #define disable_interrupt() (void)disable_interrupts_return_psr() @@ -74,7 +84,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__ ("tcnd ne0, r0, 0"); + __asm__ __volatile__ (FLUSH_PIPELINE_STRING); } /* @@ -86,7 +96,7 @@ static __inline__ m88k_psr_type enable_interrupts_return_psr(void) __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)); - __asm__ __volatile__ ("tcnd ne0, r0, 0"); + __asm__ __volatile__ (FLUSH_PIPELINE_STRING); return oldpsr; } #define enable_interrupt() (void)enable_interrupts_return_psr() @@ -95,22 +105,13 @@ static __inline__ m88k_psr_type enable_interrupts_return_psr(void) #define db_disable_interrupt disable_interrupt /* - * Flushes the data pipeline. - */ -static __inline__ void flush_pipeline(void) -{ - __asm__ __volatile__ ("tcnd ne0, r0, 0"); -} -#define db_flush_pipeline flush_pipeline - -/* * Gets the current stack pointer. */ static __inline__ unsigned long stack_pointer(void) { register unsigned long sp; __asm__ __volatile__ ("or %0,r0,r31" : "=r" (sp)); - return(sp); + return sp; } /* |