From 92fe9738f07d2919275136a15620d7ce48748a89 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Fri, 21 Oct 2005 05:48:39 +0000 Subject: [PATCH] STABLE14-darwin-x86-20051015 FIXES 20130 add support for x86 darwin --- acinclude.m4 | 12 ++- src/cf/osconf.m4 | 2 +- src/config/afs_sysnames.h | 1 + src/config/param.x86_darwin_80.h | 137 +++++++++++++++++++++++++++++ src/des/andrew-conf.h | 4 +- src/des/conf-darwin.h | 11 +++ src/libafs/MakefileProto.DARWIN.in | 5 +- src/lwp/Makefile.in | 6 +- src/lwp/process.i386.s | 4 + 9 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 src/config/param.x86_darwin_80.h create mode 100644 src/des/conf-darwin.h diff --git a/acinclude.m4 b/acinclude.m4 index 6ce5f797b2..1035f60c6e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -210,10 +210,14 @@ case $system in fi AC_SUBST([HEADER_RT]) ;; - *-darwin*) + powerpc-*-darwin*) MKAFS_OSTYPE=DARWIN AC_MSG_RESULT(ppc_darwin) ;; + i386-*-darwin*) + MKAFS_OSTYPE=DARWIN + AC_MSG_RESULT(x86_darwin) + ;; *-freebsd*) MKAFS_OSTYPE=FBSD AC_MSG_RESULT(i386_fbsd) @@ -382,6 +386,12 @@ else powerpc-apple-darwin8*) AFS_SYSNAME="ppc_darwin_80" ;; + powerpc-apple-darwin8.*) + AFS_SYSNAME="ppc_darwin_80" + ;; + i386-apple-darwin8.*) + AFS_SYSNAME="x86_darwin_80" + ;; sparc-sun-solaris2.5*) AFS_SYSNAME="sun4x_55" enable_login="yes" diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 1db1ed95f3..ce98b3adc0 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -437,7 +437,7 @@ case $AFS_SYSNAME in EXTRA_VLIBOBJS="fstab.o" ;; - ppc_darwin_80) + *_darwin_80) AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" LEX="lex -l" MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}' diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 0b2ebcbe4f..b54fc4fef4 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -59,6 +59,7 @@ #define SYS_NAME_ID_ppc_darwin_60 506 #define SYS_NAME_ID_ppc_darwin_70 507 #define SYS_NAME_ID_ppc_darwin_80 508 +#define SYS_NAME_ID_x86_darwin_80 509 #define SYS_NAME_ID_next_mach20 601 #define SYS_NAME_ID_next_mach30 602 diff --git a/src/config/param.x86_darwin_80.h b/src/config/param.x86_darwin_80.h new file mode 100644 index 0000000000..e969781c71 --- /dev/null +++ b/src/config/param.x86_darwin_80.h @@ -0,0 +1,137 @@ +#ifndef UKERNEL +/* This section for kernel libafs compiles only */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_H + +#define AFS_ENV 1 +#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 +#define AFS_64BIT_IOPS_ENV 1 +#define AFS_VFSINCL_ENV 1 + +#include + +#define AFS_DARWIN_ENV +#define AFS_DARWIN13_ENV +#define AFS_DARWIN14_ENV +#define AFS_DARWIN60_ENV +#define AFS_DARWIN70_ENV +#define AFS_DARWIN80_ENV +#define AFS_NONFSTRANS +#define AFS_SYSCALL 230 +#define AFS_NAMEI_ENV 1 +#define DARWIN_REFBASE 3 + +/* File system entry (used if mount.h doesn't define MOUNT_AFS */ +#define AFS_MOUNT_AFS "afs" + +/* Machine / Operating system information */ +#define sys_x86_darwin_12 1 +#define sys_x86_darwin_13 1 +#define sys_x86_darwin_14 1 +#define sys_x86_darwin_60 1 +#define sys_x86_darwin_70 1 +#define sys_x86_darwin_80 1 +#define SYS_NAME "x86_darwin_80" +#define SYS_NAME_ID SYS_NAME_ID_x86_darwin_80 +#define AFSLITTLE_ENDIAN 1 +#define AFS_HAVE_FFS 1 /* Use system's ffs. */ + +#define AFS_GCPAGS 0 +#define RXK_LISTENER_ENV 1 + +#ifdef KERNEL +#undef MACRO_BEGIN +#undef MACRO_END +#include +#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) _MALLOC(x, M_TEMP, M_WAITOK) +#define AFS_KFREE(x,y) _FREE(x,M_TEMP) +#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 BIND_8_COMPAT + +#endif +#endif /* AFS_PARAM_H */ + +#else /* !defined(UKERNEL) */ + +/* This section for user space compiles only */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_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_X86_ENV 1 + +#include +#define AFS_USERSPACE_ENV +#define AFS_USR_DARWIN_ENV +#define AFS_USR_DARWIN13_ENV +#define AFS_USR_DARWIN14_ENV +#define AFS_USR_DARWIN60_ENV +#define AFS_USR_DARWIN70_ENV +#define AFS_USR_DARWIN80_ENV +#define AFS_NONFSTRANS +#define AFS_SYSCALL 230 +#define DARWIN_REFBASE 0 + +/* File system entry (used if mount.h doesn't define MOUNT_AFS */ +#define AFS_MOUNT_AFS "afs" + +/* Machine / Operating system information */ +#define sys_x86_darwin_12 1 +#define sys_x86_darwin_13 1 +#define sys_x86_darwin_14 1 +#define sys_x86_darwin_60 1 +#define sys_x86_darwin_70 1 +#define sys_x86_darwin_80 1 +#define SYS_NAME "x86_darwin_80" +#define SYS_NAME_ID SYS_NAME_ID_x86_darwin_80 +#define AFSLITTLE_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 + +#define BIND_8_COMPAT +#endif /* AFS_PARAM_H */ + +#endif /* !defined(UKERNEL) */ diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h index 0c3e3efad0..cad29fd732 100644 --- a/src/des/andrew-conf.h +++ b/src/des/andrew-conf.h @@ -93,8 +93,8 @@ #endif /* AFS_PPC_LINUX20_ENV */ #endif /* AFS_PARISC_LINUX24_ENV */ #else -#if defined(AFS_DARWIN_ENV) && defined(AFS_PPC_ENV) -#include "conf-ppc-darwin.h" +#if defined(AFS_DARWIN_ENV) +#include "conf-darwin.h" #else Sorry, you lose. diff --git a/src/des/conf-darwin.h b/src/des/conf-darwin.h new file mode 100644 index 0000000000..592e6b0ba9 --- /dev/null +++ b/src/des/conf-darwin.h @@ -0,0 +1,11 @@ +#define BITS32 +#define BIG +#undef BSDUNIX +#if defined(__ppc__) +#define MSBFIRST +#elif defined(__i386__) +#define LSBFIRST +#else +#error "MSBFIRST or LSBFIRST undefined" +#endif +#define MUSTALIGN diff --git a/src/libafs/MakefileProto.DARWIN.in b/src/libafs/MakefileProto.DARWIN.in index 86603586e1..456f4e2026 100644 --- a/src/libafs/MakefileProto.DARWIN.in +++ b/src/libafs/MakefileProto.DARWIN.in @@ -33,10 +33,13 @@ AFS_OS_NONFSOBJS = osi_vfsops.o KDEFS= DBUG = DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL + +KOPTS=-static -g -nostdinc -nostdlib -no-cpp-precomp -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED -march=i686 -mpreferred-stack-boundary=2 -falign-functions=4 +MODLD=$(CC) $(KOPTS) KOPTS=-static -g -nostdinc -nostdlib -no-cpp-precomp -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -O2 -mcpu=750 -mmultiple -fschedule-insns MODLD=$(CC) $(KOPTS) - + MODLD=$(LD) KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch diff --git a/src/lwp/Makefile.in b/src/lwp/Makefile.in index 8345e01aac..4dfd8284de 100644 --- a/src/lwp/Makefile.in +++ b/src/lwp/Makefile.in @@ -52,8 +52,12 @@ process.o : process.s process.i386.s process.c /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \ ${AS} -ahlns process.ss -o process.o >process.lst; \ $(RM) process.ss ;; \ - *_darwin* ) \ + ppc_darwin* ) \ $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} ${srcdir}/process.s;; \ + x86_darwin*) \ + /usr/bin/cpp -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \ + ${AS} process.ss -o process.o; \ + $(RM) process.ss ;; \ i386_*bsd*) \ cp ${srcdir}/process.i386.s process.S ; \ ${CCOBJ} -DIGNORE_STDS_H -E -I${srcdir} -I${TOP_INCDIR} process.S > process.ss ; \ diff --git a/src/lwp/process.i386.s b/src/lwp/process.i386.s index 951ca0d560..3dfae1ae80 100644 --- a/src/lwp/process.i386.s +++ b/src/lwp/process.i386.s @@ -59,9 +59,11 @@ ENTRY(savecontext) L1: jmp *f(%ebp) /* ebx = &f */ +#if !defined(AFS_DARWIN_ENV) /* Shouldn't be here....*/ call _C_LABEL(abort) +#endif /* * returnto(area2) @@ -83,6 +85,8 @@ ENTRY(returnto) popl %ebp ret +#if !defined(AFS_DARWIN_ENV) /* I see, said the blind man, as he picked up his hammer and saw! */ pushl $1234 call _C_LABEL(abort) +#endif