]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
introduce-linux-ia64-port-20010806
authorChas Williams <chas@cmf.nrl.navy.mil>
Tue, 7 Aug 2001 01:11:25 +0000 (01:11 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 7 Aug 2001 01:11:25 +0000 (01:11 +0000)
"no special instructions this time other than you need a rather recent
glibc (turbolinux beta5 or redhat 7.1) since the afs userland utilities
use ucontext() instead of setjmp()/longjmp().  this is probably the weakest
part of the port since lwp is somewhat difficult to test rigorously.

you can insmod the afs module now (and rmmod if you like)  why so difficult?
function pointers are really pointers to a function descriptor that contains
the function pointer and global pointer.  the syscall table (being written
in assembler) only contains function pointers.  it doesnt setup the gp.
modules and kernels do not share the same gp.  so if you want the syscall
to go to a module, you need to setup the gp and then call your module's
routine.  be sure to restore the gp after returning from your routine :)
i also converted to the 'new style' module_init() -- only used on kernel
versions 2.4.0 and up.  this does the right thing if you happen to be
linked directly with the kernel.

klog has been fixed (afs's crypt() function is sensitive to sizeof(long) --
des/crypt.c should probably use 'afs_int32', not 'long' or 'int')

in case it matters, my platform is a b3-stepping running beta5 of turbolinux."

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

don't leak into not ia64 port

18 files changed:
configure.in
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_groups.c
src/afs/LINUX/osi_machdep.h
src/afs/LINUX/osi_module.c
src/afs/afs_call.c
src/afs/afs_pioctl.c
src/config/afs_sysnames.h
src/config/param.ia64_linux24.h [new file with mode: 0644]
src/config/param.ia64_linux24_usr.h [new file with mode: 0644]
src/des/andrew-conf.h
src/des/conf-ia64-linux.h [new file with mode: 0644]
src/des/crypt.c
src/dir/buffer.c
src/libafs/MakefileProto.LINUX.in
src/lwp/lwp.h
src/lwp/process.c
src/rx/rx.h

index d1c7213a14fb44994d178fb01ff35db042af7f1b..2bd0aa6a31eb19ef36b34a40a163e947354f8169 100644 (file)
@@ -215,6 +215,9 @@ else
                mips-sgi-irix6.5)
                        AFS_SYSNAME="sgi_65"
                        ;;
+               ia64-*-linux*)
+                       AFS_SYSNAME="ia64_linuxXX"
+                       ;;
                powerpc-*-linux*)
                        AFS_SYSNAME="ppc_linuxXX"
                        ;;
index 043c151f1ab5e60d244affedd5fdeb8950166630..9169ed624d4a7c723f5adeb4538923c399b3c035 100644 (file)
@@ -19,6 +19,7 @@ RCSID("$Header$");
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
 #include "../h/mm.h"
+#include "../h/slab.h"
 
 #include "../afs/afs_atomlist.h"
 #include "../afs/afs_lhash.h"
@@ -86,7 +87,7 @@ static void *linux_alloc(unsigned int asize)
 
     /*  if we can use kmalloc use it to allocate the required memory. */
     if (asize <  MAX_KMALLOC_SIZE) {
-        new = (void *)(long)kmalloc(asize, GFP_KERNEL);
+        new = (void *)(unsigned long)kmalloc(asize, GFP_KERNEL);
         if (new) /* piggy back alloc type */
             (unsigned long)new |= KM_TYPE;
     }
index b7cbe1f792da3f9c17ac37b13bcf542a08ef784a..bd6f6952995a9716a514bcbbef16fce971da692b 100644 (file)
@@ -100,8 +100,8 @@ int setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, int change_pare
 
 
 /* Intercept the standard system call. */
