From e99bc1e8094fd73c27444fe56fbda8f349f9d87a Mon Sep 17 00:00:00 2001 From: Andrej Filipcic Date: Sun, 3 Apr 2005 21:01:11 +0000 Subject: [PATCH] STABLE14-alpha-linux26-20050403 FIXES 18081 alpha linux26 port (cherry picked from commit f9971b7729d31ecb08d22dcd3511f924c6681214) --- src/afs/afs.h | 2 +- src/cf/osconf.m4 | 18 ++++ src/config/afs_sysnames.h | 1 + src/config/param.alpha_linux_26.h | 139 ++++++++++++++++++++++++++++++ src/libafs/MakefileProto.LINUX.in | 12 +-- src/rx/rx.c | 12 +-- 6 files changed, 166 insertions(+), 18 deletions(-) create mode 100644 src/config/param.alpha_linux_26.h diff --git a/src/afs/afs.h b/src/afs/afs.h index 0b851aaf6..1ec276d38 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -43,7 +43,7 @@ extern int afs_shuttingdown; #if defined(AFS_HPUX102_ENV) #define AFS_FLOCK k_flock #else -#if defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV) && !defined(AFS_IA64_LINUX26_ENV) && !defined(AFS_S390X_LINUX26_ENV)) +#if defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV) && !defined(AFS_IA64_LINUX26_ENV) && !defined(AFS_S390X_LINUX26_ENV) && !defined(AFS_ALPHA_LINUX26_ENV)) #define AFS_FLOCK flock64 #else #define AFS_FLOCK flock diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index b8a94bd18..6c3524f3e 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -73,6 +73,7 @@ case $AFS_SYSNAME in MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" @@ -81,11 +82,28 @@ case $AFS_SYSNAME in ;; alpha_linux_24) + CCOBJ="${CC} -fPIC" KERN_OPTMZ=-O2 LEX="flex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' MT_LIBS="-lpthread" PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_CFLAGS="-fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + alpha_linux_26) + CCOBJ="${CC} -fPIC" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_CFLAGS="-fPIC" SHLIB_LDFLAGS="-shared -Xlinker -x" TXLIBS="-lncurses" XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 51c644e7e..54ec3f529 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -160,6 +160,7 @@ #define SYS_NAME_ID_alpha_linux_2 2000 #define SYS_NAME_ID_alpha_linux_22 2001 #define SYS_NAME_ID_alpha_linux_24 2002 +#define SYS_NAME_ID_alpha_linux_26 2003 #define SYS_NAME_ID_i386_fbsd_42 2100 #define SYS_NAME_ID_i386_fbsd_43 2101 diff --git a/src/config/param.alpha_linux_26.h b/src/config/param.alpha_linux_26.h new file mode 100644 index 000000000..8bbcff38b --- /dev/null +++ b/src/config/param.alpha_linux_26.h @@ -0,0 +1,139 @@ +#ifndef UKERNEL +/* This section for kernel libafs compiles only */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_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_LINUX24_ENV 1 +#define AFS_LINUX26_ENV 1 +#define AFS_ALPHA_LINUX20_ENV 1 +#define AFS_ALPHA_LINUX22_ENV 1 +#define AFS_ALPHA_LINUX24_ENV 1 +#define AFS_ALPHA_LINUX26_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 +#define AFS_64BIT_CLIENT 1 +#define AFS_64BITPOINTER_ENV 1 /* pointers are 64 bits */ + + +#if defined(__KERNEL__) && !defined(KDUMP_KERNEL) +#include + +#include +#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 +#define AFS_GLOBAL_SUNLOCK +#endif +#endif /* __KERNEL__ && !DUMP_KERNEL */ + +#include +#define AFS_USERSPACE_IP_ADDR 1 +#define RXK_LISTENER_ENV 1 +#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */ + +#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 */ + +/* Machine / Operating system information */ +#define SYS_NAME "alpha_linux_26" +#define SYS_NAME_ID SYS_NAME_ID_alpha_linux_26 + + +#endif /* AFS_PARAM_H */ + +#else /* !defined(UKERNEL) */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_H + + +#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 338 +#define AFS_64BIT_IOPS_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_26" +#define SYS_NAME_ID SYS_NAME_ID_alpha_linux_26 +#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/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index d23769c60..8f2a7ea46 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -40,7 +40,7 @@ COMMON_DEFINES=-D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ # System specific build commands and flags - + # All the platform-specific and kernel-related things are provided by # the kernel build system. So we should _not_ use COMMON_KERN_CFLAGS! CCFLAGS = -Wno-strict-prototypes @@ -116,9 +116,9 @@ DESTDIRS=linux_destdirs include Makefile.common - + LINUX_MODULE_EXT=ko - + LINUX_MODULE_EXT=o @@ -154,7 +154,7 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}: $(RM) -f asm ln -fs ${LINUX_KERNEL_PATH}/include/asm-parisc asm - + ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm @@ -244,7 +244,7 @@ libafs.ep: $(LIBAFS_EP) libafs.bm: $(LIBAFS_BM) echo BM Build Complete - + ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: libafs.ko cp libafs.ko $@ @@ -253,7 +253,7 @@ libafs.ko: .FORCE env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules - + ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS) $(RM) -f $@ $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS) diff --git a/src/rx/rx.c b/src/rx/rx.c index bdad76a6c..31907fdfd 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -5523,20 +5523,10 @@ rxi_ComputeRoundTripTime(register struct rx_packet *p, { 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; -#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. */ -- 2.39.5