summaryrefslogtreecommitdiff
path: root/usr.sbin/afs
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-10-01 03:56:08 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-10-01 03:56:08 +0000
commitfce72dd716cb026f1762b4dadc01d5b472532192 (patch)
treed9e6ce69d01f5865a87627b270894cc369747fef /usr.sbin/afs
parent5e0d42e07bc311042b080d99342fe7dffe9a5a66 (diff)
version 1.2.4.1 from KTH: ok deraadt@ jason@
make it work for netbsd/sparc64 (really any sparcv9 running !solaris)
Diffstat (limited to 'usr.sbin/afs')
-rw-r--r--usr.sbin/afs/src/lwp/process.sparc.S59
1 files changed, 36 insertions, 23 deletions
diff --git a/usr.sbin/afs/src/lwp/process.sparc.S b/usr.sbin/afs/src/lwp/process.sparc.S
index fc72b00cb96..94675ea7e29 100644
--- a/usr.sbin/afs/src/lwp/process.sparc.S
+++ b/usr.sbin/afs/src/lwp/process.sparc.S
@@ -1,4 +1,4 @@
-/* $KTH: process.sparc.S,v 1.2 2000/06/12 13:38:13 assar Exp $ */
+/* $KTH: process.sparc.S,v 1.2.4.1 2002/08/13 22:47:40 lha Exp $ */
/*
****************************************************************************
@@ -25,33 +25,55 @@
#undef RCSID
+#if defined(__sparc64__) && !defined(__sparcv9)
+#define __sparcv9 1
+#endif
+
+
#if defined(AFS_SUN5_ENV)
#include <sys/asm_linkage.h>
#include <sys/trap.h>
-#ifndef STACK_BIAS
-#define STACK_BIAS 0
-#endif
#elif defined(AFS_BSD_ENV)
#ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h>
#endif
#include <machine/trap.h>
#define ST_FLUSH_WINDOWS ST_FLUSHWIN
-#define MINFRAME 92
-#define SA(x) (((x)+7)&~7)
-#define STACK_ALIGN 8
-#define STACK_BIAS 0
#elif defined(AFS_LINUX_ENV)
-#define AFS_SUN5_ENV 1 /* Make believe this is Solaris */
#define ST_FLUSH_WINDOWS 0x03 /* XXX: from asm/traps.h */
-#define MINFRAME 92
-#define SA(x) (((x)+7)&~7)
-#define STACK_ALIGN 8
-#define STACK_BIAS 0
#else /* SunOS4 */
#include <sun4/asm_linkage.h>
#include <sun4/trap.h>
-#define STACK_BIAS 0
+#endif
+
+#ifdef __sparcv9
+
+#ifndef STACK_BIAS
+#define STACK_BIAS (2048-1)
+#endif
+#ifndef STACK_ALIGN
+#define STACK_ALIGN 8
+#endif
+#ifndef MINFRAME
+#define MINFRAME 176
+#endif
+
+#else /* !__sparcv9 */
+
+#ifndef STACK_BIAS
+#define STACK_BIAS 0
+#endif
+#ifndef STACK_ALIGN
+#define STACK_ALIGN 4
+#endif
+#ifndef MINFRAME
+#define MINFRAME 96
+#endif
+
+#endif /* __sparcv9 */
+
+#ifndef SA
+#define SA(x) (((x)+(STACK_ALIGN-1))& ~(STACK_ALIGN-1))
#endif
#include <lwp_elf.h>
@@ -70,8 +92,6 @@ ENTRY(savecontext)
ta ST_FLUSH_WINDOWS ! FLush all other active windows
/* The following 3 lines do the equivalent of: _PRE_Block = 1 */
-#ifdef AFS_SUN5_ENV
-
#ifdef __sparcv9
sethi %hh(PRE_Block),%l0
or %l0,%hm(PRE_Block),%l0
@@ -83,9 +103,6 @@ ENTRY(savecontext)
sethi %hi(PRE_Block),%l0
or %l0,%lo(_C_LABEL(PRE_Block)),%l0
#endif
-#else /* AFS_SUN5_ENV */
- set _C_LABEL(PRE_Block), %l0
-#endif
mov 1,%l1
stb %l1, [%l0]
@@ -508,7 +525,6 @@ ENTRY(returnto)
#endif /* __sparcv9 */
/* The following 3 lines are equivalent to: _PRE_Block = 0 */
-#ifdef AFS_SUN5_ENV
#ifdef __sparcv9
sethi %hh(_C_LABEL(PRE_Block)),%l0
or %l0,%hm(_C_LABEL(PRE_Block)),%l0
@@ -520,9 +536,6 @@ ENTRY(returnto)
sethi %hi(_C_LABEL(PRE_Block)),%l0
or %l0,%lo(_C_LABEL(PRE_Block)),%l0
#endif
-#else /* AFS_SUN5_ENV */
- set _C_LABEL(PRE_Block), %l0
-#endif
mov 0,%l1
stb %l1, [%l0]