summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>1999-12-01 18:23:11 +0000
committerthorpej <thorpej@NetBSD.org>1999-12-01 18:23:11 +0000
commitc258dfae2fafaee5cfcd970ca2bd54d5ea342be9 (patch)
tree1e39ba865f01360638385bc7228a5b852b3c2477 /sys
parent38e73c0c993bfc34fe4d536f6836ef3dc5ee0cad (diff)
After reading the GCC `documentation' a little more, improve the inline
__asm() statements added previously for PALcode operations.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/include/alpha_cpu.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/sys/arch/alpha/include/alpha_cpu.h b/sys/arch/alpha/include/alpha_cpu.h
index 8f7255b64ac..7f91fc67507 100644
--- a/sys/arch/alpha/include/alpha_cpu.h
+++ b/sys/arch/alpha/include/alpha_cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha_cpu.h,v 1.32 1999/11/30 00:42:47 thorpej Exp $ */
+/* $NetBSD: alpha_cpu.h,v 1.33 1999/12/01 18:23:11 thorpej Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -326,8 +326,8 @@ alpha_rpcc()
return (v0);
}
-#define alpha_mb() __asm __volatile("mb")
-#define alpha_wmb() __asm __volatile("mb") /* XXX */
+#define alpha_mb() __asm __volatile("mb" : : : "memory")
+#define alpha_wmb() __asm __volatile("mb" : : : "memory") /* XXX */
u_int8_t alpha_ldbu __P((volatile u_int8_t *));
u_int16_t alpha_ldwu __P((volatile u_int16_t *));
@@ -350,6 +350,8 @@ void alpha_atomic_sub_q __P((unsigned long *, unsigned long));
/*
* Stubs for OSF/1 PALcode operations.
*/
+#include <machine/pal.h>
+
void alpha_pal_cflush __P((unsigned long));
void alpha_pal_draina __P((void));
void alpha_pal_halt __P((void)) __attribute__((__noreturn__));
@@ -375,16 +377,17 @@ static __inline void alpha_pal_tbi __P((unsigned long, vaddr_t))
static __inline unsigned long alpha_pal_whami __P((void))
__attribute__((__unused__));
-#define alpha_pal_imb() __asm __volatile("call_pal 0x0086")
+#define alpha_pal_imb() __asm __volatile("call_pal %0" \
+ : : "i" (PAL_imb) : "memory")
static __inline unsigned long
alpha_pal_rdps()
{
register unsigned long v0 __asm("$0");
- __asm __volatile("call_pal 0x0036" /* PAL_OSF1_rdps */
+ __asm __volatile("call_pal %1"
: "=r" (v0)
- :
+ : "i" (PAL_OSF1_rdps)
/* clobbers t0, t8..t11 */
: "$1", "$22", "$23", "$24", "$25");
@@ -398,11 +401,11 @@ alpha_pal_swpipl(ipl)
register unsigned long a0 __asm("$16") = ipl;
register unsigned long v0 __asm("$0");
- __asm __volatile("call_pal 0x0035" /* PAL_OSF1_swpipl */
- : "=r" (v0)
- : "r" (a0)
- /* clobbers t0, t8..t11, a0 */
- : "$1", "$22", "$23", "$24", "$25", "$16");
+ __asm __volatile("call_pal %2"
+ : "=r" (a0), "=r" (v0)
+ : "i" (PAL_OSF1_swpipl), "0" (a0)
+ /* clobbers t0, t8..t11, a0 (above) */
+ : "$1", "$22", "$23", "$24", "$25");
return (v0);
}
@@ -415,11 +418,11 @@ alpha_pal_tbi(op, va)
register unsigned long a0 __asm("$16") = op;
register unsigned long a1 __asm("$17") = va;
- __asm __volatile("call_pal 0x0033" /* PAL_OSF1_tbi */
- :
- : "r" (a0), "r" (a1)
- /* clobbers t0, t8..t11, a0, a1 */
- : "$1", "$22", "$23", "$24", "$25", "$16", "$17");
+ __asm __volatile("call_pal %2"
+ : "=r" (a0), "=r" (a1)
+ : "i" (PAL_OSF1_tbi), "0" (a0), "1" (a1)
+ /* clobbers t0, t8..t11, a0 (above), a1 (above) */
+ : "$1", "$22", "$23", "$24", "$25");
}
static __inline unsigned long
@@ -427,9 +430,9 @@ alpha_pal_whami()
{
register unsigned long v0 __asm("$0");
- __asm __volatile("call_pal 0x003c" /* PAL_OSF1_whami */
+ __asm __volatile("call_pal %1"
: "=r" (v0)
- :
+ : "i" (PAL_OSF1_whami)
/* clobbers t0, t8..t11 */
: "$1", "$22", "$23", "$24", "$25");