-extern int (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
-asmlinkage int afs_xsetgroups(int gidsetsize, gid_t *grouplist)
+extern long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
+asmlinkage long afs_xsetgroups(int gidsetsize, gid_t *grouplist)
 {
     int code;
     cred_t *cr = crref();
index 6640fbe33c3ff099cabe34c5e9986c3fcdadb427..22fa1dd71ac12111b61c26323e35b83b65ae3757 100644 (file)
@@ -31,7 +31,7 @@
 #include "../h/sched.h"
 #define osi_Time() (xtime.tv_sec)
 #if  (CPU == sparc64)
-#define osi_GetTime(V) do { (*##V##).tv_sec = xtime.tv_sec; (*##V##).tv_usec = xtime.tv_usec; } while (0)
+#define osi_GetTime(V) do { (*(V)).tv_sec = xtime.tv_sec; (*(V)).tv_usec = xtime.tv_usec; } while (0)
 #else
 #define osi_GetTime(V) (*(V)=xtime)
 #endif
index a9afd97f999f9ca8287fe2f21e8f12b994e54d42..c3e0194abb34e28fc0395f439ef361fdc2b17afc 100644 (file)
@@ -22,6 +22,11 @@ RCSID("$Header$");
 #include "../h/mm.h"
 
 #include <linux/module.h>
+#include <linux/slab.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#include <linux/init.h>
+#endif
+
 
 
 #ifdef AFS_SPARC64_LINUX24_ENV
@@ -33,7 +38,7 @@ asmlinkage int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz);
 asmlinkage int (*sys_socketcallp)(int call, long *args);
 #endif /* no socketcall on alpha */
 asmlinkage int (*sys_killp)(int pid, int signal);
-asmlinkage int (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
+asmlinkage long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
 
 #ifdef AFS_SPARC64_LINUX20_ENV
 extern unsigned int sys_call_table[];  /* changed to uint because SPARC64 has syscaltable of 32bit items */
@@ -83,6 +88,63 @@ __asm__ __volatile__ ("
 }
 #endif
 
+#ifdef AFS_IA64_LINUX20_ENV
+unsigned char ia64_syscall_stub[] =
+{
+  0x00, 0x50, 0x45, 0x16, 0x80, 0x05,   //  [MII]  alloc r42=ar.pfs,8,3,6,0
+  0x90, 0x02, 0x00, 0x62, 0x00, 0x60,   //         mov r41=b0
+  0x05, 0x00, 0x01, 0x84,               //         mov r43=r32
+  0x00, 0x60, 0x01, 0x42, 0x00, 0x21,   //  [MII]  mov r44=r33
+  0xd0, 0x02, 0x88, 0x00, 0x42, 0xc0,   //         mov r45=r34
+  0x05, 0x18, 0x01, 0x84,               //         mov r46=r35
+  0x0d, 0x78, 0x01, 0x48, 0x00, 0x21,   //  [MFI]  mov r47=r36
+  0x00, 0x00, 0x00, 0x02, 0x00, 0x00,   //         nop.f 0x0
+  0x06, 0x08, 0x00, 0x84,               //         mov r48=gp;;
+  0x05, 0x00, 0x00, 0x00, 0x01, 0x00,   //  [MLX]  nop.m 0x0
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,   //         movl r15=0x0;;
+  0x01, 0x00, 0x00, 0x60,               //
+  0x0a, 0x80, 0x20, 0x1e, 0x18, 0x14,   //  [MMI]  ld8 r16=[r15],8;;
+  0x10, 0x00, 0x3c, 0x30, 0x20, 0xc0,   //         ld8 gp=[r15]
+  0x00, 0x09, 0x00, 0x07,               //         mov b6=r16
+  0x1d, 0x00, 0x00, 0x00, 0x01, 0x00,   //  [MFB]  nop.m 0x0
+  0x00, 0x00, 0x00, 0x02, 0x00, 0x00,   //         nop.f 0x0
+  0x68, 0x00, 0x00, 0x10,               //         br.call.sptk.many b0=b6;;
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00,   //  [MII]  nop.m 0x0
+  0x00, 0x50, 0x01, 0x55, 0x00, 0x00,   //         mov.i ar.pfs=r42
+  0x90, 0x0a, 0x00, 0x07,               //         mov b0=r41
+  0x1d, 0x08, 0x00, 0x60, 0x00, 0x21,   //  [MFB]  mov gp=r48
+  0x00, 0x00, 0x00, 0x02, 0x00, 0x80,   //         nop.f 0x0
+  0x08, 0x00, 0x84, 0x00                //         br.ret.sptk.many b0;;
+};
+
+void ia64_imm64_fixup(unsigned long v, void *code)
+{
+        unsigned long *bundle = (unsigned long *) code;
+
+        unsigned long insn;
+        unsigned long slot1;
+
+        insn = ((v & 0x8000000000000000) >> 27) | ((v & 0x0000000000200000)) |
+           ((v & 0x00000000001f0000) <<  6) | ((v & 0x000000000000ff80) << 20) |
+           ((v & 0x000000000000007f) << 13);
+
+        slot1 = (v & 0x7fffffffffc00000) >> 22;
+
+        *bundle |= slot1 << 46;
+        *(bundle+1) |= insn << 23;
+        *(bundle+1) |= slot1 >> 18;
+}
+
+unsigned char *afs_syscall_stub, *afs_xsetgroups_stub;
+
+struct fptr
+{
+       unsigned long ip;
+       unsigned long gp;
+};
+
+#endif /* AFS_IA64_LINUX20_ENV */
+
 #ifdef AFS_LINUX24_ENV
 asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist);
 #endif 
@@ -95,10 +157,18 @@ asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist);
 #define SYSCALL2POINTER (void *)
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+int __init afs_init(void)
+#else
 int init_module(void)
