Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/include move the useful macros somewhere wh...
details: https://anonhg.NetBSD.org/src/rev/5d9720ccbdc8
branches: trunk
changeset: 785496:5d9720ccbdc8
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 16 23:04:22 2013 +0000
description:
move the useful macros somewhere where they can be used in userland.
diffstat:
sys/arch/sparc64/include/asm.h | 65 ++++++++++++++++++++++++++++++++++++++-
sys/arch/sparc64/include/locore.h | 61 +------------------------------------
2 files changed, 65 insertions(+), 61 deletions(-)
diffs (146 lines):
diff -r 201a1fe4c404 -r 5d9720ccbdc8 sys/arch/sparc64/include/asm.h
--- a/sys/arch/sparc64/include/asm.h Sat Mar 16 22:32:50 2013 +0000
+++ b/sys/arch/sparc64/include/asm.h Sat Mar 16 23:04:22 2013 +0000
@@ -1,3 +1,66 @@
-/* $NetBSD: asm.h,v 1.19 2002/07/20 11:52:21 mrg Exp $ */
+/* $NetBSD: asm.h,v 1.20 2013/03/16 23:04:22 christos Exp $ */
#include <sparc/asm.h>
+
+/*
+ * Here are some defines to try to maintain consistency but still
+ * support 32-and 64-bit compilers.
+ */
+#ifdef _LP64
+/* reg that points to base of data/text segment */
+#define BASEREG %g4
+/* first constants for storage allocation */
+#define LNGSZ 8
+#define LNGSHFT 3
+#define PTRSZ 8
+#define PTRSHFT 3
+#define POINTER .xword
+#define ULONG .xword
+/* Now instructions to load/store pointers & long ints */
+#define LDLNG ldx
+#define LDULNG ldx
+#define STLNG stx
+#define STULNG stx
+#define LDPTR ldx
+#define LDPTRA ldxa
+#define STPTR stx
+#define STPTRA stxa
+#define CASPTR casxa
+/* Now something to calculate the stack bias */
+#define STKB BIAS
+#define CCCR %xcc
+#else
+#define BASEREG %g0
+#define LNGSZ 4
+#define LNGSHFT 2
+#define PTRSZ 4
+#define PTRSHFT 2
+#define POINTER .word
+#define ULONG .word
+/* Instructions to load/store pointers & long ints */
+#define LDLNG ldsw
+#define LDULNG lduw
+#define STLNG stw
+#define STULNG stw
+#define LDPTR lduw
+#define LDPTRA lduwa
+#define STPTR stw
+#define STPTRA stwa
+#define CASPTR casa
+#define STKB 0
+#define CCCR %icc
+#endif
+
+#if defined(_KERNEL) || defined(_RUMPKERNEL)
+/* Give this real authority: reset the machine */
+#define NOTREACHED sir
+#else
+#define NOTREACHED
+#endif
+
+/* if < 32, copy by bytes, memcpy, kcopy, ... */
+#define BCOPY_SMALL 32
+
+/* use as needed to align things on longword boundaries */
+#define _ALIGN .align 8
+#define ICACHE_ALIGN .align 32
diff -r 201a1fe4c404 -r 5d9720ccbdc8 sys/arch/sparc64/include/locore.h
--- a/sys/arch/sparc64/include/locore.h Sat Mar 16 22:32:50 2013 +0000
+++ b/sys/arch/sparc64/include/locore.h Sat Mar 16 23:04:22 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.5 2010/07/10 10:10:36 nakayama Exp $ */
+/* $NetBSD: locore.h,v 1.6 2013/03/16 23:04:22 christos Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath
@@ -32,65 +32,6 @@
#define CPCB (CPUINFO_VA + CI_CPCB)
#define FPLWP (CPUINFO_VA + CI_FPLWP)
-/*
- * Here are some defines to try to maintain consistency but still
- * support 32-and 64-bit compilers.
- */
-#ifdef _LP64
-/* reg that points to base of data/text segment */
-#define BASEREG %g4
-/* first constants for storage allocation */
-#define LNGSZ 8
-#define LNGSHFT 3
-#define PTRSZ 8
-#define PTRSHFT 3
-#define POINTER .xword
-#define ULONG .xword
-/* Now instructions to load/store pointers & long ints */
-#define LDLNG ldx
-#define LDULNG ldx
-#define STLNG stx
-#define STULNG stx
-#define LDPTR ldx
-#define LDPTRA ldxa
-#define STPTR stx
-#define STPTRA stxa
-#define CASPTR casxa
-/* Now something to calculate the stack bias */
-#define STKB BIAS
-#define CCCR %xcc
-#else
-#define BASEREG %g0
-#define LNGSZ 4
-#define LNGSHFT 2
-#define PTRSZ 4
-#define PTRSHFT 2
-#define POINTER .word
-#define ULONG .word
-/* Instructions to load/store pointers & long ints */
-#define LDLNG ldsw
-#define LDULNG lduw
-#define STLNG stw
-#define STULNG stw
-#define LDPTR lduw
-#define LDPTRA lduwa
-#define STPTR stw
-#define STPTRA stwa
-#define CASPTR casa
-#define STKB 0
-#define CCCR %icc
-#endif
-
-/* Give this real authority: reset the machine */
-#define NOTREACHED sir
-
-/* if < 32, copy by bytes, memcpy, kcopy, ... */
-#define BCOPY_SMALL 32
-
-/* use as needed to align things on longword boundaries */
-#define _ALIGN .align 8
-#define ICACHE_ALIGN .align 32
-
/* A few convenient abbreviations for trapframe fields. */
#define TF_G TF_GLOBAL
#define TF_O TF_OUT
Home |
Main Index |
Thread Index |
Old Index