]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-arm-linux-20080115
authorDerrick Brashear <shadow@dementia.org>
Tue, 15 Jan 2008 14:11:18 +0000 (14:11 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 15 Jan 2008 14:11:18 +0000 (14:11 +0000)
LICENSE IPL10

make an arm linux port.

(cherry picked from commit 08d71812fed3cc9f37d516d8f5d5b4ba9ccfb032)

src/cf/osconf.m4
src/config/afs_sysnames.h
src/config/param.arm_linux24.h [new file with mode: 0644]
src/config/param.arm_linux26.h [new file with mode: 0644]
src/des/andrew-conf.h
src/des/conf-arm-linux.h [new file with mode: 0644]
src/lwp/lwp.c
src/lwp/process.s

index d6e9d18d81820af6c2a94361efa2129caf786ea6..f3d6c8895db526f3a94e1f6fc67f41db7ad1bcc5 100644 (file)
@@ -113,6 +113,38 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${MT_CC} -shared"
                ;;
 
+       arm_linux24)
+               CCOBJ="${CC} -fPIC"
+               KERN_OPTMZ=-O2
+               LEX="flex -l"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+               MT_LIBS="-lpthread"
+               PAM_OPTMZ=-O2
+               PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_CFLAGS="-fPIC"
+               SHLIB_LDFLAGS="-shared -Xlinker -x"
+               TXLIBS="-lncurses"
+               XCFLAGS="-D_LARGEFILE64_SOURCE"
+               YACC="bison -y"
+               SHLIB_LINKER="${MT_CC} -shared"
+               ;;
+
+       arm_linux26)
+               CCOBJ="${CC} -fPIC"
+               KERN_OPTMZ=-O2
+               LEX="flex -l"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+               MT_LIBS="-lpthread"
+               PAM_OPTMZ=-O2
+               PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_CFLAGS="-fPIC"
+               SHLIB_LDFLAGS="-shared -Xlinker -x"
+               TXLIBS="-lncurses"
+               XCFLAGS="-D_LARGEFILE64_SOURCE"
+               YACC="bison -y"
+               SHLIB_LINKER="${MT_CC} -shared"
+               ;;
+
        hp_ux102)
                AS="/usr/ccs/bin/as"
                CC="/opt/ansic/bin/cc -Ae"
index a7bc83d30a189e556d617abb56e5fe7644adca43..4fdeac5e2be90175c0e5837994b319aa1a29c0ab 100644 (file)
 
 #define SYS_NAME_ID_i64_w2k             3500
 