+#endif
 {
+#if defined(AFS_IA64_LINUX20_ENV)
+    unsigned long kernel_gp;
+    static struct fptr sys_kill, sys_settimeofday, sys_setgroups;
+#endif
     extern int afs_syscall();
-    extern int afs_xsetgroups();
+    extern long afs_xsetgroups();
 #if defined(__NR_setgroups32)
     extern int afs_xsetgroups32();
 #endif
@@ -109,6 +179,8 @@ int init_module(void)
 #endif
 #endif
 
+
+
     /* obtain PAGE_OFFSET value */
     afs_linux_page_offset = get_page_offset();
 
@@ -121,64 +193,117 @@ int init_module(void)
 #endif
 
     /* Initialize pointers to kernel syscalls. */
+#if defined(AFS_IA64_LINUX20_ENV)
+    kernel_gp = ((struct fptr *)printk)->gp;
+
+    sys_settimeofdayp = (void *) &sys_settimeofday;
+    sys_killp = (void *) &sys_kill;
+
+    ((struct fptr *)sys_settimeofdayp)->ip =
+               SYSCALL2POINTER sys_call_table[__NR_settimeofday - 1024];
+    ((struct fptr *)sys_settimeofdayp)->gp = kernel_gp;
+    
+    ((struct fptr *)sys_killp)->ip =
+               SYSCALL2POINTER sys_call_table[__NR_kill - 1024];
+    ((struct fptr *)sys_killp)->gp = kernel_gp;
+#else /* !AFS_IA64_LINUX20_ENV */
     sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday];
-#if !defined(AFS_ALPHA_LINUX20_ENV)
+#ifdef __NR_socketcall
     sys_socketcallp = SYSCALL2POINTER sys_call_table[__NR_socketcall];
 #endif /* no socketcall on alpha */
     sys_killp = SYSCALL2POINTER sys_call_table[__NR_kill];
+#endif /* AFS_IA64_LINUX20_ENV */
 
     /* setup AFS entry point. */
-    if (SYSCALL2POINTER sys_call_table[__NR_afs_syscall] == afs_syscall) {
+    if (
+#if defined(AFS_IA64_LINUX20_ENV)
+       SYSCALL2POINTER sys_call_table[__NR_afs_syscall - 1024]
+#else
+       SYSCALL2POINTER sys_call_table[__NR_afs_syscall] 
+#endif
+       == afs_syscall) {
        printf("AFS syscall entry point already in use!\n");
        return -EBUSY;
     }
 
 
+#if defined(AFS_IA64_LINUX20_ENV)
+    afs_ni_syscall = sys_call_table[__NR_afs_syscall - 1024];
+
+    afs_syscall_stub = (void *) kmalloc(sizeof(ia64_syscall_stub), GFP_KERNEL);
+    memcpy(afs_syscall_stub, ia64_syscall_stub, sizeof(ia64_syscall_stub));
+    ia64_imm64_fixup((unsigned long)afs_syscall, afs_syscall_stub+0x30);
+    sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL afs_syscall_stub;
+#else /* AFS_IA64_LINUX20_ENV */
     afs_ni_syscall = sys_call_table[__NR_afs_syscall];
     sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall;
-#ifdef AFS_SPARC64_LINUX20_ENV
+# ifdef AFS_SPARC64_LINUX20_ENV
     afs_ni_syscall32 = sys_call_table32[__NR_afs_syscall];
     sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32;
-#endif
+# endif
+#endif /* AFS_IA64_LINUX20_ENV */
 
     osi_Init();
     register_filesystem(&afs_file_system);
 
     /* Intercept setgroups calls */
+#if defined(AFS_IA64_LINUX20_ENV)
+    sys_setgroupsp = (void *) &sys_setgroups;
+
+    afs_xsetgroups_stub = (void *) kmalloc(sizeof(ia64_syscall_stub), GFP_KERNEL);
+    memcpy(afs_xsetgroups_stub, ia64_syscall_stub, sizeof(ia64_syscall_stub));
+    ia64_imm64_fixup((unsigned long)afs_xsetgroups, afs_xsetgroups_stub+0x30);
+
+    ((struct fptr *)sys_setgroupsp)->ip =
+               SYSCALL2POINTER sys_call_table[__NR_setgroups - 1024];
+    ((struct fptr *)sys_setgroupsp)->gp = kernel_gp;
+
+    sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL afs_xsetgroups_stub;
+#else /* AFS_IA64_LINUX20_ENV */
     sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups];
     sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups;
