From 3e363ca7a6255a57cd5ee07249feb611f55effb6 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Mon, 6 Nov 2000 04:22:21 +0000 Subject: [PATCH] initial-solaris8-support-20001105 Iniktial Solaris 8 support ==================== 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. ==================== Initial Solaris 8 support ==================== Initial Solaris 8 support --- src/Makefile | 5 +- src/afs/SOLARIS/osi_inode.c | 6 ++- src/afs/SOLARIS/osi_vfsops.c | 2 + src/afs/VNOPS/afs_vnop_flock.c | 6 +-- src/afs/afs_analyze.c | 3 ++ src/afs/afs_cell.c | 3 ++ src/afs/afs_conn.c | 3 ++ src/afs/afs_server.c | 7 +++ src/afs/afs_user.c | 3 ++ src/afs/afs_util.c | 3 ++ src/afs/afs_volume.c | 3 ++ src/afsd/Makefile | 2 + src/afsd/afsd.c | 4 +- src/config/afs_sysnames.h | 1 + src/config/param.sun4x_58.h | 104 +++++++++++++++++++++++++++++++++++++++ src/config/param.sun4x_58_usr.h | 59 ++++++++++++++++++++++ src/libafs/MakefileProto.SOLARIS | 16 +++--- src/rx/SOLARIS/rx_knet.c | 3 ++ 18 files changed, 218 insertions(+), 15 deletions(-) create mode 100644 src/config/param.sun4x_58.h create mode 100644 src/config/param.sun4x_58_usr.h diff --git a/src/Makefile b/src/Makefile index 50eb1ac..cb66684 100644 --- a/src/Makefile +++ b/src/Makefile @@ -69,7 +69,7 @@ comerr: basics util cmd: basics comerr ${COMPILE_PART1} cmd ${COMPILE_PART2} @case ${SYS_NAME} in \ - sgi_6* | sun4x_57 | hp_ux11* ) \ + sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* ) \ ${COMPILE_PART1} cmd ${COMPILE_PART2} install64 ;; \ esac @@ -231,6 +231,7 @@ uss: des kauth project rx vlserver vol ntp: project volser case ${SYS_NAME} in \ + sun4x_58 ) echo skipping ntp for ${SYS_NAME} ;; \ *linux* ) echo skipping ntp for ${SYS_NAME} ;; \ * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \ esac @@ -260,6 +261,8 @@ vfsck: minproject vol echo skip vfsck for ${SYS_NAME} ;; \ sun4x_57 ) \ echo skip vfsck for ${SYS_NAME} ;; \ + sun4x_58 ) \ + echo skip vfsck for ${SYS_NAME} ;; \ * ) \ ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \ esac diff --git a/src/afs/SOLARIS/osi_inode.c b/src/afs/SOLARIS/osi_inode.c index 6982a43..306b282 100644 --- a/src/afs/SOLARIS/osi_inode.c +++ b/src/afs/SOLARIS/osi_inode.c @@ -39,7 +39,11 @@ getinode(vfsp, dev, inode, ipp, credp,perror) *perror = 0; - if (!vfsp && !(vfsp = vfs_devsearch(dev))) { + if (!vfsp +#if !defined(AFS_SUN58_ENV) + && !(vfsp = vfs_devsearch(dev)) +#endif + ) { return (ENODEV); } if (code = (*ufs_igetp)(vfsp, inode, &ip, credp)) { diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index e9b25fa..343df6d 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -433,7 +433,9 @@ _init() #else read_binding_file(sysbind, sb_hashtab); #endif +#if !defined(AFS_SUN58_ENV) make_syscallname("afs", AFS_SYSCALL); +#endif if (sysent[AFS_SYSCALL].sy_call == nosys) { if ((sysn = mod_getsysname(AFS_SYSCALL)) != NULL) { diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 797f981..5181863 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -511,7 +511,7 @@ struct AFS_UCRED *acred; { acmd = F_SETLK; } #endif -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) +#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) if ((acmd == F_GETLK) || (acmd == F_RGETLK)) { #else if (acmd == F_GETLK) { @@ -525,7 +525,7 @@ struct AFS_UCRED *acred; { return code; } else if ((acmd == F_SETLK) || (acmd == F_SETLKW) -#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) +#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) || (acmd == F_RSETLK)|| (acmd == F_RSETLKW)) { #else ) { @@ -548,7 +548,7 @@ struct AFS_UCRED *acred; { else if (af->l_type == F_UNLCK) code = LOCK_UN; else return EINVAL; /* unknown lock type */ if (((acmd == F_SETLK) -#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) +#if (defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV) || (acmd == F_RSETLK) #endif ) && code != LOCK_UN) diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index a17c014..32bfc5c 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -36,6 +36,9 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +#include +#endif #include #endif diff --git a/src/afs/afs_cell.c b/src/afs/afs_cell.c index 9bb5046..2b271e1 100644 --- a/src/afs/afs_cell.c +++ b/src/afs/afs_cell.c @@ -32,6 +32,9 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +#include +#endif #include #endif diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c index c57216a..16bc447 100644 --- a/src/afs/afs_conn.c +++ b/src/afs/afs_conn.c @@ -32,6 +32,9 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +#include +#endif #include #endif diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index 8fe31b4..e2ddf74 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -51,6 +51,13 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +# include +# define ipif_local_addr ipif_lcl_addr +# ifndef V4_PART_OF_V6 +# define V4_PART_OF_V6(v6) v6.s6_addr32[3] +# endif +# endif #include #endif diff --git a/src/afs/afs_user.c b/src/afs/afs_user.c index 65aaeac..18c317d 100644 --- a/src/afs/afs_user.c +++ b/src/afs/afs_user.c @@ -32,6 +32,9 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +#include +#endif #include #endif diff --git a/src/afs/afs_util.c b/src/afs/afs_util.c index b1e1a4b..4d22160 100644 --- a/src/afs/afs_util.c +++ b/src/afs/afs_util.c @@ -34,6 +34,9 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +#include +#endif #include #endif diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index 909a48c..427e315 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -37,6 +37,9 @@ #if defined(AFS_SUN56_ENV) #include #include +#if defined(AFS_SUN58_ENV) +#include +#endif #include #endif diff --git a/src/afsd/Makefile b/src/afsd/Makefile index d748260..debf725 100644 --- a/src/afsd/Makefile +++ b/src/afsd/Makefile @@ -88,6 +88,8 @@ install: all ${INSTALL} -f afs.rc.solaris ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\ sun4x_57 ) \ ${INSTALL} -f afs.rc.solaris.2.7 ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\ + sun4x_58 ) \ + ${INSTALL} -f afs.rc.solaris.2.8 ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\ sun4x_5? ) \ ${INSTALL} -f afs.rc.solaris.2_5 ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\ alpha_osf* ) \ diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index fb311f1..57eb222 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -1368,7 +1368,7 @@ mainproc(as, arock) #endif #else #ifdef AFS_SUN5_ENV - if ((mount("",cacheMountDir,mountFlags,"afs", (char *)0, 0)) < 0) { + if ((mount("AFS",cacheMountDir,mountFlags,"afs", (char *)0, 0)) < 0) { #else #if defined(AFS_SGI_ENV) mountFlags = MS_FSS; @@ -1464,7 +1464,7 @@ char **argv; { #endif static int HandleMTab() { -#if defined (AFS_SUN_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) +#if (defined (AFS_SUN_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)) && !defined(AFS_SUN58_ENV) FILE *tfilep; #ifdef AFS_SUN5_ENV char tbuf[16]; diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 437314a..33d64d4 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -77,6 +77,7 @@ #define SYS_NAME_ID_sunx86_56 936 #define SYS_NAME_ID_sunx86_55 937 #define SYS_NAME_ID_sun4x_57 938 +#define SYS_NAME_ID_sun4x_58 939 #define SYS_NAME_ID_vax_ul4 1003 diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h new file mode 100644 index 0000000..7326e4f --- /dev/null +++ b/src/config/param.sun4x_58.h @@ -0,0 +1,104 @@ +#ifndef _PARAM_SUN4X_58_H_ +#define _PARAM_SUN4X_58_H_ + +#define AFS_VFS_ENV 1 +/* Used only in vfsck/* code; is it needed any more???? */ + +#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */ +#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */ +#define AFS_ENV 1 +#define AFS_SUN_ENV 1 +#define AFS_SUN5_ENV 1 +#define AFS_SUN52_ENV 1 +#define AFS_SUN53_ENV 1 +#define AFS_SUN54_ENV 1 +#define AFS_SUN55_ENV 1 +#define AFS_SUN56_ENV 1 +#define AFS_SUN57_ENV 1 +#define AFS_SUN58_ENV 1 + +#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ + +#include + +#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ +#define RXK_LISTENER_ENV 1 +#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ + +#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ +#define AFS_SYSCALL 101 + +/* File system entry (used if mount.h doesn't define MOUNT_AFS */ +#define AFS_MOUNT_AFS "afs" + +/* Machine / Operating system information */ +#define sys_sun4x_58 1 +#define SYS_NAME "sun4x_58" +#define SYS_NAME_ID SYS_NAME_ID_sun4x_58 +#define AFSBIG_ENDIAN 1 +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ +#define AFS_HAVE_VXFS 1 /* Support cache on Veritas vxfs file system */ +#define AFS_HAVE_STATVFS 1 /* System supports statvfs */ +#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */ +#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ + +#define NEARINODE_HINT 1 /* hint to ufs module to scatter inodes on disk*/ +#define nearInodeHash(volid, hval) { \ + unsigned char* ts = (unsigned char*)&(volid)+sizeof(volid)-1;\ + for ( (hval)=0; ts >= (unsigned char*)&(volid); ts--){\ + (hval) *= 173; \ + (hval) += *ts; \ + } \ + } + +/* Extra kernel definitions (from kdefs file) */ +#ifdef KERNEL +/* sun definitions here */ +#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */ +#define AFS_SYSVLOCK 1 /* sys v locking supported */ +/*#define AFS_USEBUFFERS 1*/ +#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 UIO_SYSSPACE +#define AFS_UIOUSER UIO_USERSPACE +#define AFS_CLBYTES MCLBYTES +#define AFS_MINCHANGE 2 +#define osi_GetTime(x) uniqtime(x) + +/** + * These defines are for the 64 bit Solaris 7 port + * AFS_SYSCALL32 is used to protect the ILP32 syscall interface + * AFS_64BIT_ENV is for use of 64 bit inode numbers + */ +#if defined(__sparcv9) +#define AFS_SUN57_64BIT_ENV 1 +#define AFS_64BIT_INO 1 +#endif + +/** + * Solaris 7 64 bit has two versions of uniqtime. Since we consistently + * use 32 bit quantities for time in afs, we now use uniqtime32 + */ +#if defined(AFS_SUN57_64BIT_ENV) +#undef osi_GetTime +#define osi_GetTime(x) uniqtime32(x) +#endif + + + +#define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) +#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) +#define AFS_KFREE kmem_free +#define VATTR_NULL vattr_null +#endif KERNEL +#define AFS_DIRENT +#ifndef CMSERVERPREF +#define CMSERVERPREF +#endif +#define ROOTINO UFSROOTINO + +#endif _PARAM_SUN4X_58_H_ diff --git a/src/config/param.sun4x_58_usr.h b/src/config/param.sun4x_58_usr.h new file mode 100644 index 0000000..e6c08d3 --- /dev/null +++ b/src/config/param.sun4x_58_usr.h @@ -0,0 +1,59 @@ +#ifndef _PARAM_SUN4X_58_H_ +#define _PARAM_SUN4X_58_H_ + +#define AFS_VFS_ENV 1 +/* Used only in vfsck code; is it needed any more???? */ +#define RXK_LISTENER_ENV 1 +#define AFS_USERSPACE_IP_ADDR 1 +#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ + +#define UKERNEL 1 /* user space kernel */ +#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */ +#define AFS_ENV 1 +#define AFS_USR_SUN5_ENV 1 +#define AFS_USR_SUN6_ENV 1 +#define AFS_USR_SUN7_ENV 1 +#define AFS_USR_SUN8_ENV 1 + +#include + +/*#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ + +#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ +#define AFS_SYSCALL 101 + +/* File system entry (used if mount.h doesn't define MOUNT_AFS */ +#define AFS_MOUNT_AFS 1 + +/* Machine / Operating system information */ +#define sys_sun4x_58 1 +#define SYS_NAME "sun4x_58" +#define SYS_NAME_ID SYS_NAME_ID_sun4x_58 +#define AFSBIG_ENDIAN 1 +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ +#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ + +/* Extra kernel definitions (from kdefs file) */ +#ifdef KERNEL +#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */ +#define AFS_SYSVLOCK 1 /* sys v locking supported */ +/*#define AFS_USEBUFFERS 1*/ +#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 +#endif /* KERNEL */ +#define AFS_DIRENT +#ifndef CMSERVERPREF +#define CMSERVERPREF +#endif +#define ROOTINO UFSROOTINO + +#endif _PARAM_SUN4X_58_H_ diff --git a/src/libafs/MakefileProto.SOLARIS b/src/libafs/MakefileProto.SOLARIS index 873062a..666f5ef 100644 --- a/src/libafs/MakefileProto.SOLARIS +++ b/src/libafs/MakefileProto.SOLARIS @@ -34,7 +34,7 @@ CC = /opt/SUNWspro/bin/cc KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \ -DSYSV -dn ${ARCH_DEFS} - + KDEFS_32 = KDEFS_64 = -xarch=v9 @@ -42,17 +42,17 @@ KDEFS_64 = -xarch=v9 CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG} # Name of directory to hold object files and libraries. - + KOBJ = MODLOAD - + KOBJ = MODLOAD32 MODLOAD64 # This tells Makefile.common to use it's single directory build target. - + COMPDIRS = single_compdir - + COMPDIRS = solaris_compdirs @@ -81,7 +81,7 @@ setup: ## This is the target for a Solaris 7. Here we build both the 32 bit and ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively - + ${COMPDIRS}: for t in ${KOBJ} ; do \ echo Building directory: $$t ; \ @@ -106,7 +106,7 @@ ${COMPDIRS}: LIBAFS = libafs.o LIBAFSNONFS = libafs.nonfs.o - + DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS} DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS} @@ -130,7 +130,7 @@ ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS) $(RM) -f $@ $(LD) -r -o $@ $(AFSAOBJS) ${AFSNONFSOBJS} - + MODLOADDIR = ${DESTDIR}root.client/usr/vice/etc/modload libafs: ${LIBAFSNONFS} diff --git a/src/rx/SOLARIS/rx_knet.c b/src/rx/SOLARIS/rx_knet.c index 254b8c7..c732bc9 100644 --- a/src/rx/SOLARIS/rx_knet.c +++ b/src/rx/SOLARIS/rx_knet.c @@ -21,6 +21,9 @@ #include "../sys/stream.h" #include "../sys/tihdr.h" #include "../sys/fcntl.h" +#ifdef AFS_SUN58_ENV +#include "../netinet/ip6.h" +#endif #include "../inet/ip.h" #include "../netinet/udp.h" -- 1.9.4