s390-*-linux*)
AFS_SYSNAME="s390_linuxXX"
;;
+ s390x-*-linux*)
+ AFS_SYSNAME="s390x_linuxXX"
+ ;;
sparc-*-linux*)
AFS_SYSNAME="sparc_linuxXX"
;;
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
+ elif test "${UNAME_MACHINE}" = "s390x"; then
+ echo s390x-ibm-linux && exit 0
elif test "${UNAME_MACHINE}" = "s390"; then
echo s390-ibm-linux && exit 0
elif test "${UNAME_MACHINE}" = "x86_64"; then
#endif
asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
#ifdef EXPORTED_SYS_CALL_TABLE
-#ifdef AFS_SPARC64_LINUX20_ENV
-extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 has syscaltable of 32bit items */
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
+extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 and S390X have syscalltable of 32bit items */
#else
extern void *sys_call_table[]; /* safer for other linuces */
#endif
#else /* EXPORTED_SYS_CALL_TABLE */
-#ifdef AFS_SPARC64_LINUX20_ENV
-static unsigned int *sys_call_table; /* changed to uint because SPARC64 has syscaltable of 32bit items */
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
+static unsigned int *sys_call_table; /* changed to uint because SPARC64 and S390X have syscalltable of 32bit items */
#else
static void **sys_call_table; /* safer for other linuces */
#endif
#endif
+
+#if defined(AFS_S390X_LINUX24_ENV)
+#define _S(x) ((x)<<1)
+#else
+#define _S(x) x
+#endif
+
extern struct file_system_type afs_fs_type;
static long get_page_offset(void);
/* Since sys_ni_syscall is not exported, I need to cache it in order to restore
* it.
*/
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
static unsigned int afs_ni_syscall = 0;
#else
static void *afs_ni_syscall = 0;
__kernel_gid32_t * grouplist);
#endif /* AFS_LINUX24_ENV */
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
#define POINTER2SYSCALL (unsigned int)(unsigned long)
#define SYSCALL2POINTER (void *)(long)
#else
printf("Failed to find address of sys_call_table\n");
} else {
printf("Found sys_call_table at %x\n", sys_call_table);
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
error cant support this yet.;
#endif /* AFS_SPARC64_LINUX20_ENV */
#endif /* EXPORTED_SYS_CALL_TABLE */
/* Initialize pointers to kernel syscalls. */
#if !defined(AFS_LINUX24_ENV)
- sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday];
+ sys_settimeofdayp = SYSCALL2POINTER sys_call_table[_S(__NR_settimeofday)];
#endif /* AFS_IA64_LINUX20_ENV */
/* setup AFS entry point. */
#if defined(AFS_IA64_LINUX20_ENV)
SYSCALL2POINTER sys_call_table[__NR_afs_syscall - 1024]
#else
- SYSCALL2POINTER sys_call_table[__NR_afs_syscall]
+ SYSCALL2POINTER sys_call_table[_S(__NR_afs_syscall)]
#endif
== afs_syscall) {
printf("AFS syscall entry point already in use!\n");
sys_call_table[__NR_afs_syscall - 1024] =
POINTER2SYSCALL((struct fptr *)afs_syscall_stub)->ip;
#else /* AFS_IA64_LINUX20_ENV */
- afs_ni_syscall = sys_call_table[__NR_afs_syscall];
- sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall;
+ afs_ni_syscall = sys_call_table[_S(__NR_afs_syscall)];
+ sys_call_table[_S(__NR_afs_syscall)] = POINTER2SYSCALL afs_syscall;
#ifdef AFS_SPARC64_LINUX20_ENV
afs_ni_syscall32 = sys_call_table32[__NR_afs_syscall];
sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32;
sys_call_table[__NR_setgroups - 1024] =
POINTER2SYSCALL((struct fptr *)afs_xsetgroups_stub)->ip;
#else /* AFS_IA64_LINUX20_ENV */
- sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups];
- sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups;
+ sys_setgroupsp = SYSCALL2POINTER sys_call_table[_S(__NR_setgroups)];
+ sys_call_table[_S(__NR_setgroups)] = POINTER2SYSCALL afs_xsetgroups;
#ifdef AFS_SPARC64_LINUX20_ENV
sys32_setgroupsp = SYSCALL2POINTER sys_call_table32[__NR_setgroups];
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs32_xsetgroups;
POINTER2SYSCALL((struct fptr *)sys_setgroupsp)->ip;
sys_call_table[__NR_afs_syscall - 1024] = afs_ni_syscall;
#else /* AFS_IA64_LINUX20_ENV */
- sys_call_table[__NR_setgroups] = POINTER2SYSCALL sys_setgroupsp;
- sys_call_table[__NR_afs_syscall] = afs_ni_syscall;
+ sys_call_table[_S(__NR_setgroups)] = POINTER2SYSCALL sys_setgroupsp;
+ sys_call_table[_S(__NR_afs_syscall)] = afs_ni_syscall;
# ifdef AFS_SPARC64_LINUX20_ENV
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL sys32_setgroupsp;
sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
*/
#define afs_inode_t ino64_t
#else
-#if defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_S390X_LINUX24_ENV)
#define afs_inode_t long
#else
#if defined(AFS_AIX51_ENV) || defined(AFS_HPUX1123_ENV)
if (current->thread.flags & THREAD_IA32)
#elif defined(AFS_PPC64_LINUX20_ENV)
if (current->thread.flags & PPC_FLAG_32BIT)
+#elif defined(AFS_S390X_LINUX20_ENV)
+ if (current->thread.flags & S390_FLAG_31BIT)
#else
#error Not done for this linux version
#endif
if (current->thread.flags & THREAD_IA32)
#elif defined(AFS_PPC64_LINUX20_ENV)
if (current->thread.flags & PPC_FLAG_32BIT)
+#elif defined(AFS_S390X_LINUX20_ENV)
+ if (current->thread.flags & S390_FLAG_31BIT)
#else
#error Not done for this linux type
#endif
{
static char tbuffer[30];
register char *tp;
- tp = ctime((time_t *) & atime);
+ time_t t = (time_t) atime;
+ tp = ctime(&t);
if (tp) {
strcpy(tbuffer, tp);
tbuffer[24] = 0; /* get rid of new line */
s390_linux22)
CC="gcc"
CCOBJ="gcc"
- LD="gcc"
+ LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
s390_linux24)
CC="gcc"
CCOBJ="gcc"
- LD="gcc"
+ LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
SHLIB_LINKER="${MT_CC} -shared"
;;
+ s390x_linux24)
+ CC="gcc"
+ CCOBJ="gcc"
+ LD="ld"
+ KERN_OPTMZ=-O2
+ LEX="flex -l"
+ MT_CC="$CC"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_LIBS="-lpthread"
+ PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ TXLIBS="-lncurses"
+ XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__"
+ YACC="bison -y"
+ SHLIB_LINKER="${MT_CC} -shared"
+ ;;
+
sgi_62)
PINSTALL_LIBS=-lmld
AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
#define SYS_NAME_ID_s390_linux2 1900
#define SYS_NAME_ID_s390_linux22 1901
#define SYS_NAME_ID_s390_linux24 1902
+#define SYS_NAME_ID_s390x_linux2 1903
+#define SYS_NAME_ID_s390x_linux22 1904
+#define SYS_NAME_ID_s390x_linux24 1905
#define SYS_NAME_ID_alpha_linux_2 2000
#define SYS_NAME_ID_alpha_linux_22 2001
$subdir =~ s|/$||gio;
print "# $dir/$depname\n";
- open(COMPS, "$dir/$depname");
+ open(COMPS, "$depname");
while ( defined($file = <COMPS>) )
{
my ($destdir, $proj_src,$obj_src);
--- /dev/null
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously s390 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define AFS_LINUX20_ENV 1
+#define AFS_LINUX22_ENV 1
+#define AFS_LINUX24_ENV 1
+#define AFS_S390_LINUX20_ENV 1
+#define AFS_S390_LINUX22_ENV 1
+#define AFS_S390_LINUX24_ENV 1
+#define AFS_S390X_LINUX20_ENV 1
+#define AFS_S390X_LINUX22_ENV 1
+#define AFS_S390X_LINUX24_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_ENV 1
+#define AFS_64BITPOINTER_ENV 1
+#define AFS_64BIT_CLIENT 1
+#define AFS_64BIT_KERNEL 1
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+#include <linux/threads.h>
+
+#include <linux/config.h>
+#ifdef CONFIG_SMP
+#undef CONFIG_SMP
+#endif
+/* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+#ifdef AFS_SMP
+#define CONFIG_SMP 1
+#ifndef CONFIG_S390_LOCAL_APIC
+#define CONFIG_S390_LOCAL_APIC 1
+#endif
+#ifndef __SMP__
+#define __SMP__
+#endif
+#define AFS_GLOBAL_SUNLOCK
+#endif
+#if defined(MODULE) && defined(CONFIG_MODVERSIONS)
+#define MODVERSIONS
+#include <linux/modversions.h>
+#endif
+#endif /* __KERNEL__ && !DUMP_KERNEL */
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
+
+/* Machine / Operating system information */
+#define SYS_NAME "s390x_linux24"
+#define SYS_NAME_ID SYS_NAME_ID_s390x_linux24
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#ifdef KERNEL
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+#endif /* KERNEL */
+
+#endif /* AFS_PARAM_H */
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously s390 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define UKERNEL 1 /* user space kernel */
+#define AFS_ENV 1
+#define AFS_USR_LINUX20_ENV 1
+#define AFS_USR_LINUX22_ENV 1
+#define AFS_USR_LINUX24_ENV 1
+#define AFS_S390X_LINUX20_ENV 1
+#define AFS_S390X_LINUX22_ENV 1
+#define AFS_S390X_LINUX24_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
+#define AFS_64BITPOINTER_ENV 1
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME "s390x_linux24"
+#define SYS_NAME_ID SYS_NAME_ID_s390x_linux24
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS 1
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif /* AFS_PARAM_H */
+
+#endif /* !defined(UKERNEL) */
*/
/* XXX shouldn't this be !AFS_64BIT_ENV ? */
-#if !defined(cray) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) && !defined(AFS_PPC64_LINUX20_ENV)
+#if !defined(cray) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) && !defined(AFS_PPC64_LINUX20_ENV) & !defined(AFS_S390X_LINUX20_ENV)
#define LONG_IS_32_BITS
#endif
if (as->parms[3].items)
sscanf(as->parms[3].items->data, "%d", &kvno);
-#ifdef AFS_S390_LINUX20_ENV
+#if defined(AFS_S390_LINUX20_ENV) && !defined(AFS_S390X_LINUX20_ENV)
code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, 0, key);
#else
code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, key);
afs_int32 code;
LOCK_GLOBAL_MUTEX
-#ifdef AFS_S390_LINUX20_ENV
+#if defined(AFS_S390_LINUX20_ENV) && !defined(AFS_S390X_LINUX20_ENV)
code =
ubik_Call_New(KAM_SetPassword, conn, 0, name, instance, 0, 0,
*newkey);
CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char
DEFINES = $(COMMON_DEFINES) -D__s390__
+<s390x_linux22 s390x_linux24>
+CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char
+DEFINES = $(COMMON_DEFINES) -D__s390x__
+
<sparc_linux22 sparc_linux24>
LD = ld -m elf32_sparc
CCFLAGS = $(COMMON_KERN_CFLAGS) -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
<s390_linux22 s390_linux24>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
+<s390x_linux22 s390x_linux24>
+ ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
<ppc_linux22 ppc_linux24>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
<ppc64_linux24>
$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} -KPIC -G0 ${srcdir}/process.s;; \
sgi_61 | sgi_62 | sgi_63 ) \
$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} -KPIC -G0 ${srcdir}/process.s;; \
- s390*) \
- /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s >process.ss; \
+ s390_*) \
+ /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
+ ${AS} -ahlns process.ss -o process.o >process.lst; \
+ $(RM) process.ss ;; \
+ s390x_*) \
+ /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
${AS} -ahlns process.ss -o process.o >process.lst; \
$(RM) process.ss ;; \
*_darwin* ) \
#define MINFRAME 128
#define STACK_ALIGN 8
#else
+#ifdef __s390x__
+#define MINFRAME 160
+#define STACK_ALIGN 8
+#else
#ifdef __s390__
#define MINFRAME 96
#define STACK_ALIGN 8
#define STACK_ALIGN 4
#endif
#endif
+#endif
/* Debugging macro */
#ifdef DEBUG
.extern PRE_Block[ua]
#endif /* RIOS */
-#if defined(AFS_S390_LINUX20_ENV)
- /* Linux for S/390 (31 bit)
- *
- * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
- *
- * additional munging by Adam Thornton <adam@sinenomine.net>
- */
- .file "process.s"
-
- .globl savecontext
- .type savecontext,%function
- /*
- * savecontext(f, area1, newsp)
- * int (*f)(); struct savearea *area1; char *newsp;
- * f - r2
- * area1 - r3
- * newsp - r4
- */
-
- /*
- * struct savearea {
- * char *topstack;
- * }
- */
-
-P_PRE: .long PRE_Block
-P_ABORT: .long abort
-
-savecontext:
- stm %r6,%r15,24(%r15) /* Save our registers */
- lr %r1,%r15
- ahi %r15,-96 /* Move out of harm's way */
- st %r1,0(%r15)
- bras %r5,.L0 /* Get A(A(PRE_Block)) */
- .long PRE_Block
- .L0:
- l %r5,0(%r5) /* Get A(PRE_Block) */
- mvi 3(%r5),1 /* Set it */
- lr %r6,%r3 /* Get base of savearea */
- st %r15,0(%r3) /* Save stack pointer */
- ltr %r4,%r4 /* If new sp is 0 */
- jz .L1 /* ... don't change sp */
- lr %r15,%r4 /* Set new stack pointer */
- .L1:
- br %r2 /* Call the routine */
- /* Can't get here....*/
-
- bras %r5,.L2
- .long abort
- .L2:
- l %r5,0(%r5)
- balr %r14,%r5
-
- .savecontext_end:
- .size savecontext,.savecontext_end-savecontext
-
- /*
- * returnto(area2)
- * struct savearea *area2;
- *
- * area2 - r2
- */
- .globl returnto
- .type returnto,%function
-returnto:
- l %r15,0(%r2) /* New frame, to get correct pointer*/
- bras %r5,.L3 /* Get A(A(PRE_Block))
- */
- .long PRE_Block
- .L3:
- l %r5,0(%r5) /* Get A(PRE_Block) */
- /*xc 0(4,%r5),0(%r5) /* Clear it */
- mvi 3(%r5),0 /* Clear it */
- l %r15,0(%r15)
- lm %r6,%r15,24(%r15) /* Restore registers */
- br %r14 /* Return */
-
- /* Can't happen */
- la %r2,1234
- bras %r5,.L4
- .long abort
- .L4:
- l %r5,0(%r5)
- basr %r14,%r5
- .returnto_end:
- .size returnto,.returnto_end-returnto
-#endif /* AFS_S390_LINUX20_ENV */
#ifdef mc68000
/*
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Linux for S/390 (31 bit)
+ *
+ * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+ *
+ * additional munging by Adam Thornton <adam@sinenomine.net>
+ */
+
+#define IGNORE_STDS_H 1
+#include <afs/param.h>
+
+ .file "process.s"
+
+ .globl savecontext
+ .type savecontext,%function
+ /*
+ * savecontext(f, area1, newsp)
+ * int (*f)(); struct savearea *area1; char *newsp;
+ * f - r2
+ * area1 - r3
+ * newsp - r4
+ */
+
+ /*
+ * struct savearea {
+ * char *topstack;
+ * }
+ */
+
+P_PRE: .long PRE_Block
+P_ABORT: .long abort
+
+savecontext:
+ stm %r6,%r15,24(%r15) /* Save our registers */
+ lr %r1,%r15
+ ahi %r15,-96 /* Move out of harm's way */
+ st %r1,0(%r15)
+ bras %r5,.L0 /* Get A(A(PRE_Block)) */
+ .long PRE_Block
+ .L0:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ mvi 3(%r5),1 /* Set it */
+ lr %r6,%r3 /* Get base of savearea */
+ st %r15,0(%r3) /* Save stack pointer */
+ ltr %r4,%r4 /* If new sp is 0 */
+ jz .L1 /* ... don't change sp */
+ lr %r15,%r4 /* Set new stack pointer */
+ .L1:
+ br %r2 /* Call the routine */
+ /* Can't get here....*/
+
+ bras %r5,.L2
+ .long abort
+ .L2:
+ l %r5,0(%r5)
+ balr %r14,%r5
+
+ .savecontext_end:
+ .size savecontext,.savecontext_end-savecontext
+
+ /*
+ * returnto(area2)
+ * struct savearea *area2;
+ *
+ * area2 - r2
+ */
+ .globl returnto
+ .type returnto,%function
+returnto:
+ l %r15,0(%r2) /* New frame, to get correct pointer*/
+ bras %r5,.L3 /* Get A(A(PRE_Block))
+ */
+ .long PRE_Block
+ .L3:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ /*xc 0(4,%r5),0(%r5) /* Clear it */
+ mvi 3(%r5),0 /* Clear it */
+ l %r15,0(%r15)
+ lm %r6,%r15,24(%r15) /* Restore registers */
+ br %r14 /* Return */
+
+ /* Can't happen */
+ la %r2,1234
+ bras %r5,.L4
+ .long abort
+ .L4:
+ l %r5,0(%r5)
+ basr %r14,%r5
+ .returnto_end:
+ .size returnto,.returnto_end-returnto
+
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Linux for S/390X (64 bit)
+ * by Soewono Effendi <Soewono.Effendi@sysgo.de>
+ * & Horst Birthelmer <Horst.Birthelmer@sysgo.de>
+ *
+ * based on Linux for S/390 (31 bit)
+ * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+*/
+
+#define IGNORE_STDS_H 1
+#include <afs/param.h>
+
+ .file "process.s"
+
+ .globl savecontext
+ .type savecontext,%function
+ /*
+ * savecontext(f, area1, newsp)
+ * int (*f)(); struct savearea *area1; char *newsp;
+ * f - r2
+ * area1 - r3
+ * newsp - r4
+ */
+
+ /*
+ * struct savearea {
+ * char *topstack;
+ * }
+ */
+
+P_PRE: .long PRE_Block
+P_ABORT: .long abort
+
+savecontext:
+ stmg %r6,%r15,48(%r15) /* Save our registers */
+ lgr %r1,%r15
+ aghi %r15,-160
+ stg %r1,0(%r15)
+ brasl %r5,.L0 /* Get A(A(PRE_Block)) */
+ .long PRE_Block
+ .L0:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ mvi 3(%r5),1 /* Set it */
+ lgr %r6,%r3 /* Get base of savearea */
+ stg %r15,0(%r3) /* Save stack pointer */
+ ltgr %r4,%r4 /* If new sp is 0 */
+ jz .L1 /* ... don't change sp */
+ lgr %r15,%r4 /* Set new stack pointer */
+ .L1:
+ br %r2 /* Call the routine */
+ /* Can't get here....*/
+
+ brasl %r5,.L2
+ .long abort
+ .L2:
+ l %r5,0(%r5)
+ balr %r14,%r5
+
+ .savecontext_end:
+ .size savecontext,.savecontext_end-savecontext
+
+ /*
+ * returnto(area2)
+ * struct savearea *area2;
+ *
+ * area2 - r2
+ */
+ .globl returnto
+ .type returnto,%function
+returnto:
+ lg %r15,0(%r2) /* New frame, to get correct pointer*/
+ brasl %r5,.L3 /* Get A(A(PRE_Block)) */
+ .long PRE_Block
+ .L3:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ /*xc 0(4,%r5),0(%r5) /* Clear it */
+ mvi 3(%r5),0 /* Clear it */
+ lg %r15,0(%r15)
+ lmg %r6,%r15,48(%r15) /* Restore registers */
+ br %r14 /* Return */
+
+ /* Can't happen */
+ la %r2,1234
+ brasl %r5,.L4
+ .long abort
+ .L4:
+ l %r5,0(%r5)
+ basr %r14,%r5
+ .returnto_end:
+ .size returnto,.returnto_end-returnto
+