-#ifdef AFS_SPARC64_LINUX20_ENV
+# ifdef AFS_SPARC64_LINUX20_ENV
     sys32_setgroupsp = SYSCALL2POINTER sys_call_table32[__NR_setgroups];
     sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs32_xsetgroups;
-#endif
-#if defined(__NR_setgroups32)
+# endif
+# if defined(__NR_setgroups32)
     sys_setgroups32p = SYSCALL2POINTER sys_call_table[__NR_setgroups32];
     sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32;
-#ifdef AFS_SPARC64_LINUX20_ENV
+# ifdef AFS_SPARC64_LINUX20_ENV
     sys32_setgroups32p = SYSCALL2POINTER sys_call_table32[__NR_setgroups32];
     sys_call_table32[__NR_setgroups32] = POINTER2SYSCALL afs32_xsetgroups32;
-#endif
-#endif
+# endif
+# endif
+#endif /* AFS_IA64_LINUX20_ENV */
 
     return 0;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+void __exit afs_cleanup(void)
+#else
 void cleanup_module(void)
+#endif
 {
     struct task_struct *t;
 
+#if defined(AFS_IA64_LINUX20_ENV)
+    sys_call_table[__NR_setgroups - 1024] = 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;
-#ifdef AFS_SPARC64_LINUX20_ENV
+# ifdef AFS_SPARC64_LINUX20_ENV
     sys_call_table32[__NR_setgroups] = POINTER2SYSCALL sys32_setgroupsp;
     sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
-#endif
-#if defined(__NR_setgroups32)
+# endif
+# if defined(__NR_setgroups32)
     sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroups32p;
-#ifdef AFS_SPARC64_LINUX20_ENV
+# ifdef AFS_SPARC64_LINUX20_ENV
     sys_call_table32[__NR_setgroups32] = POINTER2SYSCALL sys32_setgroups32p;
-#endif
-#endif
+# endif
+# endif
+#endif /* AFS_IA64_LINUX20_ENV */
     unregister_filesystem(&afs_file_system);
 
     osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */
@@ -187,9 +312,15 @@ void cleanup_module(void)
     return;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+module_init(afs_init);
+module_exit(afs_cleanup);
+#endif
+
+
 static long get_page_offset(void)
 {
-#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV)
+#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV)
     return PAGE_OFFSET;
 #else
     struct task_struct *p;
index e1cd1dc23f8691c6a6b27d8834f934c7afa91166..d17dd8a939173d902823749a67ef104ce4e75b2f 100644 (file)
@@ -842,7 +842,7 @@ copyin_iparam(caddr_t cmarg, struct iparam *dst)
        }
 #endif /* AFS_SUN57_64BIT_ENV */
 
-#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV)
        struct iparam32 dst32;
 
 #ifdef AFS_SPARC64_LINUX24_ENV
index 2ef14a3a8558625b58a79bf52f42bf510d63f23c..23cbcfbce1fff8c3d2426326db8b3bdd3f4efbbc 100644 (file)
@@ -200,7 +200,7 @@ copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst)
        }
 #endif /* defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) */
 
-#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV)
        struct afs_ioctl32 dst32;
 
 #ifdef AFS_SPARC64_LINUX24_ENV
@@ -737,6 +737,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
 #ifdef AFS_LINUX22_ENV
     cred_t *credp = crref(); /* don't free until done! */
     struct dentry *dp;
+
 #endif
     AFS_STATCNT(afs_syscall_pioctl);
     if (follow) follow = 1;    /* compat. with old venus */
@@ -1075,7 +1076,7 @@ afs_HandlePioctl(avc, acom, ablob, afollow, acred)
     return afs_CheckCode(code, &treq, 41);
   }
   
-  static PGetFID(avc, afun, areq, ain, aout, ainSize, aoutSize)
+static PGetFID(avc, afun, areq, ain, aout, ainSize, aoutSize)
     struct vcache *avc;
   int afun;
   struct vrequest *areq;