+#define SYS_NAME_ID_arm_linux2          3800
+#define SYS_NAME_ID_arm_linux22         3801
+#define SYS_NAME_ID_arm_linux24         3802
+#define SYS_NAME_ID_arm_linux26         3803
+
 /*
  * Placeholder to keep system-wide standard flags since this file is included by all 
  * files (i.e in afs/param.h)
diff --git a/src/config/param.arm_linux24.h b/src/config/param.arm_linux24.h
new file mode 100644 (file)
index 0000000..83f85a8
--- /dev/null
@@ -0,0 +1,146 @@
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+#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 arm 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_ARM_LINUX20_ENV   1
+#define AFS_ARM_LINUX22_ENV   1
+#define AFS_ARM_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_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1    /* User space interface to file system */
+#define AFS_64BIT_ENV          1
+#define AFS_64BIT_CLIENT       1
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+
+#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 __SMP__
+#define __SMP__
+#endif
+#endif
+#define AFS_GLOBAL_SUNLOCK
+
+#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       1
+
+#define AFSLITTLE_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 AFS_USE_GETTIMEOFDAY       1   /* use gettimeofday to implement rx clock */
+
+#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 */
+
+#ifndef KERNEL
+#define __USE_LARGEFILE64 1
+#if !defined off64_t
+#define off64_t __off64_t
+#endif
+#endif
+
+/* Machine / Operating system information */
+#define SYS_NAME       "arm_linux24"
+#define SYS_NAME_ID    SYS_NAME_ID_arm_linux24
+
+#endif /* AFS_PARAM_H */
+
+
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+#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 arm 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_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#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       "arm_linux24"
+#define SYS_NAME_ID    SYS_NAME_ID_arm_linux24
+#define AFSLITTLE_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) */
diff --git a/src/config/param.arm_linux26.h b/src/config/param.arm_linux26.h
new file mode 100644 (file)
index 0000000..1444821
--- /dev/null
@@ -0,0 +1,153 @@
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+#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 arm 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_LINUX26_ENV        1
+#define AFS_ARM_LINUX20_ENV   1
+#define AFS_ARM_LINUX22_ENV   1
+#define AFS_ARM_LINUX24_ENV   1
+#define AFS_ARM_LINUX26_ENV   1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1    /* User space interface to file system */
+#define AFS_64BIT_ENV          1
+#define AFS_64BIT_CLIENT       1
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+
+#ifdef CONFIG_SMP
+#ifndef AFS_SMP
+#define AFS_SMP 1
+#endif
+#endif
+/* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+#ifdef AFS_SMP
+#ifndef CONFIG_SMP
+#define CONFIG_SMP 1
+#endif
+#ifndef __SMP__
+#define __SMP__
+#endif
+#endif
+#define AFS_GLOBAL_SUNLOCK
+
+#endif /* __KERNEL__  && !DUMP_KERNEL */
+
+#include <afs/afs_sysnames.h>
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS       1
+
+#define AFSLITTLE_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 AFS_USE_GETTIMEOFDAY       1   /* use gettimeofday to implement rx clock */
+
+#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 */
+
+#ifndef KERNEL
+#define __USE_LARGEFILE64 1
+#if !defined off64_t
+#define off64_t __off64_t
+#endif
+#endif
+
+/* Machine / Operating system information */
+#define SYS_NAME       "arm_linux26"
+#define SYS_NAME_ID    SYS_NAME_ID_arm_linux26
+
+#ifdef __GLIBC__
+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3)
+#define USE_UCONTEXT
+#endif
+#endif
+#endif /* AFS_PARAM_H */
+
+
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+#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 arm 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_USR_LINUX26_ENV    1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#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       "arm_linux26"
+#define SYS_NAME_ID    SYS_NAME_ID_arm_linux26
+#define AFSLITTLE_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 f9e5bfd15fe7a1c411290ddc1f9eb92bbd1a7bb5..6b64c251b8506ed671e8fd0adf008bf1f6ee7c4a 100644 (file)
 #ifdef AFS_PPC64_LINUX20_ENV
 #include "conf-ppc64-linux.h"
 #else
+#ifdef AFS_ARM_LINUX20_ENV
+#include "conf-arm-linux.h"
+#else
 #include "conf-i386-linux.h"
+#endif /* AFS_ARM_LINUX20_ENV */
 #endif /* AFS_PPC64_LINUX20_ENV */
 #endif /* AFS_AMD64_LINUX20_ENV */
 #endif /* AFS_IA64_LINUX20_ENV */
diff --git a/src/des/conf-arm-linux.h b/src/des/conf-arm-linux.h
new file mode 100644 (file)
index 0000000..66f80b6
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Machine-type definitions: Linux on Intel
+ */
+
+#include <mit-cpyright.h>
+
+#define BITS32
+#define BIG
+#define LSBFIRST
index 136a7558961a4d0ee94b7e494f9a850a1e2f31c9..7df9f099a1d359d24e96ea1658c253ee76f92eea 100644 (file)
@@ -47,11 +47,13 @@ extern char *getenv();
 extern void *malloc(int size);
 extern void *realloc(void *ptr, int size);
 #endif
+#ifndef AFS_ARM_LINUX20_ENV
 #if defined(AFS_OSF_ENV) || defined(AFS_S390_LINUX20_ENV)
 extern int PRE_Block;          /* from preempt.c */
 #else
 extern char PRE_Block;         /* from preempt.c */
 #endif
