--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>afs</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.openafs.filesystems.afs</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>afs</string>
+ <key>CFBundlePackageType</key>
+ <string>KEXT</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0.3</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0.3</string>
+ <key>OSBundleLibraries</key>
+ <dict>
+ <key>com.apple.kernel.bsd</key>
+ <string>1.0.0b1</string>
+ <key>com.apple.kernel.mach</key>
+ <string>1.0.0b1</string>
+ </dict>
+</dict>
+</plist>
--- /dev/null
+#!/bin/sh
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+. /etc/rc.common
+
+CheckForNetwork
+
+if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
+
+if [ -r /var/db/openafs ]; then
+ VICEETC=/var/db/openafs/etc
+ AFSD=/usr/sbin/afsd
+else
+ VICEETC=/usr/vice/etc
+ AFSD=$VICEETC/afsd
+fi
+CONFIG=$VICEETC/config
+AFSDOPT=$CONFIG/afsd.options
+PACKAGE=$CONFIG/package.options
+
+LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
+MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
+SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
+
+if [ -f $AFSDOPT ]; then
+ OPTIONS=`cat $AFSDOPT`
+else
+ OPTIONS=$MEDIUM
+fi
+
+# Need the commands ps, awk, kill, sleep
+PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
+if kmodstat | grep -q openafs ; then
+:
+else
+if [ -d $VICEETC/afs.kext ]; then
+ echo "Loading AFS kernel extensions"
+ kextload $VICEETC/afs.kext
+else
+ echo "$VICEETC/afs.kext does not exist. Skipping AFS startup."
+ exit 1
+fi
+fi
+if kmodstat | grep -q openafs ; then
+:
+else
+ echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
+fi
+
+#
+# Start the AFS server processes if a bosserver exists
+#
+
+if [ -x /usr/afs/bin/bosserver ]; then
+ echo "Starting AFS Server processes"
+ /usr/afs/bin/bosserver
+ OPTIONS="$OPTIONS -nosettime"
+ sleep 30
+fi
+
+#
+# Check that all of the client configuration files exist
+#
+
+for file in $AFSD $VICEETC/cacheinfo \
+ $VICEETC/ThisCell $VICEETC/CellServDB
+do
+ if [ ! -f ${file} ]; then
+ echo "${file} does not exist. Not starting AFS client."
+ exit 1
+ fi
+done
+
+#
+# Check that the root directory for AFS (/afs)
+# and the cache directory (/usr/vice/cache) both exist
+#
+
+for dir in `awk -F: '{print $1, $2}' $VICEETC/cacheinfo`
+do
+ if [ ! -d ${dir} ]; then
+ echo "${dir} does not exist. Not starting AFS client."
+ exit 2
+ fi
+done
+
+echo "Starting afsd"
+$AFSD $OPTIONS
+
+#
+# Run package to update the disk
+#
+if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
+ /usr/afsws/etc/package -v -o `cat $PACKAGE` > /dev/console 2>&1
+case $? in
+0)
+ (echo "Package completed successfully") > /dev/console 2>&1
+ date > /dev/console 2>&1
+ ;;
+4)
+ (echo "Rebooting to restart system") > /dev/console 2>&1
+ sync
+ /sbin/reboot
+ ;;
+*)
+ (echo "Package update failed; continuing") > /dev/console 2>&1
+ ;;
+esac
+
+fi
+
+#
+# Start AFS inetd services
+# (See the AFS Command Ref. for notes on the proper configuration of inetd.afs)
+#
+if [ -f /usr/sbin/inetd.afs -a -f /etc/inetd.conf.afs ]; then
+ /usr/sbin/inetd.afs /etc/inetd.conf.afs
+fi
--- /dev/null
+{
+ Description = "OpenAFS network file system";
+ Provides = ("AFS");
+ Requires = ("Resolver");
+ OrderPreference = "None";
+ Messages =
+ {
+ start = "Starting OpenAFS file system";
+ stop = "Stopping OpenAFS file system";
+ };
+}
--- /dev/null
+#!/bin/sh
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+. /etc/rc.common
+
+CheckForNetwork
+
+if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
+
+if [ -r /var/db/openafs ]; then
+ VICEETC=/var/db/openafs/etc
+ AFSD=/usr/sbin/afsd
+else
+ VICEETC=/usr/vice/etc
+ AFSD=$VICEETC/afsd
+fi
+CONFIG=$VICEETC/config
+AFSDOPT=$CONFIG/afsd.options
+PACKAGE=$CONFIG/package.options
+
+LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
+MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
+SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
+
+if [ -f $AFSDOPT ]; then
+ OPTIONS=`cat $AFSDOPT`
+else
+ OPTIONS=$MEDIUM
+fi
+
+# Need the commands ps, awk, kill, sleep
+PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
+if kmodstat | grep -q openafs ; then
+:
+else
+if [ -d $VICEETC/afs.ko ]; then
+ echo "Loading AFS kernel extensions"
+ kldload $VICEETC/afs.ko
+else
+ echo "$VICEETC/afs.ko does not exist. Skipping AFS startup."
+ exit 1
+fi
+fi
+if kldstat | grep -q openafs ; then
+:
+else
+ echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
+fi
+
+#
+# Start the AFS server processes if a bosserver exists
+#
+
+if [ -x /usr/afs/bin/bosserver ]; then
+ echo "Starting AFS Server processes"
+ /usr/afs/bin/bosserver
+ OPTIONS="$OPTIONS -nosettime"
+ sleep 30
+fi
+
+#
+# Check that all of the client configuration files exist
+#
+
+for file in $AFSD $VICEETC/cacheinfo \
+ $VICEETC/ThisCell $VICEETC/CellServDB
+do
+ if [ ! -f ${file} ]; then
+ echo "${file} does not exist. Not starting AFS client."
+ exit 1
+ fi
+done
+
+#
+# Check that the root directory for AFS (/afs)
+# and the cache directory (/usr/vice/cache) both exist
+#
+
+for dir in `awk -F: '{print $1, $2}' $VICEETC/cacheinfo`
+do
+ if [ ! -d ${dir} ]; then
+ echo "${dir} does not exist. Not starting AFS client."
+ exit 2
+ fi
+done
+
+echo "Starting afsd"
+$AFSD $OPTIONS
+
+#
+# Run package to update the disk
+#
+if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
+ /usr/afsws/etc/package -v -o `cat $PACKAGE` > /dev/console 2>&1
+case $? in
+0)
+ (echo "Package completed successfully") > /dev/console 2>&1
+ date > /dev/console 2>&1
+ ;;
+4)
+ (echo "Rebooting to restart system") > /dev/console 2>&1
+ sync
+ /sbin/reboot
+ ;;
+*)
+ (echo "Package update failed; continuing") > /dev/console 2>&1
+ ;;
+esac
+
+fi
+
+#
+# Start AFS inetd services
+# (See the AFS Command Ref. for notes on the proper configuration of inetd.afs)
+#
+if [ -f /usr/sbin/inetd.afs -a -f /etc/inetd.conf.afs ]; then
+ /usr/sbin/inetd.afs /etc/inetd.conf.afs
+fi
--- /dev/null
+# 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
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+AFS_OSTYPE = HPUX
+CC=/opt/ansic/bin/cc -Ae
+MT_CC=/opt/ansic/bin/cc -Ae
+XCFLAGS0=-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE
+XCFLAGS=${XCFLAGS0} +DA1.0
+XCFLAGS64=${XCFLAGS0} +DA2.0W
+MT_CFLAGS=-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}
+XLIBS=
+XLIBELFA=
+TXLIBS=/usr/lib/libHcurses.a
+MTLIBS=-L/opt/dce/lib -ldce
+SHLIB_SUFFIX=sl
+LWP_OPTMZ=-O
+OPTMZ=-O
+DBG=-g
+RANLIB=ranlib
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
+RM=/bin/rm
+CP=/bin/cp
+AR=/bin/ar
+AS=/usr/ccs/bin/as
+MV=/bin/mv
+LD=/bin/ld
+LEX=/opt/langtools/bin/lex
+DBM=/lib/libndbm.a
+PAM_CFLAGS=+DA1.0 +z -Wl,+k
+SHARE_LDFLAGS=-b -Bsymbolic
+PAMLIBS=/usr/lib/libpam.1
+YACC=/opt/langtools/bin/yacc
--- /dev/null
+# Copyright 1998 Transarc Corporation
+#
+# Keep macros within each section in sorted order for clean diff displays.
+#
+# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+AFS_OSTYPE = FBSD
+# Pointers to destination and source directories
+DESTDIR=DEST/
+SRCDIR=DEST/
+# 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.5-15 2.2.10 2.2.12 2.2.12-20 2.2.13 2.2.14
+
+#
+# compilation and link editor flags
+DBG=-g
+OPTMZ=-O2
+PAM_CFLAGS = -O2 -pipe -fPIC
+# Put -O2 here to _ensure_ all Makefiles pick it up.
+XCFLAGS= -O2 -pipe
+MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
+XLDFLAGS=
+SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_SUFFIX=so
+SHLIB_CFLAGS=
+#
+# libraries
+MTLIBS=-pthread
+TXLIBS= /usr/lib/libncurses.so
+XLIBS=-lcompat
+#
+# 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
--- /dev/null
+# Keep macros within each section in sorted order for clean diff displays.
+#
+# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+AFS_OSTYPE = DARWIN
+#
+# Pointers to destination and source directories
+DESTDIR=DEST/
+DESTDIR=DEST/
+#
+# compilation and link editor flags
+XCFLAGS=-traditional-cpp
+#MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
+#MT_CC=cc
+KROOT=
+KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
+#SHARE_LDFLAGS =
+LWP_OPTMZ=-g
+OPTMZ=-g
+DBG=-g
+REGEX_OBJ=regex.o
+
+
+#
+# libraries
+#XLIBS=
+TXLIBS=
+#MTLIBS=
+#XLIBELFA=
+#XLIBKVM=
+#
+SHLIB_SUFFIX=
+SHLIB_CFLAGS=
+#
+# programs
+AR=ar
+AS=as
+CC=cc
+CP=cp
+INSTALL=${DESTDIR}bin/pinstall
+LEX=lex -l
+LD= ld
+LORDER = lorder
+MV=mv
+RANLIB=ranlib
+RM=rm
+STRIP= strip
--- /dev/null
+# Keep macros within each section in sorted order for clean diff displays.
+#
+# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+AFS_OSTYPE = DARWIN
+#
+# Pointers to destination and source directories
+DESTDIR=DEST/
+DESTDIR=DEST/
+#
+# compilation and link editor flags
+XCFLAGS=-traditional-cpp
+#MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
+#MT_CC=cc
+KROOT=
+KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
+#SHARE_LDFLAGS =
+LWP_OPTMZ=-g
+OPTMZ=-g
+DBG=-g
+REGEX_OBJ=regex.o
+
+
+#
+# libraries
+#XLIBS=
+TXLIBS=
+#MTLIBS=
+#XLIBELFA=
+#XLIBKVM=
+#
+SHLIB_SUFFIX=
+SHLIB_CFLAGS=
+#
+# programs
+AR=ar
+AS=as
+CC=cc
+CP=cp
+INSTALL=${DESTDIR}bin/pinstall
+LEX=lex -l
+LD= ld
+LORDER = lorder
+MV=mv
+RANLIB=ranlib
+RM=rm
+STRIP= strip
--- /dev/null
+#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 <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 "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 <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
+#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_ */
--- /dev/null
+#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 <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 "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_ */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT */
+
+#ifndef _PARAM_HP_UX10_2_H_
+#define _PARAM_HP_UX10_2_H_
+
+#define AFS_HPUX_ENV 1
+#define AFS_HPUX90_ENV 1
+#define AFS_HPUX100_ENV 1
+#define AFS_HPUX101_ENV 1
+#define AFS_HPUX102_ENV 1
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_SYSCALL 48 /* slot reserved for AFS */
+
+/* Machine / Operating system information */
+#define SYS_NAME "hp_ux102"
+#define SYS_NAME_ID SYS_NAME_ID_hp_ux102
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1
+#define AFS_HAVE_STATVFS 1 /* System supports statvfs */
+#define AFS_GLOBAL_SUNLOCK 1
+#define RXK_LISTENER_ENV 1
+#define AFS_USERSPACE_IP_ADDR 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+/*
+ * #define AFS_VM_RDWR_ENV 1
+ */
+#define AFS_TEXT_ENV 1 /* Older kernels use TEXT */
+#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
+#define _KERNEL 1
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_seg
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIOSEG_KERNEL
+#define AFS_UIOUSER UIOSEG_USER
+#define AFS_CLBYTES CLBYTES
+#define AFS_MINCHANGE 2
+#define osi_GetTime(x) do { struct timeval osi_GetTimeVar; uniqtime(&osi_GetTimeVar); (x)->tv_sec = osi_GetTimeVar.tv_sec; (x)->tv_usec = osi_GetTimeVar.tv_usec; } while(0)
+#define AFS_KALLOC kmem_alloc
+#define AFS_KFREE kmem_free
+#define VATTR_NULL vattr_null
+
+#if defined(__LP64__)
+#define AFS_HPUX_64BIT_ENV 1
+#endif
+
+#ifndef UKERNEL
+/*
+ * On HP-UX, sys/socket.h includes sys/uio.h, and sys/file.h and
+ * sys/uio.h #include each other, and there's no simple way to avoid a
+ * warning about the struct uio declaration not being visible outside
+ * of some prototype or other. So, we put in a tenative declaration to
+ * supress the warnings.
+ */
+struct uio;
+#endif
+#endif /* KERNEL */
+#define AFS_DIRENT
+/* Non-standard definitions */
+#ifndef EDQUOT
+#define EDQUOT 69 /* Disc quota exceeded */
+#endif
+
+#endif /* _PARAM_HP_UX10_2_H_ */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _PARAM_USR_HPUX102_H_
+#define _PARAM_USR_HPUX102_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_HPUX_ENV 1
+
+#include <afs/afs_sysnames.h>
+
+/*#define AFS_GLOBAL_SUNLOCK 1*/ /* For global locking */
+
+#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */
+
+#define AFS_SYSCALL 48 /* slot reserved for AFS */
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS 1
+
+/* Machine / Operating system information */
+#define SYS_NAME "hp_ux102"
+#define SYS_NAME_ID SYS_NAME_ID_hp_ux102
+#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 CLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+#endif /* KERNEL */
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif /* _PARAM_USR_HPUX102_H_ */
--- /dev/null
+#ifndef _PARAM_FBSD_42_H_
+#define _PARAM_FBSD_42_H_
+
+#include <sys/param.h>
+
+#define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
+#define AFS_X86_XBSD_ENV 1
+
+#define AFS_FBSD_ENV 1
+#define AFS_FBSD40_ENV 1
+#define AFS_FBSD42_ENV 1
+#define AFS_X86_FBSD_ENV 1
+#define AFS_X86_FBSD40_ENV 1
+#define AFS_X86_FBSD42_ENV 1
+#define AFS_X86_ENV 1
+#define AFS_NONFSTRANS 1
+#define AFS_KERBEROS_ENV
+#define O_SYNC O_FSYNC
+#define FTRUNC O_TRUNC
+
+#define IUPD 0x0010
+#define IACC 0x0020
+#define ICHG 0x0040
+#define IMOD 0x0080
+
+#define IN_LOCK(ip) lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+ (struct simplelock *)0, curproc)
+#define IN_UNLOCK(ip) lockmgr(&ip->i_lock, LK_RELEASE, \
+ (struct simplelock *)0, curproc)
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_VM_RDWR_ENV 1
+#define AFS_VFS_ENV 1
+#define AFS_VFSINCL_ENV 1
+#define AFS_GREEDY43_ENV 1
+#define AFS_ENV 1
+#define AFS_MINPHYS_ENV 1
+#define CMUSTD_ENV 1
+
+#define AFS_SYSCALL 210
+#define AFS_MOUNT_AFS "afs"
+
+#ifndef MOUNT_UFS
+#define MOUNT_UFS 1
+#endif
+
+#ifndef MOUNT_AFS
+#define MOUNT_AFS AFS_MOUNT_AFS
+#endif
+#define SYS_NAME "i386_fbsd_42"
+#define SYS_NAME_ID SYS_NAME_ID_i386_fbsd_42
+
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't supports statvfs */
+
+#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
+#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode spares */
+#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
+
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+#include <machine/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
+#define AFSBIG_ENDIAN 1
+#else
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define AFSLITTLE_ENDIAN 1
+#else
+#error machine/endian.h must define BYTE_ORDER!
+#endif
+#endif
+#endif /* ! ASSEMBLER && ! __LANGUAGE_ASSEMBLY__ */
+
+#define NEARINODE_HINT 1 /* hint to ufs module to scatter inodes on disk*/
+#define nearInodeHash(volid, hval) { \
+ unsigned char* ts = (unsigned char*)&(volid);\
+ for ((hval)=0; ts<(unsigned char*)&(volid)+sizeof(volid);ts++){\
+ (hval) *= 173; \
+ (hval) += *ts; \
+ } \
+ }
+
+/* Extra kernel definitions (from kdefs file) */
+#ifdef _KERNEL
+#define AFS_GLOBAL_SUNLOCK 1
+#define AFS_VFS34 1 /* What is VFS34??? */
+#define AFS_SHORTGID 1 /* are group id's short? */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES CLBYTES
+#define osi_GetTime(x) microtime(x)
+#define AFS_KALLOC(x) kalloc(x)
+#define AFS_KFREE(x,y) kfree(x,y)
+#define v_count v_usecount
+#define v_vfsp v_mount
+#define vfs_bsize mnt_stat.f_bsize
+#define vfs_fsid mnt_stat.f_fsid
+#define va_nodeid va_fileid
+#define vfs_vnodecovered mnt_vnodecovered
+#define direct dirent
+#define vnode_t struct vnode
+
+#ifndef MUTEX_DEFAULT
+#define MUTEX_DEFAULT 0
+#endif /* MUTEX_DEFAULT */
+
+#ifndef SSYS
+#define SSYS 0x00002
+#endif /* SSYS */
+
+#define p_rcred p_ucred
+
+#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
+#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
+
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+enum vcexcl {NONEXCL, EXCL};
+
+#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 /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+#endif /* _KERNEL */
+
+#endif /* _PARAM_FBSD_42_H_ */
--- /dev/null
+#ifndef _PARAM_USR_I386_FBSD_42_H_
+#define _PARAM_USR_I386_FBSD_42_H_
+
+
+#define UKERNEL 1 /* user space kernel */
+#define AFS_ENV 1
+#define AFS_VFSINCL_ENV 1
+#define AFS_USR_FBSD40_ENV 1
+#define AFS_USR_FBSD42_ENV 1
+#define AFS_USR_FBSD_ENV 1
+#define AFS_NONFSTRANS 1
+#define AFS_KERBEROS_ENV
+
+#define O_SYNC O_FSYNC
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 210
+#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 "i386_fbsd_42"
+#define SYS_NAME_ID SYS_NAME_ID_i386_fbsd_42
+#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
+
+#include <limits.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/fcntl.h>
+#include <netinet/in.h>
+#include <sys/uio.h>
+#include <sys/socket.h>
+
+#endif /* _PARAM_USR_I386_FBSD_42_H_ */
--- /dev/null
+#ifndef _PARAM_PPC_DARWIN_H_
+#define _PARAM_PPC_DARWIN_H_
+
+#define AFS_ENV 1
+#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
+#define AFS_PPC_ENV 1
+#define AFS_VFSINCL_ENV 1
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_DARWIN_ENV
+#define AFS_NONFSTRANS
+#define AFS_SYSCALL 230
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS "afs"
+
+/* Machine / Operating system information */
+#define sys_ppc_darwin_12 1
+#define SYS_NAME "ppc_darwin_12"
+#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_12
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+
+#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
+#define RXK_LISTENER_ENV 1
+
+#ifdef KERNEL
+#undef MACRO_BEGIN
+#undef MACRO_END
+#include <kern/macro_help.h>
+#define AFS_GLOBAL_SUNLOCK 1
+#define AFS_VFS34 1 /* What is VFS34??? */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES CLBYTES
+#define osi_GetTime(x) microtime(x)
+#define AFS_KALLOC(x) kalloc(x)
+#define AFS_KFREE(x,y) kfree(x,y)
+#define v_count v_usecount
+#define v_vfsp v_mount
+#define vfs_bsize mnt_stat.f_bsize
+#define vfs_fsid mnt_stat.f_fsid
+#define va_nodeid va_fileid
+#define vfs_vnodecovered mnt_vnodecovered
+#define direct dirent
+#define vnode_t struct vnode
+
+#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
+#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
+
+#endif
+#endif _PARAM_PPC_DARWIN_H_
--- /dev/null
+#ifndef _PARAM_PPC_DARWIN_H_
+#define _PARAM_PPC_DARWIN_H_
+
+#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
+#define AFS_ENV 1
+#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
+#define AFS_PPC_ENV 1
+
+#include <afs/afs_sysnames.h>
+#define AFS_USERSPACE_ENV
+#define AFS_USR_DARWIN_ENV
+#define AFS_NONFSTRANS
+#define AFS_SYSCALL 230
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS "afs"
+
+/* Machine / Operating system information */
+#define sys_ppc_darwin_12 1
+#define SYS_NAME "ppc_darwin_12"
+#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_12
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+#define RXK_LISTENER_ENV 1
+
+#define AFS_VFS34 1 /* What is VFS34??? */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif _PARAM_PPC_DARWIN_H_
--- /dev/null
+#ifndef _PARAM_PPC_DARWIN_H_
+#define _PARAM_PPC_DARWIN_H_
+
+#define AFS_ENV 1
+#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
+#define AFS_PPC_ENV 1
+#define AFS_VFSINCL_ENV 1
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_DARWIN_ENV
+#define AFS_DARWIN13_ENV
+#define AFS_NONFSTRANS
+#define AFS_SYSCALL 230
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS "afs"
+
+/* Machine / Operating system information */
+#define sys_ppc_darwin_12 1
+#define sys_ppc_darwin_13 1
+#define SYS_NAME "ppc_darwin_13"
+#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_13
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+
+#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
+#define RXK_LISTENER_ENV 1
+
+#ifdef KERNEL
+#undef MACRO_BEGIN
+#undef MACRO_END
+#include <kern/macro_help.h>
+#define AFS_GLOBAL_SUNLOCK 1
+#define AFS_VFS34 1 /* What is VFS34??? */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES CLBYTES
+#define osi_GetTime(x) microtime(x)
+#define AFS_KALLOC(x) kalloc(x)
+#define AFS_KFREE(x,y) kfree(x,y)
+#define v_count v_usecount
+#define v_vfsp v_mount
+#define vfs_bsize mnt_stat.f_bsize
+#define vfs_fsid mnt_stat.f_fsid
+#define va_nodeid va_fileid
+#define vfs_vnodecovered mnt_vnodecovered
+#define direct dirent
+#define vnode_t struct vnode
+
+#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
+#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
+
+#endif
+#endif _PARAM_PPC_DARWIN_H_
--- /dev/null
+#ifndef _PARAM_PPC_DARWIN_H_
+#define _PARAM_PPC_DARWIN_H_
+
+#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
+#define AFS_ENV 1
+#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
+#define AFS_PPC_ENV 1
+
+#include <afs/afs_sysnames.h>
+#define AFS_USERSPACE_ENV
+#define AFS_USR_DARWIN_ENV
+#define AFS_USR_DARWIN13_ENV
+#define AFS_NONFSTRANS
+#define AFS_SYSCALL 230
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS "afs"
+
+/* Machine / Operating system information */
+#define sys_ppc_darwin_12 1
+#define sys_ppc_darwin_13 1
+#define SYS_NAME "ppc_darwin_13"
+#define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_13
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+#define RXK_LISTENER_ENV 1
+
+#define AFS_VFS34 1 /* What is VFS34??? */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif _PARAM_PPC_DARWIN_H_
--- /dev/null
+/*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Machine-type definitions: Alpha
+ */
+
+#include <mit-cpyright.h>
+
+#define ALPHA
+
+/* 'course this is a joke, but I am not going to rewrite this mess */
+#define BITS32
+
+#define BIG
+#define LSBFIRST
--- /dev/null
+#define BITS32
+#define BIG
+#undef BSDUNIX
+#define MSBFIRST
+#define MUSTALIGN
+
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+#Placeholder for extra definitions
--- /dev/null
+#/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
+# $Header: /tmp/cvstemp/openafs/src/libafs/Attic/MakefileProto.DARWIN,v 1.1 2001/04/23 18:43:17 hartmans Exp $
+#
+# MakefileProto for Digital Unix systems
+#
+
+DESTDIR=DEST/
+include $(DESTDIR)../obj/config/Makefile.${SYS_NAME}
+
+
+# OS specific object files:
+AFS_OS_OBJS = \
+ osi_misc.o \
+ osi_file.o \
+ osi_inode.o \
+ osi_groups.o \
+ osi_sleep.o \
+ osi_vm.o \
+ osi_vnodeops.o \
+ osi_module.o \
+ xdr.o \
+ xdr_array.o
+
+
+#AFS_OS_NFSOBJS = osi_vfsops_nfs.o
+
+AFS_OS_NONFSOBJS = osi_vfsops.o
+
+
+# System specific build commands and flags
+KDEFS=
+DBUG = -g
+DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
+OPTF=${OPT}
+OPTF2=${OPT2}
+KOPTS=-traditional-cpp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch
+#CFLAGS=-Werror-implicit-function-declaration -I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+#CFLAGS=-framework Kernel -I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+
+
+# Name of directory to hold object files and libraries.
+KOBJ = MODLOAD
+
+# This tells Makefile.common to use it's single directory build target.
+COMPDIRS = single_compdir
+
+include Makefile.common
+
+setup:
+ -mkdir $(KOBJ)
+ -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
+ ln -s ../Makefile $(KOBJ)/Makefile
+ ln -s ../Makefile.common $(KOBJ)/Makefile.common
+ -rm -f h net netinet rpc ufs nfs machine sys vm mach kern
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/net net
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/machine machine
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/netinet netinet
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/nfs nfs
+ -ln -s /usr/include/rpc rpc
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/sys sys
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/ufs ufs
+ -ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/sys h
+
+
+# Below this line are targets when in the COMMON directory:
+LIBAFS = libafs.o
+LIBAFSNONFS = libafs.nonfs.o
+
+DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs-nfs
+DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
+
+
+libafs: $(DEST_LIBAFSNONFS) ;
+
+
+$(DEST_LIBAFS): $(LIBAFS)
+ $(INSTALL) -f $? $@
+
+$(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
+ $(INSTALL) -f $? $@
+
+${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
+ $(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
+
+${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
+ $(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
+
+
+# Object build rules:
+osi_groups.o: $(AFS)/osi_groups.c
+ $(CRULE1)
+osi_file.o: $(AFS)/osi_file.c
+ $(CRULE1)
+osi_inode.o: $(AFS)/osi_inode.c
+ $(CRULE1)
+osi_misc.o: $(AFS)/osi_misc.c
+ $(CRULE1)
+osi_sleep.o: $(AFS)/osi_sleep.c
+ $(CRULE1)
+osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
+ $(CRULE1) -o osi_vfsops_nfs.o
+osi_vfsops.o: $(AFS)/osi_vfsops.c
+ $(CRULE1) -DAFS_NONFSTRANS
+osi_vm.o: $(AFS)/osi_vm.c
+ $(CRULE1)
+osi_vnodeops.o: $(AFS)/osi_vnodeops.c
+ $(CRULE1)
+osi_module.o: $(AFS)/osi_module.c
+ $(CRULE1)
+xdr.o: $(RX)/xdr.c
+ $(CRULE1);
+xdr_array.o: $(RX)/xdr_array.c
+ $(CRULE1);
+
--- /dev/null
+#/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
+#
+# MakefileProto for Digital Unix systems
+#
+
+DESTDIR=DEST/
+# include $(DESTDIR)/../obj/config/Makefile.${SYS_NAME}
+
+
+# OS specific object files:
+AFS_OS_OBJS = \
+ osi_groups.o \
+ osi_file.o \
+ osi_inode.o \
+ osi_misc.o \
+ osi_sleep.o \
+ osi_vm.o \
+ osi_vnodeops.o
+
+AFS_OS_NFSOBJS = \
+ osi_vfsops_nfs.o
+
+AFS_OS_NONFSOBJS = \
+ osi_vfsops.o
+
+
+# System specific build commands and flags
+# KDEFS=-DLANGUAGE_C -I/usr/sys/include -I../include \
+# -I/usr/src/sys/${HEADER_RT} -I/usr/src/sys/sys \
+# -DSWAPTYPE=1 -DUERF -DOSF -DCOMPAT_43 -DUFS \
+# -DRT -DKERNEL -D_KERNEL
+KDEFS=-Wall -fformat-extensions -ansi -nostdinc -I/usr/include -D_KERNEL \
+ -elf -mpreferred-stack-boundary=2 -I/usr/src/sys/sys -I../afs
+DBUG = -O2
+DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
+OPTF=${OPT}
+OPTF2=${OPT2}
+CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+
+
+# Name of directory to hold object files and libraries.
+KOBJ = STATIC
+
+# This tells Makefile.common to use it's single directory build target.
+COMPDIRS = single_compdir
+
+include Makefile.common
+
+setup:
+ -mkdir $(KOBJ)
+ -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
+ ln -s ../Makefile $(KOBJ)/Makefile
+ ln -s ../Makefile.common $(KOBJ)/Makefile.common
+ -rm -f h net netinet rpc ufs nfs machine sys vm
+ -ln -s /usr/src/sys/net net
+ -ln -s /usr/src/sys/i386/include machine
+ -ln -s /usr/src/sys/netinet netinet
+ -ln -s /usr/src/sys/nfs nfs
+ -ln -s /usr/include/rpc rpc
+ -ln -s /usr/src/sys/sys sys
+ -ln -s /usr/src/sys/ufs/ufs ufs
+ -ln -s /usr/src/sys/sys h
+ -ln -s /usr/src/sys/vm vm
+ -touch $(KOBJ)/sec_net.h
+
+
+# Below this line are targets when in the COMMON directory:
+LIBAFS = libafs.o
+LIBAFSNONFS = libafs.nonfs.o
+
+DEST_LIBAFS = ${DESTDIR}/root.client/bin/${LIBAFS}
+DEST_LIBAFSNONFS = ${DESTDIR}/root.client/bin/${LIBAFSNONFS}
+
+
+# libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
+# libafs: $(DEST_LIBAFSNONFS)
+libafs:
+ echo WARNING: No kernel module for ${SYS_NAME}
+
+
+$(DEST_LIBAFS): $(LIBAFS)
+ $(INSTALL) -f $? $@
+
+$(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
+ $(INSTALL) -f $? $@
+
+${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
+ $(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
+
+${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
+ $(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
+
+
+# Object build rules:
+osi_groups.o: $(AFS)/osi_groups.c
+ $(CRULE1)
+osi_file.o: $(AFS)/osi_file.c
+ $(CRULE1)
+osi_inode.o: $(AFS)/osi_inode.c
+ $(CRULE1)
+osi_misc.o: $(AFS)/osi_misc.c
+ $(CRULE1)
+osi_sleep.o: $(AFS)/osi_sleep.c
+ $(CRULE1)
+osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
+ $(CRULE1) -o osi_vfsops_nfs.o
+osi_vfsops.o: $(AFS)/osi_vfsops.c
+ $(CRULE1) -DAFS_NONFSTRANS
+osi_vm.o: $(AFS)/osi_vm.c
+ $(CRULE1)
+osi_vnodeops.o: $(AFS)/osi_vnodeops.c
+ $(CRULE1)
--- /dev/null
+#!/bin/sh
+# This is a bridge script until we take care of tightly linking Linux inode
+# internals to AFS vnode internals
+
+IBYTES=""
+SETATTR=""
+
+grep i_bytes /lib/modules/$1/build/include/linux/fs.h > /dev/null
+if [ $? = 0 ]; then
+ IBYTES="-DSTRUCT_INODE_HAS_I_BYTES=1"
+fi
+grep "extern int inode_setattr" /lib/modules/$1/build/include/linux/fs.h > /dev/null
+if [ $? = 0 ]; then
+ SETATTR="-DINODE_SETATTR_NOT_VOID=1"
+fi
+
+/bin/rm $2
+echo "KDEFINES = ${IBYTES} ${SETATTR}" > $2
+exit 0
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# MakefileProto for Solaris systems
+#
+
+include ../config/Makefile.${SYS_NAME}
+
+MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
+
+# System specific build commands and flags
+CC = cc
+DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
+KOPTS=
+CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG} $(XCFLAGS)
+OPTF=-O
+# WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
+
+TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV
+TEST_LDFLAGS=
+TEST_LIBS=
+
+LIBUAFS = libuafs.a
+LIBAFSWEB = nsafs.so
+LIBAFSWEBKRB = nsafs.krb.so
+
+include Makefile.common
+
+setup_common:
+ -rm -f h net netinet rpc ufs nfs machine sys inet nsapi
+ -ln -s /usr/include/sys h
+ -ln -s /usr/include/net net
+ -ln -s /usr/include/netinet netinet
+ -ln -s /usr/include/rpc rpc
+ -ln -s /usr/include/sys sys
+ -ln -s /usr/include/nfs nfs
+ -ln -s /usr/include/inet inet
+ -ln -s /usr/include/ufs ufs
+ -ln -s $(NS_INCL) nsapi
+
+setup_uafs: setup_common
+ set UAFS; $(MKDIR_IF_NEEDED)
+ -rm -f UAFS/Makefile UAFS/Makefile.common
+ ln -s ../Makefile UAFS/Makefile
+ ln -s ../Makefile.common UAFS/Makefile.common
+
+setup_nsafs: setup_common
+ set AFSWEB; $(MKDIR_IF_NEEDED)
+ -rm -f AFSWEB/Makefile AFSWEB/Makefile.common
+ ln -s ../Makefile AFSWEB/Makefile
+ ln -s ../Makefile.common AFSWEB/Makefile.common
+
+UAFS/$(LIBUAFS): setup_uafs
+ cd UAFS; \
+ $(MAKE) $(LIBUAFS) DESTDIR=${DESTDIR}; \
+ ranlib $(LIBUAFS)
+
+AFSWEB/$(LIBAFSWEB): setup_nsafs
+ cd AFSWEB; \
+ $(MAKE) $(LIBAFSWEB) DESTDIR=${DESTDIR}
+
+AFSWEB/$(LIBAFSWEBKRB): setup_nsafs
+ cd AFSWEB; \
+ $(MAKE) $(LIBAFSWEBKRB) DESTDIR=${DESTDIR}
+
+# Below this line are targets when in the COMMON directory:
+
+$(LIBUAFS): $(UAFSOBJ)
+ -rm -f $(LIBUAFS)
+ $(AR) $(ARFLAGS) $(LIBUAFS) $(UAFSOBJ)
+
+$(LIBAFSWEB): $(AFSWEBOBJ) ${DES}/libdes.a
+ -rm -f $(LIBAFSWEB)
+ ld -b $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS)
+
+$(LIBAFSWEBKRB): $(AFSWEBOBJKRB) ${DES}/libdes.a
+ -rm -f $(LIBAFSWEBKRB)
+ ld -b $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS)
--- /dev/null
+#/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
+#
+# MakefileProto for Solaris systems
+#
+
+include ../config/Makefile.${SYS_NAME}
+
+MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
+
+# System specific build commands and flags
+CC = gcc
+DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
+KOPTS=
+CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+OPTF=-O
+# WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
+
+TEST_CFLAGS=-pthread -D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_FBSD40_ENV
+TEST_LDFLAGS=
+TEST_LIBS=
+
+LIBUAFS = libuafs.a
+LIBAFSWEB = nsafs.so
+LIBAFSWEBKRB = nsafs.krb.so
+
+include Makefile.common
+
+setup_common:
+ -rm -f h net netinet rpc ufs nfs machine sys inet nsapi
+ -ln -s /usr/include/sys h
+ -ln -s /usr/include/net net
+ -ln -s /usr/include/netinet netinet
+ -ln -s /usr/include/rpc rpc
+ -ln -s /usr/include/sys sys
+ -ln -s /usr/include/nfs nfs
+ -ln -s /usr/include/inet inet
+ -ln -s /usr/include/ufs ufs
+ -ln -s $(NS_INCL) nsapi
+
+setup_uafs: setup_common
+ set UAFS; $(MKDIR_IF_NEEDED)
+ -rm -f UAFS/Makefile UAFS/Makefile.common
+ ln -s ../Makefile UAFS/Makefile
+ ln -s ../Makefile.common UAFS/Makefile.common
+
+setup_nsafs: setup_common
+ set AFSWEB; $(MKDIR_IF_NEEDED)
+ -rm -f AFSWEB/Makefile AFSWEB/Makefile.common
+ ln -s ../Makefile AFSWEB/Makefile
+ ln -s ../Makefile.common AFSWEB/Makefile.common
+
+UAFS/$(LIBUAFS): setup_uafs
+ cd UAFS; \
+ $(MAKE) $(LIBUAFS) DESTDIR=${DESTDIR}
+
+AFSWEB/$(LIBAFSWEB): setup_nsafs
+cd AFSWEB; \
+ $(MAKE) $(LIBAFSWEB) DESTDIR=${DESTDIR}
+
+AFSWEB/$(LIBAFSWEBKRB): setup_nsafs
+ cd AFSWEB; \
+ $(MAKE) $(LIBAFSWEBKRB) DESTDIR=${DESTDIR}
+
+# Below this line are targets when in the COMMON directory:
+
+$(LIBUAFS): $(UAFSOBJ)
+ -rm -f $(LIBUAFS)
+ $(AR) $(ARFLAGS) $(LIBUAFS) $(UAFSOBJ)
+
+$(LIBAFSWEB): $(AFSWEBOBJ) ${DES}/libdes.a
+ -rm -f $(LIBAFSWEB)
+ ld -b $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS)
+
+$(LIBAFSWEBKRB): $(AFSWEBOBJKRB) ${DES}/libdes.a
+ -rm -f $(LIBAFSWEBKRB)
+ ld -b $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS)
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#define IGNORE_STDS_H 1
+/* Sun 386i... I hope this does the right thing!!!
+ *
+ * Written by Derek Atkins <warlord@MIT.EDU>
+ * (debugging help by Chris Provenzano <proven@mit.edu>)
+ * 11/1991
+ *
+ * "ojala que es correcto!"
+ */
+ .file "process.s"
+
+ .data
+
+ .text
+
+/*
+ * struct savearea {
+ * char *topstack;
+ * }
+ */
+
+ .set topstack,0
+
+/*
+ * savecontext(f, area1, newsp)
+ * int (*f)(); struct savearea *area1; char *newsp;
+ */
+
+/* offsets, to make my life easier! */
+ .set f,8
+ .set area1,12
+ .set newsp,16
+
+
+.globl PRE_Block
+.globl savecontext
+
+savecontext:
+ pushl %ebp /* New Frame! */
+ movl %esp,%ebp
+ pusha /* Push all registers */
+ movl $1,PRE_Block /* Pre-emption code */
+ movl area1(%ebp),%eax /* eax = base of savearea */
+ movl %esp,(%eax) /* area->topstack = esp */
+ movl newsp(%ebp),%eax /* get new sp into eax */
+ cmpl $0,%eax
+ je L1 /* if new sp is 0 then dont change esp */
+ movl %eax,%esp /* go ahead. make my day! */
+L1:
+ jmp *f(%ebp) /* ebx = &f */
+
+/* Shouldnt be here....*/
+
+ call abort
+
+/*
+ * returnto(area2)
+ * struct savearea *area2;
+ */
+
+/* stack offset */
+ .set area2,8
+
+.globl returnto
+
+returnto:
+ pushl %ebp
+ movl %esp, %ebp /* New frame, to get correct pointer */
+ movl area2(%ebp),%eax /* eax = area2 */
+ movl (%eax),%esp /* restore esp */
+ popa
+ movl $0,PRE_Block /* clear it up... */
+ popl %ebp
+ ret
+
+/* I see, said the blind man, as he picked up his hammer and saw! */
+ pushl $1234
+ call abort
+
+
+
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/*
+ * rx_kmutex.h - mutex and condition variable macros for kernel environment.
+ *
+ * MACOS implementation.
+ */
+
+#ifndef _RX_KMUTEX_H_
+#define _RX_KMUTEX_H_
+
+#include <sys/lock.h>
+#include <kern/thread.h>
+#include <sys/vm.h>
+
+#define RX_ENABLE_LOCKS 1
+#define AFS_GLOBAL_RXLOCK_KERNEL
+
+/*
+ * Condition variables
+ *
+ * In Digital Unix (OSF/1), we use something akin to the ancient sleep/wakeup
+ * mechanism. The condition variable itself plays no role; we just use its
+ * address as a convenient unique number.
+ *
+ * XXX in darwin, both mach and bsd facilities are available. Should really
+ * stick to one or the other (but mach locks don't have a _try.....)
+ */
+#define CV_INIT(cv,a,b,c)
+#define CV_DESTROY(cv)
+#define CV_WAIT(cv, lck) { \
+ int isGlockOwner = ISAFS_GLOCK(); \
+ if (isGlockOwner) AFS_GUNLOCK(); \
+ assert_wait((event_t)(cv), 0); \
+ MUTEX_EXIT(lck); \
+ thread_block(0); \
+ if (isGlockOwner) AFS_GLOCK(); \
+ MUTEX_ENTER(lck); \
+ }
+
+#define CV_TIMEDWAIT(cv,lck,t) { \
+ int isGlockOwner = ISAFS_GLOCK(); \
+ if (isGlockOwner) AFS_GUNLOCK(); \
+ assert_wait((event_t)(cv), 0); \
+ thread_set_timer(t, NSEC_PER_SEC/hz); \
+ MUTEX_EXIT(lck); \
+ thread_block(0); \
+ if (isGlockOwner) AFS_GLOCK(); \
+ MUTEX_ENTER(lck); \
+
+#define CV_SIGNAL(cv) thread_wakeup_one((event_t)(cv))
+#define CV_BROADCAST(cv) thread_wakeup((event_t)(cv))
+
+typedef struct {
+ struct lock__bsd__ lock;
+ thread_t owner;
+} afs_kmutex_t;
+typedef int afs_kcondvar_t;
+
+#define osi_rxWakeup(cv) thread_wakeup((event_t)(cv))
+
+#define LOCK_INIT(a,b) \
+ do { \
+ lockinit(&(a)->lock,PSOCK, "afs rx lock", 0, 0); \
+ (a)->owner = (thread_t)0; \
+ } while(0);
+#define MUTEX_INIT(a,b,c,d) \
+ do { \
+ lockinit(&(a)->lock,PSOCK, "afs rx mutex", 0, 0); \
+ (a)->owner = (thread_t)0; \
+ } while(0);
+#define MUTEX_DESTROY(a) \
+ do { \
+ (a)->owner = (thread_t)-1; \
+ } while(0);
+#define MUTEX_ENTER(a) \
+ do { \
+ lockmgr(&(a)->lock, LK_EXCLUSIVE, 0, current_proc()); \
+ osi_Assert((a)->owner == (thread_t)0); \
+ (a)->owner = current_thread(); \
+ } while(0);
+#define MUTEX_TRYENTER(a) \
+ ( lockmgr(&(a)->lock, LK_EXCLUSIVE|LK_NOWAIT, 0, current_proc()) ? 0 : ((a)->owner = current_thread(), 1) )
+#define xMUTEX_TRYENTER(a) \
+ ( osi_Assert((a)->owner == (thread_t)0), (a)->owner = current_thread(), 1)
+#define MUTEX_EXIT(a) \
+ do { \
+ osi_Assert((a)->owner == current_thread()); \
+ (a)->owner = (thread_t)0; \
+ lockmgr(&(a)->lock, LK_RELEASE, 0, current_proc()); \
+ } while(0);
+
+#undef MUTEX_ISMINE
+#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == current_thread())
+
+#undef osirx_AssertMine
+extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
+
+#endif /* _RX_KMUTEX_H_ */
+
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#include "../afs/param.h"
+#include "../rx/rx_kcommon.h"
+
+int osi_NetReceive(asocket, addr, dvec, nvecs, alength)
+ struct socket *asocket;
+ struct sockaddr_in *addr;
+ struct iovec *dvec;
+ int nvecs;
+ int *alength;
+{
+ struct uio u;
+ int i;
+ struct iovec iov[RX_MAXIOVECS];
+ struct sockaddr *sa;
+ int code;
+
+ int haveGlock = ISAFS_GLOCK();
+ /*AFS_STATCNT(osi_NetReceive);*/
+
+ if (nvecs > RX_MAXIOVECS) {
+ osi_Panic("osi_NetReceive: %d: Too many iovecs.\n", nvecs);
+ }
+
+ for (i = 0 ; i < nvecs ; i++) {
+ iov[i].iov_base = dvec[i].iov_base;
+ iov[i].iov_len = dvec[i].iov_len;
+ }
+
+ u.uio_iov=&iov[0];
+ u.uio_iovcnt=nvecs;
+ u.uio_offset=0;
+ u.uio_resid=*alength;
+ u.uio_segflg=UIO_SYSSPACE;
+ u.uio_rw=UIO_READ;
+ u.uio_procp=NULL;
+
+ if (haveGlock) {
+ AFS_GUNLOCK();
+ }
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
+#endif
+ code = soreceive(asocket, &sa, &u, NULL, NULL, NULL);
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+#endif
+ if (haveGlock) {
+ AFS_GLOCK();
+ }
+ *alength=*alength-u.uio_resid;
+ if (sa) {
+ if (sa->sa_family == AF_INET) {
+ if (addr) *addr=*(struct sockaddr_in *)sa;
+ } else {
+ printf("Unknown socket family %d in NetReceive\n");
+ }
+ }
+ return code;
+}
+
+extern int rxk_ListenerPid;
+void osi_StopListener(void)
+{
+ struct proc *p;
+
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
+#endif
+ soclose(rx_socket);
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+#endif
+ p=pfind(rxk_ListenerPid);
+ if (p)
+ psignal(p, SIGUSR1);
+}
+
+/* rx_NetSend - send asize bytes at adata from asocket to host at addr.
+ *
+ * Now, why do we allocate a new buffer when we could theoretically use the one
+ * pointed to by adata? Because PRU_SEND returns after queueing the message,
+ * not after sending it. If the sender changes the data after queueing it,
+ * we'd see the already-queued data change. One attempt to fix this without
+ * adding a copy would be to have this function wait until the datagram is
+ * sent; however this doesn't work well. In particular, if a host is down, and
+ * an ARP fails to that host, this packet will be queued until the ARP request
+ * comes back, which could be hours later. We can't block in this routine that
+ * long, since it prevents RPC timeouts from happening.
+ */
+/* XXX In the brave new world, steal the data bufs out of the rx_packet iovec,
+ * and just queue those. XXX
+ */
+
+
+int
+osi_NetSend(asocket, addr, dvec, nvecs, alength, istack)
+ register struct socket *asocket;
+ struct iovec *dvec;
+ int nvecs;
+ register afs_int32 alength;
+ struct sockaddr_in *addr;
+ int istack;
+{
+ register afs_int32 code;
+ int s;
+ int len;
+ int i;
+ struct iovec iov[RX_MAXIOVECS];
+ char *tdata;
+ struct uio u;
+ struct mbuf *nam;
+ int haveGlock = ISAFS_GLOCK();
+
+ AFS_STATCNT(osi_NetSend);
+ if (nvecs > RX_MAXIOVECS) {
+ osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
+ }
+
+ for (i = 0 ; i < nvecs ; i++) {
+ iov[i].iov_base = dvec[i].iov_base;
+ iov[i].iov_len = dvec[i].iov_len;
+ }
+
+ u.uio_iov=&iov[0];
+ u.uio_iovcnt=nvecs;
+ u.uio_offset=0;
+ u.uio_resid=alength;
+ u.uio_segflg=UIO_SYSSPACE;
+ u.uio_rw=UIO_WRITE;
+ u.uio_procp=NULL;
+ if (haveGlock) {
+ AFS_GUNLOCK();
+ }
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
+#endif
+ nam=m_get(M_DONTWAIT, MT_SONAME);
+ if (nam == NULL) {
+ code=ENOBUFS;
+ goto bad;
+ }
+ nam->m_len=addr->sin_len=sizeof(struct sockaddr_in);
+ bcopy((caddr_t)addr, mtod(nam, caddr_t), addr->sin_len);
+ code = sosend(asocket, mtod(nam, struct sockaddr *), &u, NULL, NULL, 0);
+ m_freem(nam);
+bad:
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+#endif
+ if (haveGlock) {
+ AFS_GLOCK();
+ }
+ return code;
+}
--- /dev/null
+/* Copyright Transarc Corporation 1998 - All Rights Reserved
+ *
+ * rx_kmutex.h - mutex and condition variable macros for kernel environment.
+ *
+ * DUX implementation.
+ */
+
+#ifndef _RX_KMUTEX_H_
+#define _RX_KMUTEX_H_
+
+#ifdef AFS_FBSD40_ENV
+
+#include <sys/lock.h>
+/* #include <kern/sched_prim.h> */
+/* #include <sys/unix_defs.h> */
+
+#define RX_ENABLE_LOCKS 1
+#define AFS_GLOBAL_RXLOCK_KERNEL
+
+/*
+ * Condition variables
+ *
+ * In Digital Unix (OSF/1), we use something akin to the ancient sleep/wakeup
+ * mechanism. The condition variable itself plays no role; we just use its
+ * address as a convenient unique number.
+ */
+#define CV_INIT(cv,a,b,c)
+#define CV_DESTROY(cv)
+#define CV_WAIT(cv, lck) { \
+ int isGlockOwner = ISAFS_GLOCK(); \
+ if (isGlockOwner) AFS_GUNLOCK(); \
+ assert_wait((vm_offset_t)(cv), 0); \
+ MUTEX_EXIT(lck); \
+ thread_block(); \
+ if (isGlockOwner) AFS_GLOCK(); \
+ MUTEX_ENTER(lck); \
+ }
+
+#define CV_TIMEDWAIT(cv,lck,t) { \
+ int isGlockOwner = ISAFS_GLOCK(); \
+ if (isGlockOwner) AFS_GUNLOCK(); \
+ assert_wait((vm_offset_t)(cv), 0); \
+ thread_set_timeout(t); \
+ MUTEX_EXIT(lck); \
+ thread_block(); \
+ if (isGlockOwner) AFS_GLOCK(); \
+ MUTEX_ENTER(lck); \
+
+#define CV_SIGNAL(cv) thread_wakeup_one((vm_offset_t)(cv))
+#define CV_BROADCAST(cv) thread_wakeup((vm_offset_t)(cv))
+
+typedef struct {
+ struct simplelock lock;
+} afs_kmutex_t;
+typedef int afs_kcondvar_t;
+
+#define osi_rxWakeup(cv) thread_wakeup((vm_offset_t)(cv))
+
+#define LOCK_INIT(a,b) \
+ do { \
+ usimple_lock_init(&(a)->lock); \
+ } while(0);
+#define MUTEX_INIT(a,b,c,d) \
+ do { \
+ usimple_lock_init(&(a)->lock); \
+ } while(0);
+#define MUTEX_DESTROY(a) \
+ do { \
+ usimple_lock_terminate(&(a)->lock); \
+ } while(0);
+#define MUTEX_ENTER(a) \
+ do { \
+ usimple_lock(&(a)->lock); \
+ } while(0);
+#define MUTEX_TRYENTER(a) \
+ usimple_lock(&(a)->lock)
+#define MUTEX_EXIT(a) \
+ do { \
+ usimple_unlock(&(a)->lock); \
+ } while(0);
+
+#undef MUTEX_ISMINE
+#define MUTEX_ISMINE(a) 1
+/*
+ #define MUTEX_ISMINE(a)
+ (((afs_kmutex_t *)(a))->owner == current_thread())
+*/
+
+#undef osirx_AssertMine
+extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
+
+#endif /* FBSD40 */
+
+
+#endif /* _RX_KMUTEX_H_ */
+
--- /dev/null
+/*
+****************************************************************************
+* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
+* Copyright Transarc Corporation 1989 - All Rights Reserved *
+* *
+* Permission to use, copy, modify, and distribute this software and its *
+* documentation for any purpose and without fee is hereby granted, *
+* provided that the above copyright notice appear in all copies and *
+* that both that copyright notice and this permission notice appear in *
+* supporting documentation, and that the name of IBM not be used in *
+* advertising or publicity pertaining to distribution of the software *
+* without specific, written prior permission. *
+* *
+* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
+* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
+* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
+* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
+* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
+****************************************************************************
+*/
+
+#include "../afs/param.h"
+#ifdef AFS_FBSD40_ENV
+#include "../rx/rx_kcommon.h"
+
+
+static struct protosw parent_proto; /* udp proto switch */
+static void rxk_input (struct mbuf *am, int iphlen);
+static void rxk_fasttimo (void);
+
+/* start intercepting basic calls */
+rxk_init() {
+ register struct protosw *tpro, *last;
+ if (rxk_initDone) return 0;
+
+ last = inetdomain.dom_protoswNPROTOSW;
+ for (tpro = inetdomain.dom_protosw; tpro < last; tpro++)
+ if (tpro->pr_protocol == IPPROTO_UDP) {
+ /* force UDP checksumming on for AFS */
+ extern int udpcksum;
+ udpcksum = 1;
+ bcopy(tpro, &parent_proto, sizeof(parent_proto));
+ tpro->pr_input = rxk_input;
+ tpro->pr_fasttimo = rxk_fasttimo;
+ /*
+ * don't bother with pr_drain and pr_ctlinput
+ * until we have something to do
+ */
+ rxk_initDone = 1;
+ return 0;
+ }
+ osi_Panic("inet:no udp");
+}
+
+
+static void rxk_input (struct mbuf *am, int iphlen)
+{
+ void (*tproc)();
+ register unsigned short *tsp;
+ int hdr;
+ struct udphdr *tu;
+ register struct ip *ti;
+ struct udpiphdr *tvu;
+ register int i;
+ char *phandle;
+ afs_int32 code;
+ struct sockaddr_in taddr;
+ int tlen;
+ short port;
+ int data_len, comp_sum;
+
+ SPLVAR;
+ NETPRI;
+
+ /* make sure we have base ip and udp headers in first mbuf */
+ if (iphlen > sizeof (struct ip)) {
+ ip_stripoptions(am, (struct mbuf *)0);
+ iphlen = sizeof (struct ip);
+ }
+
+ if (am->m_len < sizeof(struct udpiphdr)) {
+ am = m_pullup(am, sizeof(struct udpiphdr));
+ if (!am) {
+ USERPRI;
+ return;
+ }
+ }
+
+ ti = mtod(am, struct ip *);
+ /* skip basic ip hdr */
+ tu = (struct udphdr *)(((char *)ti) + sizeof(struct ip));
+
+ /* now read the port out */
+ port = tu->uh_dport;
+
+ if (port) {
+ for(tsp=rxk_ports, i=0; i<MAXRXPORTS;i++) {
+ if (*tsp++ == port) {
+ /* checksum the packet */
+ /*
+ * Make mbuf data length reflect UDP length.
+ * If not enough data to reflect UDP length, drop.
+ */
+ tvu = (struct udpiphdr *)ti;
+ tlen = ntohs((u_short)tvu->ui_ulen);
+ if ((int)ti->ip_len != tlen) {
+ if (tlen > (int)ti->ip_len) {
+ m_free(am);
+ USERPRI;
+ return;
+ }
+ m_adj(am, tlen - (int)ti->ip_len);
+ }
+ /* deliver packet to rx */
+ taddr.sin_family = AF_INET; /* compute source address */
+ taddr.sin_port = tu->uh_sport;
+ taddr.sin_addr.s_addr = ti->ip_src.s_addr;
+ taddr.sin_len = sizeof(taddr);
+ tvu = (struct udpiphdr *) ti; /* virtual udp structure, for cksum */
+ /* handle the checksum. Note that this code damages the actual ip
+ header (replacing it with the virtual one, which is the same size),
+ so we must ensure we get everything out we need, first */
+ if ( tu->uh_sum != 0) {
+ /* if the checksum is there, always check it. It's crazy not
+ * to, unless you can really be sure that your
+ * underlying network (and interfaces and drivers and
+ * DMA hardware, etc!) is error-free. First, fill
+ * in entire virtual ip header. */
+ memset(tvu->ui_i.ih_x1, 0, 9);
+ tvu->ui_len = tvu->ui_ulen;
+ tlen = ntohs((unsigned short)(tvu->ui_ulen));
+ if (in_cksum(am, sizeof(struct ip) + tlen)) {
+ /* checksum, including cksum field, doesn't come out 0, so
+ this packet is bad */
+ m_freem(am);
+ USERPRI;
+ return;
+ }
+ }
+
+ /*
+ * 28 is IP (20) + UDP (8) header. ulen includes
+ * udp header, and we *don't* tell RX about udp
+ * header either. So, we remove those 8 as well.
+ */
+ data_len = ntohs(tu->uh_ulen);
+ data_len -= 8;
+ AFS_RXGLOCK();
+ if (!(*rxk_GetPacketProc)(&phandle, data_len)) {
+ if (rx_mb_to_packet(am, m_freem, 28, data_len, phandle)) {
+ /* XXX should just increment counter here.. */
+ printf("rx: truncated UDP packet\n");
+ rxi_FreePacket(phandle);
+ }
+ else
+ (*rxk_PacketArrivalProc)(phandle, &taddr,
+ rxk_portRocks[i], data_len);
+ }else m_freem(am);
+ AFS_RXGUNLOCK();
+ USERPRI;
+ return;
+ }
+ }
+ }
+
+ /* if we get here, try to deliver packet to udp */
+ if (tproc = parent_proto.pr_input) (*tproc)(am,iphlen);
+ USERPRI;
+ return;
+}
+
+
+/*
+ * UDP fast timer to raise events for all but Solaris and NCR.
+ * Called about 5 times per second (at unknown priority?). Must go to
+ * splnet or obtain global lock before touching anything significant.
+ */
+static void rxk_fasttimo (void)
+{
+ void (*tproc)();
+ struct clock temp;
+
+ /* do rx fasttimo processing here */
+ rxevent_RaiseEvents(&temp);
+ if (tproc = parent_proto.pr_fasttimo) (*tproc)();
+}
+
+
+/* rx_NetSend - send asize bytes at adata from asocket to host at addr.
+ *
+ * Now, why do we allocate a new buffer when we could theoretically use the one
+ * pointed to by adata? Because PRU_SEND returns after queueing the message,
+ * not after sending it. If the sender changes the data after queueing it,
+ * we'd see the already-queued data change. One attempt to fix this without
+ * adding a copy would be to have this function wait until the datagram is
+ * sent; however this doesn't work well. In particular, if a host is down, and
+ * an ARP fails to that host, this packet will be queued until the ARP request
+ * comes back, which could be hours later. We can't block in this routine that
+ * long, since it prevents RPC timeouts from happening.
+ */
+/* XXX In the brave new world, steal the data bufs out of the rx_packet iovec,
+ * and just queue those. XXX
+ */
+
+/* set lock on sockbuf sb; can't call sblock since we're at interrupt level
+ * sometimes */
+static trysblock(sb)
+register struct sockbuf *sb; {
+ AFS_STATCNT(trysblock);
+ if (sb->sb_flags & SB_LOCK){
+ return -1; /* can't lock socket */
+ }
+ sb->sb_flags |= SB_LOCK;
+ return 0;
+}
+
+int
+osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
+ register struct socket *asocket;
+ struct iovec *dvec;
+ int nvec;
+ register afs_int32 asize;
+ struct sockaddr_in *addr;
+ int istack;
+{
+ register struct mbuf *tm, *um;
+ register afs_int32 code;
+ int s;
+ struct mbuf *top = 0;
+ register struct mbuf *m, **mp;
+ int len;
+ char *tdata;
+ caddr_t tpa;
+ int i,tl,rlen;
+ int mlen;
+ int haveGlock;
+
+ AFS_STATCNT(osi_NetSend);
+
+/* Actually, the Ultrix way is as good as any for us, so we don't bother with
+ * special mbufs any more. Used to think we could get away with not copying
+ * the data to the interface, but there's no way to tell the caller not to
+ * reuse the buffers after sending, so we lost out on that trick anyway */
+
+ s = splnet();
+ mp = ⊤
+ i = 0;
+ tdata = dvec[i].iov_base;
+ tl = dvec[i].iov_len;
+ while (1) {
+ mlen = MLEN;
+ if (top == 0) {
+ MGETHDR(m, M_DONTWAIT, MT_DATA);
+ if (!m) {
+ splx(s);
+ return 1;
+ }
+ mlen = MHLEN;
+ m->m_pkthdr.len = 0;
+ m->m_pkthdr.rcvif = (struct ifnet *)0;
+ } else
+ MGET(m, M_DONTWAIT, MT_DATA);
+ if (!m) {
+ /* can't get an mbuf, give up */
+ if (top) m_freem(top); /* free mbuf list we're building */
+ splx(s);
+ return 1;
+ }
+ /*
+ * WARNING: the `4 * MLEN' is somewhat dubious. It is better than
+ * `NBPG', which may have no relation to `CLBYTES'. Also, `CLBYTES'
+ * may be so large that we never use clusters, resulting in far
+ * too many mbufs being used. It is often better to briefly use
+ * a cluster, even if we are only using a portion of it. Since
+ * we are on the xmit side, it shouldn't end up sitting on a queue
+ * for a potentially unbounded time (except perhaps if we are talking
+ * to ourself).
+ */
+ if (asize >= 4 * MLEN) { /* try to get cluster mbuf */
+ register struct mbuf *p;
+
+ /* different algorithms for getting cluster mbuf */
+ MCLGET(m, M_DONTWAIT);
+ if ((m->m_flags & M_EXT) == 0)
+ goto nopages;
+ mlen = MCLBYTES;
+
+ /* now compute usable size */
+ len = MIN(mlen, asize);
+/* Should I look at MAPPED_MBUFS??? */
+ } else {
+nopages:
+ len = MIN(mlen, asize);
+ }
+ m->m_len = 0;
+ *mp = m; /* XXXX */
+ top->m_pkthdr.len += len;
+ tpa = mtod(m, caddr_t);
+ while (len) {
+ rlen = MIN(len, tl);
+ bcopy(tdata, tpa, rlen);
+ asize -= rlen;
+ len -= rlen;
+ tpa += rlen;
+ m->m_len += rlen;
+ tdata += rlen;
+ tl -= rlen;
+ if (tl <= 0) {
+ i++;
+ if (i > nvec) {
+ /* shouldn't come here! */
+ asize = 0; /* so we make progress toward completion */
+ break;
+ }
+ tdata = dvec[i].iov_base;
+ tl = dvec[i].iov_len;
+ }
+ }
+ *mp = m;
+ mp = &m->m_next;
+ if (asize <= 0)
+ break;
+ }
+ tm = top;
+
+ tm->m_act = (struct mbuf *) 0;
+
+ /* setup mbuf corresponding to destination address */
+ um = m_get(M_DONTWAIT, MT_SONAME);
+ if (!um) {
+ if (top) m_freem(top); /* free mbuf chain */
+ /* if this were vfs40, we'd do sbunlock(asocket, &asocket->so_snd), but
+ we don't do the locking at all for vfs40 systems */
+ splx(s);
+ return 1;
+ }
+ bcopy(addr, mtod(um, caddr_t), sizeof(*addr));
+ um->m_len = sizeof(*addr);
+ /* note that udp_usrreq frees funny mbuf. We hold onto data, but mbuf
+ * around it is gone. we free address ourselves. */
+ /* haveGlock = ISAFS_GLOCK();
+ if (haveGlock) {
+ AFS_GUNLOCK();
+ } */
+ /* SOCKET_LOCK(asocket); */
+ /* code = (*asocket->so_proto->pr_usrreq)(asocket, PRU_SEND, tm, um, 0); */
+ code = (*asocket->so_proto->pr_usrreqs->pru_send)(asocket, 0, tm,
+ (struct sockaddr *) addr,
+ um, curproc);
+ /* SOCKET_UNLOCK(asocket); */
+ /* if (haveGlock) {
+ AFS_GLOCK();
+ } */
+ splx(s);
+ m_free(um);
+
+ return code;
+}
+
+#endif /* AFS_FBSD40_ENV */