Module Name:    src
Committed By:   christos
Date:           Sat Mar 16 23:04:23 UTC 2013

Modified Files:
        src/sys/arch/sparc64/include: asm.h locore.h

Log Message:
move the useful macros somewhere where they can be used in userland.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sparc64/include/asm.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/include/locore.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/include/asm.h
diff -u src/sys/arch/sparc64/include/asm.h:1.19 src/sys/arch/sparc64/include/asm.h:1.20
--- src/sys/arch/sparc64/include/asm.h:1.19	Sat Jul 20 07:52:21 2002
+++ src/sys/arch/sparc64/include/asm.h	Sat Mar 16 19:04:22 2013
@@ -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

Index: src/sys/arch/sparc64/include/locore.h
diff -u src/sys/arch/sparc64/include/locore.h:1.5 src/sys/arch/sparc64/include/locore.h:1.6
--- src/sys/arch/sparc64/include/locore.h:1.5	Sat Jul 10 06:10:36 2010
+++ src/sys/arch/sparc64/include/locore.h	Sat Mar 16 19:04:22 2013
@@ -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

Reply via email to