From bccc6a809dc15479e5831ab8ad111029fcdba258 Mon Sep 17 00:00:00 2001 From: Michael Stroucken Date: Tue, 27 Mar 2001 00:53:26 +0000 Subject: [PATCH] first-pass-at-alpha-linux-support-20010312 Changes for Alpha to previous 64 bit changes for sparc (sparc64 isn't necessarily analogous to alpha or any other 64 bit linux platform) ==================== 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. ==================== use mkstemp ==================== Include necessary file for alpha config ==================== Deal with 64 bit time_t ==================== Don't do increments in a way that can be miscompiled ==================== configure for alpha linux ==================== deal with time and initialize a variable ==================== don't use ViceIoctl32 for alpha linux ==================== deal with compiling kdump for alpha linux ==================== mods in callback.c analogous to dux port; mods in viced to deal with thread creation function return convention ==================== config for linux alpha ==================== ids for alpha linux consistent with new-style sysname grouping ==================== makefile and config files for new-style sysnames ==================== MakefileProto changes for alpha linux with new-style sysnames. A change in config/mc.c will be needed for this to configure correctly, and it will be added soon ==================== note alpha port and the state it's in to hopefully avoid questions --- src/README | 2 + src/afs/LINUX/osi_module.c | 15 ++++- src/afs/afs_call.c | 7 ++- src/afs/afs_pioctl.c | 9 +-- src/bucoord/ubik_db_if.c | 4 ++ src/budb/db_text.c | 4 ++ src/butc/tcudbprocs.c | 4 ++ src/config/Makefile.alpha_linux_2216_22 | 48 +++++++++++++++ src/config/afs_sysnames.h | 4 ++ src/config/param.alpha_linux_2216_22.h | 68 ++++++++++++++++++++++ src/config/param.alpha_linux_2216_22_usr.h | 54 +++++++++++++++++ src/des/andrew-conf.h | 6 +- src/des/conf-alpha-linux.h | 18 ++++++ src/kauth/kautils.c | 4 +- src/libacl/aclprocs.c | 6 +- src/libafs/MakefileProto.LINUX | 5 ++ src/lwp/process.c | 9 ++- src/rx/rx.c | 15 ++++- src/util/vice.h | 2 +- src/venus/Makefile | 4 ++ src/venus/kdump.c | 6 ++ src/viced/callback.c | 2 +- src/viced/viced.c | 4 +- 23 files changed, 281 insertions(+), 19 deletions(-) create mode 100644 src/config/Makefile.alpha_linux_2216_22 create mode 100644 src/config/param.alpha_linux_2216_22.h create mode 100644 src/config/param.alpha_linux_2216_22_usr.h create mode 100644 src/des/conf-alpha-linux.h diff --git a/src/README b/src/README index 27beaa75e..8ff463d53 100644 --- a/src/README +++ b/src/README @@ -27,6 +27,8 @@ A. Creating the proper directory structure. sun4x_56/ sun4x_57/ sun4x_58/ + alpha_linux_2216_22/ (DES does not work, will require one more change to + compile) Example: % mkdir i386_linux22 diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index c3c29b529..fcd575490 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -22,11 +22,17 @@ asmlinkage int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz); +#if !defined(AFS_ALPHA_LINUX20_ENV) 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); +#ifdef AFS_SPARC64_LINUX20_ENV extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 has syscaltable of 32bit items */ +#else +extern void * sys_call_table[]; /* safer for other linuces */ +#endif extern struct file_system_type afs_file_system; static long get_page_offset(void); @@ -63,8 +69,13 @@ __asm__ __volatile__ (" } #endif +#ifdef AFS_SPARC64_LINUX20_ENV #define POINTER2SYSCALL (unsigned int)(unsigned long) #define SYSCALL2POINTER (void *)(long) +#else +#define POINTER2SYSCALL (void *) +#define SYSCALL2POINTER (void *) +#endif int init_module(void) { @@ -85,7 +96,9 @@ int init_module(void) /* Initialize pointers to kernel syscalls. */ sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday]; +#if !defined(AFS_ALPHA_LINUX20_ENV) sys_socketcallp = SYSCALL2POINTER sys_call_table[__NR_socketcall]; +#endif /* no socketcall on alpha */ sys_killp = SYSCALL2POINTER sys_call_table[__NR_kill]; /* setup AFS entry point. */ @@ -137,7 +150,7 @@ void cleanup_module(void) static long get_page_offset(void) { -#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) +#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) return PAGE_OFFSET; #else struct task_struct *p; diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 27beb93b8..1bf785834 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -816,14 +816,15 @@ copyin_iparam(caddr_t cmarg, struct iparam *dst) } #endif /* AFS_SUN57_64BIT_ENV */ -#if defined(AFS_LINUX_64BIT_KERNEL) +#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) struct iparam32 dst32; #ifdef AFS_SPARC64_LINUX20_ENV - if (current->tss.flags & SPARC_FLAG_32BIT) { + if (current->tss.flags & SPARC_FLAG_32BIT) #else #error Not done for this linux version -#endif +#endif /* AFS_SPARC64_LINUX20_ENV */ + { AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); if (!code) iparam32_to_iparam(&dst32, dst); diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 2044147c5..c25964de0 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -196,14 +196,15 @@ copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst) } #endif /* defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) */ -#if defined(AFS_LINUX_64BIT_KERNEL) +#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) struct afs_ioctl32 dst32; #ifdef AFS_SPARC64_LINUX20_ENV - if (current->tss.flags & SPARC_FLAG_32BIT) { + if (current->tss.flags & SPARC_FLAG_32BIT) #else #error Not done for this linux type -#endif +#endif /* AFS_SPARC64_LINUX20_ENV */ + { AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); if (!code) afs_ioctl32_to_afs_ioctl(&dst32, dst); @@ -662,7 +663,7 @@ afs_syscall_pioctl(path, com, cmarg, follow, rvp, credp) afs_syscall_pioctl(path, com, cmarg, follow) #endif char *path; - int com; + unsigned int com; caddr_t cmarg; int follow; { diff --git a/src/bucoord/ubik_db_if.c b/src/bucoord/ubik_db_if.c index 45ceef830..017fe0146 100644 --- a/src/bucoord/ubik_db_if.c +++ b/src/bucoord/ubik_db_if.c @@ -1395,7 +1395,11 @@ int bc_openTextFile(udbClientTextP ctPtr, char *tmpFileName) fclose(ctPtr->textStream); sprintf(tmpFileName, "%s/bu_XXXXXX", gettmpdir()); +#ifdef AFS_LINUX20_ENV + mkstemp(tmpFileName); +#else mktemp(tmpFileName); +#endif ctPtr->textStream = fopen(tmpFileName, "w+"); if ( ctPtr->textStream == NULL ) ERROR(BUDB_INTERNALERROR); diff --git a/src/budb/db_text.c b/src/budb/db_text.c index 48097a44e..7d453ea72 100644 --- a/src/budb/db_text.c +++ b/src/budb/db_text.c @@ -518,7 +518,11 @@ mkstemp(st) { int retval = -1; +#ifdef AFS_LINUX20_ENV + retval = open(mkstemp(st), O_RDWR|O_CREAT|O_EXCL, 0600); +#else retval = open(mktemp(st), O_RDWR|O_CREAT|O_EXCL, 0600); +#endif error_exit: return(retval); diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 932dadd64..8b70406f6 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -1386,7 +1386,11 @@ restoreText(tapeInfo, rstTapeInfoPtr, nextHeader) /* open the text file */ sprintf(filename, "%s/bu_XXXXXX", gettmpdir()); +#ifdef AFS_LINUX20_ENV + fid = open(mkstemp(filename), O_RDWR|O_CREAT|O_EXCL, 0600); +#else fid = open(mktemp(filename), O_RDWR|O_CREAT|O_EXCL, 0600); +#endif if (fid < 0) { ErrorLog(0, rstTapeInfoPtr->taskId, errno, 0, diff --git a/src/config/Makefile.alpha_linux_2216_22 b/src/config/Makefile.alpha_linux_2216_22 new file mode 100644 index 000000000..7443d55cc --- /dev/null +++ b/src/config/Makefile.alpha_linux_2216_22 @@ -0,0 +1,48 @@ +# Makefile for Linux 2.2.16 kernel on Alpha with glibc 2.2 +# Keep macros within each section in sorted order for clean diff displays. +# +# AFS_OSTYPE used to indicate suffixes and os specific subdirectories. +AFS_OSTYPE = LINUX +# Base directory for linux kernel source. Actually a prefix which is complete +# when LINUX_VERS is appended to it. +LINUX_SRCDIR = /usr/src/linux- +# Default list of Linux kernels to build. Build will run only if all +# can be built. To build a different set, specify LINUX_VERS to make. +LINUX_VERS = 2.2.16 + +# +# compilation and link editor flags +DBG=-g +OPTMZ=-O2 +PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC +# Put -O2 here to _ensure_ all Makefiles pick it up. +XCFLAGS= -O2 +MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS} +XLDFLAGS= +SHARE_LDFLAGS = -shared -Xlinker -x +SHLIB_SUFFIX=so +SHLIB_CFLAGS= +# +# libraries +MTLIBS=-lpthread +TXLIBS= /usr/lib/libncurses.so +XLIBS= +# +# programs +AR=ar +AS=as +CP=cp +INSTALL=${SRCDIR}bin/install +LD=ld +MT_CC=cc +MV=mv +RANLIB=ranlib +RM=rm +WASHTOOL=${SRCDIR}bin/washtool +# +# Other OS specific requirements +# +YACC = bison -y +LEX = flex -l +# Used in des library. +CRYPT_OBJ = crypt.o diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index ada6df6f3..ab155f4a3 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -125,6 +125,10 @@ #define SYS_NAME_ID_s390_linux22 1901 #define SYS_NAME_ID_s390_linux24 1902 +#define SYS_NAME_ID_alpha_linux_2 2000 +#define SYS_NAME_ID_alpha_linux_22 2001 +#define SYS_NAME_ID_alpha_linux_24 2002 + /* * Placeholder to keep system-wide standard flags since this file is included by all diff --git a/src/config/param.alpha_linux_2216_22.h b/src/config/param.alpha_linux_2216_22.h new file mode 100644 index 000000000..474e6dbcb --- /dev/null +++ b/src/config/param.alpha_linux_2216_22.h @@ -0,0 +1,68 @@ +#ifndef _PARAM_ALPHA_LINUX2216_22_H_ +#define _PARAM_ALPHA_LINUX2216_22_H_ + +/* Linux 2.2.16 kernel on Alpha with glibc 2.2 */ + +/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel, + * it's a judgment call. If something is obviously sparc64 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_ALPHA_LINUX20_ENV 1 +#define AFS_ALPHA_LINUX22_ENV 1 +#define __alpha 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 338 +#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. */ + +#include + +#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 "alpha_linux_22" +#define SYS_NAME_ID SYS_NAME_ID_alpha_linux_22 +#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 */ + +#if defined(__KERNEL__) && !defined(KDUMP_KERNEL) +#include +#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 +#define __SMP__ +#define AFS_GLOBAL_SUNLOCK +#endif + +#endif /* __KERNEL__ && !DUMP_KERNEL*/ + +#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 /* _PARAM_ALPHA_LINUX2216_22_H_ */ diff --git a/src/config/param.alpha_linux_2216_22_usr.h b/src/config/param.alpha_linux_2216_22_usr.h new file mode 100644 index 000000000..e1d166751 --- /dev/null +++ b/src/config/param.alpha_linux_2216_22_usr.h @@ -0,0 +1,54 @@ +#ifndef _PARAM_ALPHA_LINUX2216_22_USR_H_ +#define _PARAM_ALPHA_LINUX2216_22_USR_H_ + +/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel, + * it's a judgment call. If something is obviously sparc64 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_NONFSTRANS 1 + +#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ +#define AFS_SYSCALL 338 +#define AFS_64BIT_IOPS_ENV 1 +#define AFS_64BIT_ENV 1 +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#include + +#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 "alpha_linux_22" +#define SYS_NAME_ID SYS_NAME_ID_alpha_linux_22 +#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 /* _PARAM_ALPHA_LINUX2216_22_USR_H_ */ diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h index 99ec3cde2..25bee7410 100644 --- a/src/des/andrew-conf.h +++ b/src/des/andrew-conf.h @@ -31,7 +31,7 @@ #if defined(sgi) #include "conf-sgi.h" #else -#ifdef __alpha +#if defined(__alpha) && !defined(AFS_ALPHA_LINUX20_ENV) #include "conf-bsd-alpha.h" #else #if defined(AFS_X86_ENV) @@ -53,7 +53,11 @@ #ifdef AFS_S390_LINUX20_ENV #include "conf-s390-linux.h" #else +#ifdef AFS_ALPHA_LINUX20_ENV +#include "conf-alpha-linux.h" +#else #include "conf-i386-linux.h" +#endif /* AFS_ALPHA_LINUX20_ENV */ #endif /* AFS_S390_LINUX20_ENV */ #endif /* AFS_SPARC64_LINUX20_ENV */ #endif /* AFS_SPARC_LINUX20_ENV */ diff --git a/src/des/conf-alpha-linux.h b/src/des/conf-alpha-linux.h new file mode 100644 index 000000000..5246e0d4d --- /dev/null +++ b/src/des/conf-alpha-linux.h @@ -0,0 +1,18 @@ +/* + * Copyright 1988 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Machine-type definitions: Alpha + */ + +#include + +#define ALPHA + +/* 'course this is a joke, but I am not going to rewrite this mess */ +#define BITS32 + +#define BIG +#define LSBFIRST diff --git a/src/kauth/kautils.c b/src/kauth/kautils.c index 3a27fe648..a5883824d 100644 --- a/src/kauth/kautils.c +++ b/src/kauth/kautils.c @@ -184,12 +184,14 @@ void ka_timestr ( afs_int32 tlen) { char tbuffer[32]; /* need at least 26 bytes */ + time_t passtime; /* modern systems have 64 bit time */ if (!time) strcpy (tstr, "no date");/* special case this */ else if (time == NEVERDATE) strcpy(tstr, "never"); else { + passtime = time; strncpy(tstr, - afs_ctime((time_t *)&time, tbuffer, sizeof(tbuffer)), tlen); + afs_ctime(&passtime, tbuffer, sizeof(tbuffer)), tlen); tstr[strlen(tstr)-1] = '\0'; /* punt the newline character */ } } diff --git a/src/libacl/aclprocs.c b/src/libacl/aclprocs.c index 4a1408180..de7d0031b 100644 --- a/src/libacl/aclprocs.c +++ b/src/libacl/aclprocs.c @@ -248,13 +248,15 @@ struct acl_accessList **acl; if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[i], &k) != 2) return(-1); (*acl)->entries[i].rights = k; - nextc = (char *) (1 + index(nextc, '\n')); + nextc = (char *) (index(nextc, '\n')); + nextc ++; /* 1 + index can cast ptr to integer */ } j=i; for (i = (*acl)->total - 1; i >= (*acl)->total - (*acl)->negative; i--,j++) { if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[j], &((*acl)->entries[j].rights)) != 2) return(-1); - nextc = (char *) (1 + index(nextc, '\n')); + nextc = (char *) (index(nextc, '\n')); + nextc ++; } lids.idlist_len = 0; lids.idlist_val = 0; diff --git a/src/libafs/MakefileProto.LINUX b/src/libafs/MakefileProto.LINUX index b3d3e9fa8..f610d5a09 100644 --- a/src/libafs/MakefileProto.LINUX +++ b/src/libafs/MakefileProto.LINUX @@ -41,6 +41,9 @@ CCFLAGS = -O2 -fomit-frame-pointer \ -fno-strength-reduce -pipe -m486 -malign-loops=2 -malign-jumps=2 \ -malign-functions=2 DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} + +CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8 +DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \ -fno-strict-aliasing -fsigned-char @@ -108,6 +111,8 @@ ${COMPDIRS}: rm -f asm-generic; \ ln -s ${LINUX_SRCDIR}$$v/include/asm-generic asm-generic; \ rm -f asm; \ + + ln -s ${LINUX_SRCDIR}$$v/include/asm-alpha asm ; \ ln -s ${LINUX_SRCDIR}$$v/include/asm-i386 asm ; \ diff --git a/src/lwp/process.c b/src/lwp/process.c index 56c020a63..a9d1d25b1 100644 --- a/src/lwp/process.c +++ b/src/lwp/process.c @@ -44,6 +44,9 @@ extern char PRE_Block; /* used in lwp.c and process.s */ #elif defined(AFS_SPARC64_LINUX20_ENV) && defined(AFS_32BIT_USR_ENV) #define LWP_SP 0 #define LWP_FP 1 +#elif defined(AFS_ALPHA_LINUX20_ENV) +#define LWP_SP 8 +#define LWP_FP 7 #else #error Unsupported linux LWP system type. #endif @@ -62,8 +65,12 @@ extern char PRE_Block; /* used in lwp.c and process.s */ typedef __uint64_t jmp_buf_type; #endif #else +#ifdef AFS_ALPHA_LINUX20_ENV +typedef long jmp_buf_type; +#else typedef int jmp_buf_type; -#endif +#endif /*AFS_ALPHA_LINUX20_ENV*/ +#endif /*SGI*/ static jmp_buf jmp_tmp; static char (*EP)(); diff --git a/src/rx/rx.c b/src/rx/rx.c index f8ef0f0a7..14b47afdc 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -252,7 +252,7 @@ void rxi_StartUnlocked(); ** pretty good that the next packet coming in is from the same connection ** as the last packet, since we're send multiple packets in a transmit window. */ -struct rx_connection *rxLastConn; +struct rx_connection *rxLastConn = 0; #ifdef RX_ENABLE_LOCKS /* The locking hierarchy for rx fine grain locking is composed of five @@ -5265,10 +5265,21 @@ void rxi_ComputeRoundTripTime(p, sentp, peer) { struct clock thisRtt, *rttp = &thisRtt; +#if defined(AFS_ALPHA_LINUX22_ENV) && defined(AFS_PTHREAD_ENV) && !defined(KERNEL) + /* making year 2038 bugs to get this running now - stroucki */ + struct timeval temptime; +#endif register int rtt_timeout; static char id[]="@(#)adaptive RTO"; - clock_GetTime(rttp); +#if defined(AFS_ALPHA_LINUX20_ENV) && defined(AFS_PTHREAD_ENV) && !defined(KERNEL) + /* yet again. This was the worst Heisenbug of the port - stroucki */ + clock_GetTime(&temptime); + rttp->sec=(afs_int32)temptime.tv_sec; + rttp->usec=(afs_int32)temptime.tv_usec; +#else + clock_GetTime(rttp); +#endif if (clock_Lt(rttp, sentp)) { clock_Zero(rttp); return; /* somebody set the clock back, don't count this time. */ diff --git a/src/util/vice.h b/src/util/vice.h index 4cd72deb2..d28e4b62e 100644 --- a/src/util/vice.h +++ b/src/util/vice.h @@ -62,7 +62,7 @@ struct ViceIoctl { * version of _IOW() to check the size of user space arguments -- except * on Digital Unix. */ -#if defined(KERNEL) && !defined(AFS_OSF_ENV) +#if defined(KERNEL) && !defined(AFS_OSF_ENV) && !defined(AFS_ALPHA_LINUX20_ENV) #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl32)) #else #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl)) diff --git a/src/venus/Makefile b/src/venus/Makefile index ce799d266..326a5913a 100644 --- a/src/venus/Makefile +++ b/src/venus/Makefile @@ -164,6 +164,10 @@ cmdebug: cmdebug.o ${CMLIBS} kdump.o: kdump.c ${INCLS} AFS_component_version_number.c set -x; \ case ${SYS_NAME} in \ + alpha_linux* ) \ + for lv in ${LINUX_VERS}; do \ + ${CC} -g -I${LINUX_SRCDIR}$$lv/include -I${DESTDIR}include -I${SRCDIR}include ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-$$lv.o -c kdump.c ; \ + done ;; \ *linux* ) \ for lv in ${LINUX_VERS}; do \ ${CC} -g -I${LINUX_SRCDIR}$$lv/include -I${DESTDIR}include -I${SRCDIR}include ${XCFLAGS} -o kdump-$$lv.o -c kdump.c ; \ diff --git a/src/venus/kdump.c b/src/venus/kdump.c index 203635c04..e9db1db71 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -220,17 +220,23 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t; #ifdef AFS_SPARC_LINUX20_ENV #define _SPARC_STATFS_H #else +#ifdef AFS_ALPHA_LINUX20_ENV +#define _ALPHA_STATFS_H +#else #define _I386_STATFS_H +#endif /* AFS_ALPHA_LINUX20_ENV */ #endif /* AFS_SPARC_LINUX20_ENV */ #endif /* AFS_SPARC64_LINUX20_ENV */ #endif /* AFS_S390_LINUX20_ENV */ struct timezone { int a,b; }; +#ifndef AFS_ALPHA_LINUX20_ENV typedef struct timeval { int tv_sec; int tv_usec; } timeval_t; /* Needed here since KERNEL defined. */ +#endif /*AFS_ALPHA_LINUX20_ENV*/ #if defined(AFSBIG_ENDIAN) #define _LINUX_BYTEORDER_BIG_ENDIAN_H #else diff --git a/src/viced/callback.c b/src/viced/callback.c index 23a637e53..c197140ac 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -141,7 +141,7 @@ struct FileEntry { u_short ncbs; u_short firstcb; u_short spare; -#ifdef AFS_ALPHA_ENV +#if defined(AFS_ALPHA_ENV) || defined(AFS_ALPHA_LINUX20_ENV) u_short spare1; u_short spare2; #endif diff --git a/src/viced/viced.c b/src/viced/viced.c index 34a325071..06bfa9f2c 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -563,8 +563,8 @@ main(argc, argv) assert(pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED) == 0); /* Block signals in the threads */ AFS_SIGSET_CLEAR(); - assert(pthread_create(&serverPid, &tattr, FiveMinuteCheckLWP, &fiveminutes) == 0); - assert(pthread_create(&serverPid, &tattr, HostCheckLWP, &fiveminutes) == 0); + assert(pthread_create(&serverPid, &tattr, (void *)FiveMinuteCheckLWP, &fiveminutes) == 0); + assert(pthread_create(&serverPid, &tattr, (void *)HostCheckLWP, &fiveminutes) == 0); AFS_SIGSET_RESTORE(); #else /* AFS_PTHREAD_ENV */ assert(LWP_CreateProcess(FiveMinuteCheckLWP, stack*1024, LWP_MAX_PRIORITY - 2, -- 2.39.5