s390x-20040811
authorSven Oehme <oehmes@de.ibm.com>
Wed, 11 Aug 2004 16:45:35 +0000 (16:45 +0000)
committerJim Rees <rees@umich.edu>
Wed, 11 Aug 2004 16:45:35 +0000 (16:45 +0000)
zLinux on S390x (64 bit S390)

20 files changed:
acinclude.m4
config.guess
src/afs/LINUX/osi_module.c
src/afs/afs.h
src/afs/afs_call.c
src/afs/afs_pioctl.c
src/bozo/bos.c
src/cf/osconf.m4
src/config/afs_sysnames.h
src/config/make_libafs_tree.pl
src/config/param.s390x_linux24.h [new file with mode: 0644]
src/des/crypt.c
src/kauth/admin_tools.c
src/kauth/authclient.c
src/libafs/MakefileProto.LINUX.in
src/lwp/Makefile.in
src/lwp/lwp.c
src/lwp/process.s
src/lwp/process.s390.s [new file with mode: 0644]
src/lwp/process.s390x.s [new file with mode: 0644]

index 0f7b78a..0aa601a 100644 (file)
@@ -591,6 +591,9 @@ else
                s390-*-linux*)
                        AFS_SYSNAME="s390_linuxXX"
                        ;;
+               s390x-*-linux*)
+                       AFS_SYSNAME="s390x_linuxXX"
+                       ;;
                sparc-*-linux*)
                        AFS_SYSNAME="sparc_linuxXX"
                        ;;
index 265ea69..18d6514 100755 (executable)
@@ -856,6 +856,8 @@ EOF
 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
index f864a0c..dba52d5 100644 (file)
@@ -47,18 +47,25 @@ asmlinkage int (*sys_settimeofdayp) (struct timeval * tv,
 #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);
@@ -76,7 +83,7 @@ unsigned long afs_linux_page_offset = 0;      /* contains the PAGE_OFFSET value */
 /* 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;
@@ -208,7 +215,7 @@ asmlinkage int (*sys_setgroups32p) (int gidsetsize,
                                    __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
@@ -365,7 +372,7 @@ init_module(void)
        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 */
@@ -435,7 +442,7 @@ init_module(void)
 
        /* 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. */
@@ -443,7 +450,7 @@ init_module(void)
 #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");
@@ -454,8 +461,8 @@ init_module(void)
        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;
@@ -486,8 +493,8 @@ init_module(void)
     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;
@@ -548,8 +555,8 @@ cleanup_module(void)
        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;
index 49f2c40..11e4843 100644 (file)
@@ -900,7 +900,7 @@ struct afs_fheader {
  */
 #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)
index 2d5e674..6b1eeeb 100644 (file)
@@ -1148,6 +1148,8 @@ copyin_iparam(caddr_t cmarg, struct iparam *dst)
     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
index 8f4b939..8ab51ac 100644 (file)
@@ -269,6 +269,8 @@ copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst)
     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
index 7d3c837..d5ced10 100644 (file)
@@ -145,7 +145,8 @@ DateOf(atime)
 {
     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 */
index 8d63731..ac12969 100644 (file)
@@ -439,7 +439,7 @@ case $AFS_SYSNAME in
        s390_linux22)
                CC="gcc"
                CCOBJ="gcc"
-               LD="gcc"
+               LD="ld"
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CC="$CC"
@@ -456,7 +456,7 @@ case $AFS_SYSNAME in
        s390_linux24)
                CC="gcc"
                CCOBJ="gcc"
-               LD="gcc"
+               LD="ld"
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CC="$CC"
@@ -470,6 +470,23 @@ case $AFS_SYSNAME in
                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"
index e6ae7eb..db042c3 100644 (file)
 #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
index 0e27934..dcd08eb 100755 (executable)
@@ -96,7 +96,7 @@ sub process_libafsdep
        $subdir =~ s|/$||gio;
 
        print "# $dir/$depname\n";
-       open(COMPS, "$dir/$depname");
+       open(COMPS, "$depname");
        while ( defined($file = <COMPS>) )
        {
                my ($destdir, $proj_src,$obj_src);
diff --git a/src/config/param.s390x_linux24.h b/src/config/param.s390x_linux24.h
new file mode 100644 (file)
index 0000000..ed19421
--- /dev/null
@@ -0,0 +1,169 @@
+#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) */
index 54dfa6b..a17c2a7 100644 (file)
@@ -91,7 +91,7 @@ RCSID
  */
 
 /* 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
 
index 3012a7f..4e9b4c2 100644 (file)
@@ -818,7 +818,7 @@ SetPassword(struct cmd_syndesc *as, char *arock)
     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);
index 3811848..2a06ed6 100644 (file)
@@ -749,7 +749,7 @@ ka_ChangePassword(char *name, char *instance, struct ubik_client * conn,    /* Ubik
     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);
index e828750..3527948 100644 (file)
@@ -61,6 +61,10 @@ DEFINES = $(COMMON_DEFINES)
 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
@@ -152,6 +156,8 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        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>
index 0f39cc1..2fc0097 100644 (file)
@@ -44,8 +44,12 @@ process.o    : process.s process.i386.s process.c
                $(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* ) \
index 265ed8c..06e3e1b 100644 (file)
@@ -73,6 +73,10 @@ extern char PRE_Block;               /* from preempt.c */
 #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
@@ -80,6 +84,7 @@ extern char PRE_Block;                /* from preempt.c */
 #define STACK_ALIGN 4
 #endif
 #endif
+#endif
 
 /* Debugging macro */
 #ifdef DEBUG
index 223f215..586c272 100644 (file)
@@ -167,93 +167,6 @@ PRE_Block.S:
        .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
 /*
diff --git a/src/lwp/process.s390.s b/src/lwp/process.s390.s
new file mode 100644 (file)
index 0000000..660ec1f
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * 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
+
diff --git a/src/lwp/process.s390x.s b/src/lwp/process.s390x.s
new file mode 100644 (file)
index 0000000..e36b7ca
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * 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
+