index 84e3ef7fd666c7e176d06e951ea9119ea723f075..c984c7d61b7bbe7e7bdc4b825f3e0971e5fee89a 100644 (file)
 
 #define SYS_NAME_ID_i386_fbsd_42        2100
 
+#define SYS_NAME_ID_ia64_linux2                2200
+#define SYS_NAME_ID_ia64_linux22       2201
+#define SYS_NAME_ID_ia64_linux24       2202
+
 /*
  * 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.ia64_linux24.h b/src/config/param.ia64_linux24.h
new file mode 100644 (file)
index 0000000..7d9254c
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright (C) 1998 by Transarc Corporation */
+
+
+#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 ia64 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_IA64_LINUX20_ENV   1
+#define AFS_IA64_LINUX22_ENV   1
+#define AFS_IA64_LINUX24_ENV   1
+#define AFS_LINUX_64BIT_KERNEL 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 1141
+#define AFS_64BIT_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1   /* User space interface to file system */
+
+#define AFS_64BIT_ENV          1     /* Defines afs_int32 as int, not long. */
+
+#define AFS_64BITPOINTER_ENV   1     /* pointers are 64 bits. */
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+#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
+#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             0       /* if nonzero, garbage collect PAGs */
+
+/* Machine / Operating system information */
+#define SYS_NAME       "ia64_linux24"
+#define SYS_NAME_ID    SYS_NAME_ID_ia64_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 */
+
+#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 */
+
+#define HAVE_UCONTEXT_H                /* should be in afsconfig.h */
+
+#endif /* _PARAM_IA64_LINUX20_H_ */
diff --git a/src/config/param.ia64_linux24_usr.h b/src/config/param.ia64_linux24_usr.h
new file mode 100644 (file)
index 0000000..a15d41e
--- /dev/null
@@ -0,0 +1,59 @@
+/* Copyright (C) 1998 by Transarc Corporation */
+
+
+#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 ia64 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 1141
+#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       "ia64_linux24"
+#define SYS_NAME_ID    SYS_NAME_ID_ia64_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
+
+#define HAVE_UCONTEXT_H                /* should be in afsconfig.h */
+
+#endif /* AFS_PARAM_H */
index 6a730b8f4ff5ea7bfe676f5414947c43beaba959..c294e857ac227b8e6e038a104fe0bba9fdcebd6e 100644 (file)
 #ifdef AFS_ALPHA_LINUX20_ENV
 #include "conf-alpha-linux.h"
 #else
+#ifdef AFS_IA64_LINUX20_ENV
+#include "conf-ia64-linux.h"
+#else
 #include "conf-i386-linux.h"
+#endif /* AFS_IA64_LINUX20_ENV */
 #endif /* AFS_ALPHA_LINUX20_ENV */
 #endif /* AFS_S390_LINUX20_ENV */
 #endif /* AFS_SPARC64_LINUX20_ENV */
