summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-05-10 10:14:49 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-05-10 10:14:49 +0000
commitc171ba78cff1b045e1d0215856d9f3bb38b0615e (patch)
treeb7ebdf9a05543ffddd0d371502e5038a5ea5e6af /sys
parentfb683f839aacfea6120acee8af6473f6b6203afa (diff)
Some protection from userland and some __asm paranoia.
From NetBSD.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/include/alpha_cpu.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/arch/alpha/include/alpha_cpu.h b/sys/arch/alpha/include/alpha_cpu.h
index ec6feaa7128..6c44a5437be 100644
--- a/sys/arch/alpha/include/alpha_cpu.h
+++ b/sys/arch/alpha/include/alpha_cpu.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: alpha_cpu.h,v 1.6 2000/11/08 21:27:15 ericj Exp $ */
-/* $NetBSD: alpha_cpu.h,v 1.41 2000/06/08 03:10:06 thorpej Exp $ */
+/* $OpenBSD: alpha_cpu.h,v 1.7 2002/05/10 10:14:48 art Exp $ */
+/* $NetBSD: alpha_cpu.h,v 1.43 2001/12/18 04:18:22 thorpej Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -266,6 +266,8 @@ typedef unsigned long alpha_pt_entry_t;
#define ALPHA_IF_CODE_FEN 3
#define ALPHA_IF_CODE_OPDEC 4
+#ifdef _KERNEL
+
/*
* Translation Buffer Invalidation definitions [OSF/1 PALcode Specific]
*/
@@ -276,6 +278,8 @@ typedef unsigned long alpha_pt_entry_t;
#define ALPHA_TBISD(va) alpha_pal_tbi(2, (va)) /* DTB entry for va */
#define ALPHA_TBIS(va) alpha_pal_tbi(3, (va)) /* all for va */
+#endif /* _KERNEL */
+
/*
* Bits used in the amask instruction [EV56 and later]
*/
@@ -301,6 +305,8 @@ typedef unsigned long alpha_pt_entry_t;
#define ALPHA_IMPLVER_EV5 1 /* EV5/EV56/PCA56 */
#define ALPHA_IMPLVER_EV6 2 /* EV6 */
+#ifdef _KERNEL
+
/*
* Maximum processor ID we allow from `whami', and related constants.
*
@@ -324,6 +330,10 @@ const char *alpha_dsr_sysname(void);
unsigned long alpha_amask(unsigned long);
unsigned long alpha_implver(void);
+#endif /* _KERNEL */
+
+/* XXX Expose the insn wrappers to userspace, for now. */
+
static __inline unsigned long
alpha_rpcc(void)
{
@@ -336,6 +346,8 @@ alpha_rpcc(void)
#define alpha_mb() __asm __volatile("mb" : : : "memory")
#define alpha_wmb() __asm __volatile("mb" : : : "memory") /* XXX */
+#if defined(_KERNEL) || defined(_STANDALONE)
+
/*
* Stubs for OSF/1 PALcode operations.
*/
@@ -419,7 +431,7 @@ alpha_pal_swpctx(unsigned long ctx)
: "=r" (a0), "=r" (v0)
: "i" (PAL_OSF1_swpctx), "0" (a0)
/* clobbers t0, t8..t11, a0 (above) */
- : "$1", "$22", "$23", "$24", "$25");
+ : "$1", "$22", "$23", "$24", "$25", "memory");
return (v0);
}
@@ -434,7 +446,7 @@ alpha_pal_swpipl(unsigned long ipl)
: "=r" (a0), "=r" (v0)
: "i" (PAL_OSF1_swpipl), "0" (a0)
/* clobbers t0, t8..t11, a0 (above) */
- : "$1", "$22", "$23", "$24", "$25");
+ : "$1", "$22", "$23", "$24", "$25", "memory");
return (v0);
}
@@ -526,4 +538,6 @@ alpha_pal_wrval(unsigned long val)
: "$1", "$22", "$23", "$24", "$25");
}
+#endif /* _KERNEL */
+
#endif /* __ALPHA_ALPHA_CPU_H__ */