+#endif
 
 #define ON             1
 #define OFF            0
@@ -367,11 +369,13 @@ LWP_CreateProcess(int (*ep) (), int stacksize, int priority, void *parm,
        Initialize_PCB(temp, priority, stackmemory, stacksize, ep, parm, name);
        insert(temp, &runnable[priority]);
        temp2 = lwp_cpptr;
+#ifndef AFS_ARM_LINUX20_ENV
        if (PRE_Block != 0)
            Abort_LWP("PRE_Block not 0");
 
        /* Gross hack: beware! */
        PRE_Block = 1;
+#endif
        lwp_cpptr = temp;
 #if defined(AFS_PARISC_LINUX24_ENV)
        savecontext(Create_Process_Part2, &temp2->context,
@@ -460,11 +464,13 @@ LWP_CreateProcess2(int (*ep) (), int stacksize, int priority, void *parm,
        Initialize_PCB(temp, priority, stackptr, stacksize, ep, parm, name);
        insert(temp, &runnable[priority]);
        temp2 = lwp_cpptr;
+#ifndef AFS_ARM_LINUX20_ENV
        if (PRE_Block != 0)
            Abort_LWP("PRE_Block not 0");
 
        /* Gross hack: beware! */
        PRE_Block = 1;
+#endif
        lwp_cpptr = temp;
        savecontext(Create_Process_Part2, &temp2->context,
                    stackptr + stacksize - sizeof(void *));
@@ -956,8 +962,10 @@ Dispatcher(void)
        printf("Dispatch %d [PCB at 0x%x] \"%s\"\n", ++dispatch_count,
               runnable[i].head, runnable[i].head->name);
 #endif
+#ifndef AFS_ARM_LINUX20_ENV
     if (PRE_Block != 1)
        Abort_LWP("PRE_Block not 1");
+#endif
     lwp_cpptr = runnable[i].head;
 
     returnto(&lwp_cpptr->context);
index 586c2723524872430eebfa34b6e374178432ef09..ed3c173e0d231a7ae2448afb838b15ef27d36352 100644 (file)
 #include <afs/param.h>
 /*#endif /* AFS_DJGPP_ENV */
 
-#if defined(RIOS)
+#if defined(__arm32__) || defined(__arm__)
+       /* register definitions */
+       fp      .req    r11
+       ip      .req    r12
+       sp      .req    r13
+       lp      .req    r14
+       pc      .req    r15
+       
+       /*
+          savecontext(f, area1, newsp)
+               int (*f)()#if defined(RIOS);
+               struct savearea *area1;
+               char *newsp;
+       */
+
+       /* Arguments appear as:    f in r0, area1 in r1, newsp in r2 */
+
+       .text
+       .align  0
+       .globl  savecontext
+       .type   savecontext, #function
+savecontext:
+       @ build the frame
+       mov     ip, sp
+       stmfd   sp!, {fp, ip, lr, pc}
+       sub     fp, ip, #4
+       @ stack r0 - r10, current fp
+       stmfd   sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
+       str     sp, [r1, #0]
+       @ check if newsp is zero
+       movs    r2, r2
+       movne   sp, r2
+       @ call function ...
+       mov     pc, r0
+
+       /*      should never get here ... */
+       /*      bl      EXT(abort) */
+
+       /*
+         returnto(area2)
+            struct savearea *area2;
+       */
+
+       /* area2 is in r0. */
+
+       .globl returnto
+       .type  returnto, #function
+returnto:
+       @ restore r0-r10, fp
+       ldr     r0, [r0, #0]
+       ldmfd   r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
+       @ return from function call
+       ldmea   fp, {fp, sp, pc}
 
+#endif /* __arm32__ or __arm__ */
+
+#if defined(RIOS)
 /*                 I don't know if we have to save the TOC (R2) or not...
  *                Note that stack-frame is supposed to be aligned on 
  *                a double-word boundary.