diff --git a/src/des/conf-ia64-linux.h b/src/des/conf-ia64-linux.h
new file mode 100644 (file)
index 0000000..8118f4c
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ */
+
+#include <mit-cpyright.h>
+
+#define BITS32
+#define BIG
+#define LSBFIRST
index ccc816d9008d9d271c87812191d5562c3b0ea678..96b3797e995b1f7412e5df33bed143ba68e32928 100644 (file)
@@ -249,8 +249,13 @@ typedef union {
        struct {
 #if defined(LONG_IS_32_BITS)
                /* long is often faster than a 32-bit bit field */
+#if defined(AFS_IA64_LINUX20_ENV)
+               int     i0;
+               int     i1;
+#else
                long    i0;
                long    i1;
+#endif
 #else
                long    i0: 32;
                long    i1: 32;
@@ -501,6 +506,7 @@ crypt(key, setting)
        int num_iter, salt_size;
        C_block keyblock, rsltblock;
 
+
        for (i = 0; i < 8; i++) {
                if ((t = 2*(unsigned char)(*key)) != 0)
                        key++;
index 512de41de95e9e441e690e92cb8c5aa25eb0c0c2..5d00736bca4f6602d7bfb5d95a9714d26a2f5374 100644 (file)
@@ -12,6 +12,7 @@
 
 RCSID("$Header$");
 
+#include <stdlib.h>
 #include <lock.h>
 
 #include "dir.h"
index eaf052cbccf9928275f8210206d4ae75b2a208d1..2428ed0e3c667438d0a21cc192dd602fa9de0da6 100644 (file)
@@ -67,6 +67,10 @@ CCFLAGS =   -O2 -fomit-frame-pointer -fno-strength-reduce \
        -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
        -fno-builtin -ffixed-r2
 DEFINES = -D__KERNEL__  -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
+<ia64_linux24>
+CCFLAGS =   -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
+       -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
+DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
 <all>
 INCLUDES = -I. -I../ -I${TOP_SRCDIR}/config
 
@@ -124,6 +128,8 @@ ${COMPDIRS}:
        ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc asm
 <sparc64_linux22 sparc64_linux24>
        ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
+<ia64_linux24>
+       ln -s ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
 <all>
        for m in ${MPS} ; do \
                KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \
index 8859ffafdb2cc0554a69bed5c2d54c0c5568220f..4ae8096e700d4ce9fc2dfcceed374b05c9f89157 100644 (file)
 
 #if !defined(KERNEL) && !defined(_KMEMUSER) && !defined(AFS_PTHREAD_ENV)
 #include <afs/param.h>
+#ifdef HAVE_UCONTEXT_H
+#include <ucontext.h>
+#else
 #include <setjmp.h>
+#endif
 
 #define LWP_SUCCESS    0
 #define LWP_EBADPID    -1
@@ -191,14 +195,19 @@ typedef struct lwp_pcb {
 #else
 struct lwp_context {   /* saved context for dispatcher */
     char *topstack;    /* ptr to top of process stack */
-#if defined(sparc) && !defined(__linux__)
-#ifdef save_allregs
+#ifdef HAVE_UCONTEXT_H
+    ucontext_t ucontext;
+    int state;
+#else /* !HAVE_UCONTEXT_H */
+# if defined(sparc) && !defined(__linux__)
+# ifdef        save_allregs
     int globals[7+1+32+2+32+2];    /* g1-g7, y reg, f0-f31, fsr, fq, c0-c31, csr, cq. */
-#else
+# else
     int globals[8];    /* g1-g7 and y registers. */
-#endif
-#endif
+# endif
+# endif
     jmp_buf setjmp_buffer;
+#endif /* HAVE_UCONTEXT_H */
 };
 
 struct rock
index 3312019f9a3356a7284780fde9f542646203b79a..b3a5317893ebd85f058b59e4db8a2d0af0dccc8e 100644 (file)
@@ -27,6 +27,59 @@ extern int PRE_Block;              /* used in lwp.c and process.s */
 extern char PRE_Block;             /* used in lwp.c and process.s */
 #endif
 
+#ifdef HAVE_UCONTEXT_H
+
+afs_int32
+savecontext(ep, savearea, newsp)
+char   (*ep)();
+struct lwp_context *savearea;
+char*  newsp;
+{
+#if defined(AFS_IA64_LINUX20_ENV)
+       register unsigned long sp __asm__("r12");
+#else
+#error "You need to update stack pointer register for this platform"
+#endif
+
+       PRE_Block = 1;
+
+       savearea->state = 0;
+       getcontext(&savearea->ucontext);
+       savearea->topstack = sp;
+       switch (savearea->state)
+       {
+               case 0:
+                       if (newsp)
+                       {
+                               ucontext_t thread;
+
+                               getcontext(&thread);
+                               thread.uc_stack.ss_sp = newsp - AFS_LWP_MINSTACKSIZE + sizeof(void *) + sizeof(void *);
+                               thread.uc_stack.ss_size = AFS_LWP_MINSTACKSIZE - sizeof(void *);
+                               makecontext(&thread, ep, 0);
+                               setcontext(&thread);
+                       }
+                       else
+                               (*ep)();
+                       break;
+               case 2:
+                       break;
+       }
+       return 0;
+}
+
+void
+returnto(savearea)
+struct lwp_context *savearea;
+{
+       PRE_Block = 0;
+
+       savearea->state = 2;
+       setcontext(&savearea->ucontext);
+}
+
+#else
+
 /*
  * Magic stack pointer
  */
@@ -169,3 +222,4 @@ struct lwp_context *savearea;
        return 0;
 }
 
+#endif
index addb64cff460d6bc5a7c1f5725492ed8e98b54a2..79ab60835246fb2872ab8cbba86e207342c49671 100644 (file)
@@ -54,6 +54,7 @@
 # include "rx_event.h"
 # include "rx_packet.h"
 # include "rx_misc.h"
+# include "rx_null.h"
 #ifndef AFS_NT40_ENV
 # include <netinet/in.h>
 #endif