diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c
index d0c3c1daab..ee6d33b31f 100644
--- a/src/afsd/afsd.c
+++ b/src/afsd/afsd.c
@@ -424,11 +424,9 @@ afsd_event_cleanup(int signo) {
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
CFRelease (source);
-#ifndef AFS_ARM_DARWIN_ENV
IODeregisterForSystemPower(&iterator);
IOServiceClose(root_port);
IONotificationPortDestroy(notify);
-#endif
exit(0);
}
@@ -439,7 +437,6 @@ afsd_install_events(void)
SCDynamicStoreContext ctx = {0};
SCDynamicStoreRef store;
-#ifndef AFS_ARM_DARWIN_ENV
root_port = IORegisterForSystemPower(0,¬ify,afsd_sleep_callback,&iterator);
if (root_port) {
@@ -486,7 +483,6 @@ afsd_install_events(void)
CFRelease (store);
}
-#endif
if (source != NULL) {
CFRunLoopAddSource (CFRunLoopGetCurrent(),
@@ -1457,7 +1453,7 @@ AfsdbLookupHandler(void)
kernelMsg[1] = 0;
acellName[0] = '\0';
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) && !defined(AFS_ARM_DARWIN_ENV)
/* Fork the event handler also. */
code = fork();
if (code == 0) {
diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4
index 26778926ff..76b7698148 100644
--- a/src/cf/osconf.m4
+++ b/src/cf/osconf.m4
@@ -446,6 +446,26 @@ case $AFS_SYSNAME in
XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
;;
+ arm_darwin_100)
+ AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} ${ARCHFLAGS}'
+ MT_LIBS="${LIB_AFSDB} -framework CoreFoundation"
+ KROOT=
+ KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
+ LD="cc"
+ KERN_OPTMZ="-Os"
+ LWP_OPTMZ="-Os"
+ OPTMZ="-Os"
+ PAM_LIBS="-lpam"
+ REGEX_OBJ="regex.o"
+ TXLIBS="-lncurses"
+ EXTRA_VLIBOBJS="fstab.o"
+ SHLIB_LINKER="${MT_CC} -dynamiclib"
+ SHLIB_SUFFIX="dylib"
+ RANLIB="ranlib"
+ XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
+ ;;
+
*_darwin_100)
AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
MT_CFLAGS="-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} \${ARCHFLAGS}"
diff --git a/src/config/param.arm_darwin_100.h b/src/config/param.arm_darwin_100.h
index 5b657c4251..39ca469846 100644
--- a/src/config/param.arm_darwin_100.h
+++ b/src/config/param.arm_darwin_100.h
@@ -104,6 +104,9 @@
#define AFS_GCPAGS 0
#define RXK_LISTENER_ENV 1
+
+#ifndef IGNORE_STDS_H
+/* a dodge to avoid including this in lwp process.s */
#define RTM_NEWADDR 0xc /* address being added to iface */
#define RTM_IFINFO 0xe /* iface going up/down etc. */
#define RTAX_NETMASK 2 /* netmask sockaddr present */
@@ -114,6 +117,8 @@ struct rt_addrinfo {
int rti_addrs;
struct sockaddr *rti_info[RTAX_MAX];
};
+#endif
+
#ifdef KERNEL
#undef MACRO_BEGIN
#undef MACRO_END
diff --git a/src/libafs/afs.arm_darwin_100.plist.in b/src/libafs/afs.arm_darwin_100.plist.in
new file mode 100644
index 0000000000..a1385718c5
--- /dev/null
+++ b/src/libafs/afs.arm_darwin_100.plist.in
@@ -0,0 +1,33 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ afs
+ CFBundleIdentifier
+ org.openafs.filesystems.afs
+ CFBundleInfoDictionaryVersion
+ 8.0
+ CFBundleName
+ afs
+ CFBundlePackageType
+ KEXT
+ CFBundleShortVersionString
+ @MACOS_VERSION@
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ @MACOS_VERSION@
+ OSBundleLibraries
+
+ com.apple.kpi.bsd
+ 8.0.0
+ com.apple.kpi.mach
+ 8.0.0
+ com.apple.kpi.libkern
+ 8.0
+
+
+
diff --git a/src/libafsrpc/Makefile.in b/src/libafsrpc/Makefile.in
index 96a6462665..08f3ad3768 100644
--- a/src/libafsrpc/Makefile.in
+++ b/src/libafsrpc/Makefile.in
@@ -284,6 +284,9 @@ syscall.o: ${SYS}/syscall.s
$(PATH_CPP) ${SFLAGS} ${SYS}/syscall.s > syscall.ss; \
as -o syscall.o syscall.ss; \
$(RM) syscall.ss;; \
+ arm_darwin_* ) \
+ touch syscall.c ; \
+ ${CC} ${AFS_CFLAGS} -c syscall.c;; \
sgi_* | *_darwin_* ) \
${CC} ${AFS_CFLAGS} -c ${SYS}/syscall.s;; \
alpha_dux?? ) \
@@ -291,7 +294,8 @@ syscall.o: ${SYS}/syscall.s
${AS} -o syscall.o syscall.i; \
$(RM) -f syscall.ss syscall.i;; \
*bsd* ) \
- touch syscall.o ;; \
+ touch syscall.c ; \
+ ${CC} ${AFS_CFLAGS} -c syscall.c;; \
*) \
$(PATH_CPP) ${SFLAGS} ${SYS}/syscall.s > syscall.ss; \
as -o syscall.o syscall.ss; \
diff --git a/src/libuafs/Makefile.common.in b/src/libuafs/Makefile.common.in
index 7b5c082ab0..ef06baa4a1 100644
--- a/src/libuafs/Makefile.common.in
+++ b/src/libuafs/Makefile.common.in
@@ -9,7 +9,7 @@
#
SHELL=/bin/sh
-INCLUDE= -I. -I/usr/include -I${TOP_OBJDIR}/src/config
+INCLUDE= -I. -I${ISYSROOT}/usr/include -I${TOP_OBJDIR}/src/config
UOBJ =../UAFS
PICOBJ =../UAFS.pic
JUAFS =../JUAFS
@@ -2022,14 +2022,14 @@ AFSWEB:
setup_common:
-$(RM) -f h net netinet rpc ufs nfs machine sys inet nsapi afsd
- -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 ${ISYSROOT}/usr/include/sys h
+ -ln -s ${ISYSROOT}/usr/include/net net
+ -ln -s ${ISYSROOT}/usr/include/netinet netinet
+ -ln -s ${ISYSROOT}/usr/include/rpc rpc
+ -ln -s ${ISYSROOT}/usr/include/sys sys
+ -ln -s ${ISYSROOT}/usr/include/nfs nfs
+ -ln -s ${ISYSROOT}/usr/include/inet inet
+ -ln -s ${ISYSROOT}/usr/include/ufs ufs
-ln -s $(TOP_SRCDIR)/afsd afsd
-ln -s $(NS_INCL) nsapi
diff --git a/src/lwp/Makefile.in b/src/lwp/Makefile.in
index b58fa27387..2c2aefe8ad 100644
--- a/src/lwp/Makefile.in
+++ b/src/lwp/Makefile.in
@@ -92,7 +92,7 @@ process.o : process.s process.i386.s process.c lwp.o
fi ; \
fi ; \
if [ -n "$${arm}" ] ; then \
- $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c -arch armv6 -I${TOP_INCDIR} ${srcdir}/process.c -o "$${arm}" ; \
+ $(CC) -x assembler-with-cpp -c -arch armv6 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.s -o "$${arm}" ; \
if [ -z "$${i386}" -a -z "$${amd64}" -a -z "$${ppc}" ] ; then \
${MV} "$${arm}" process.o ; \
fi ; \
diff --git a/src/lwp/lwp.c b/src/lwp/lwp.c
index c47c967f9b..3e1290b2b1 100644
--- a/src/lwp/lwp.c
+++ b/src/lwp/lwp.c
@@ -370,7 +370,7 @@ LWP_CreateProcess(void *(*ep) (void *), int stacksize, int priority, void *parm,
Initialize_PCB(temp, priority, stackmemory, stacksize, ep, parm, name);
insert(temp, &runnable[priority]);
temp2 = lwp_cpptr;
-#ifndef AFS_ARM_LINUX20_ENV
+#if !defined(AFS_ARM_LINUX20_ENV) && !defined(AFS_ARM_DARWIN_ENV)
if (PRE_Block != 0)
Abort_LWP("PRE_Block not 0");
@@ -466,7 +466,7 @@ LWP_CreateProcess2(void *(*ep) (void *), int stacksize, int priority, void *parm
Initialize_PCB(temp, priority, stackptr, stacksize, ep, parm, name);
insert(temp, &runnable[priority]);
temp2 = lwp_cpptr;
-#ifndef AFS_ARM_LINUX20_ENV
+#if !defined(AFS_ARM_LINUX20_ENV) && !defined(AFS_ARM_DARWIN_ENV)
if (PRE_Block != 0)
Abort_LWP("PRE_Block not 0");
@@ -967,7 +967,7 @@ Dispatcher(void)
printf("Dispatch %d [PCB at 0x%x] \"%s\"\n", ++dispatch_count,
runnable[i].head, runnable[i].head->name);
#endif
-#ifndef AFS_ARM_LINUX20_ENV
+#if !defined(AFS_ARM_LINUX20_ENV) && !defined(AFS_ARM_DARWIN_ENV)
if (PRE_Block != 1)
Abort_LWP("PRE_Block not 1");
#endif
diff --git a/src/lwp/process.s b/src/lwp/process.s
index 5d26c8779b..dda0e5dd38 100644
--- a/src/lwp/process.s
+++ b/src/lwp/process.s
@@ -11,13 +11,15 @@
#include
#if defined(__arm32__) || defined(__arm__)
- /* register definitions */
+#ifndef AFS_ARM_DARWIN_ENV
+ /* register definitions */
fp .req r11
ip .req r12
sp .req r13
lp .req r14
pc .req r15
-
+#endif
+
/*
savecontext(f, area1, newsp)
int (*f)()#if defined(RIOS);
@@ -29,24 +31,30 @@
.text
.align 0
+#ifndef AFS_ARM_DARWIN_ENV
.globl savecontext
.type savecontext, #function
savecontext:
- @ build the frame
- mov ip, sp
- stmfd sp!, {fp, ip, lr, pc}
- sub fp, ip, #4
- @ stack r0 - r10, current fp
- stmfd sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
- str sp, [r1, #0]
- @ check if newsp is zero
- movs r2, r2
- movne sp, r2
- @ call function ...
- mov pc, r0
-
- /* should never get here ... */
- /* bl EXT(abort) */
+#else
+ .globl _savecontext
+_savecontext:
+#endif
+ @ build the frame
+ mov ip, sp
+ stmfd sp!, {fp, ip, lr, pc}
+ sub fp, ip, #4
+ @ stack r0 - r10, current fp
+ stmfd sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
+ str sp, [r1, #0]
+ @ check if newsp is zero
+ movs r2, r2
+ movne sp, r2
+ @ call function ...
+#ifdef AFS_ARM_DARWIN_ENV
+ bx r0
+#else
+ mov pc, r0
+#endif
/*
returnto(area2)
@@ -55,9 +63,14 @@ savecontext:
/* area2 is in r0. */
+#ifndef AFS_ARM_DARWIN_ENV
.globl returnto
.type returnto, #function
returnto:
+#else
+ .globl _returnto
+_returnto:
+#endif
@ restore r0-r10, fp
ldr r0, [r0, #0]
ldmfd r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
diff --git a/src/shlibafsrpc/Makefile.in b/src/shlibafsrpc/Makefile.in
index c0a2a27412..92fbd81b1a 100644
--- a/src/shlibafsrpc/Makefile.in
+++ b/src/shlibafsrpc/Makefile.in
@@ -292,6 +292,9 @@ syscall.o: ${SYS}/syscall.s
$(PATH_CPP) ${SFLAGS} ${SYS}/syscall.s > syscall.ss; \
as -o syscall.o syscall.ss; \
$(RM) syscall.ss;; \
+ arm_darwin_* ) \
+ touch syscall.c ; \
+ ${CC} ${AFS_CFLAGS} -c syscall.c;; \
sgi_* | *_darwin_* ) \
${CC} ${AFS_CFLAGS} -c ${SYS}/syscall.s;; \
alpha_dux?? ) \
diff --git a/src/vol/devname.c b/src/vol/devname.c
index e884ecb67f..e7f0147618 100644
--- a/src/vol/devname.c
+++ b/src/vol/devname.c
@@ -33,7 +33,7 @@
#endif
#endif
#else /* AFS_VFSINCL_ENV */
-#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_ARM_DARWIN_ENV)
#include
#endif
#endif /* AFS_VFSINCL_ENV */
diff --git a/src/vol/salvaged.c b/src/vol/salvaged.c
index b765f42a7c..29ecbe344a 100644
--- a/src/vol/salvaged.c
+++ b/src/vol/salvaged.c
@@ -60,7 +60,7 @@
#ifdef AFS_OSF_ENV
#include
#else /* AFS_OSF_ENV */
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_ARM_DARWIN_ENV)
#include
#endif
#endif
diff --git a/src/vol/salvager.c b/src/vol/salvager.c
index 3d294f59a4..1f66406ba1 100644
--- a/src/vol/salvager.c
+++ b/src/vol/salvager.c
@@ -63,7 +63,7 @@
#ifdef AFS_OSF_ENV
#include
#else /* AFS_OSF_ENV */
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_ARM_DARWIN_ENV)
#include
#endif
#endif
diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c
index 5f80744168..26c22a0724 100644
--- a/src/vol/vol-salvage.c
+++ b/src/vol/vol-salvage.c
@@ -130,7 +130,7 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
#ifdef AFS_OSF_ENV
#include
#else /* AFS_OSF_ENV */
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_ARM_DARWIN_ENV)
#include
#endif
#endif
diff --git a/src/vol/volume.c b/src/vol/volume.c
index 5b3973a67c..5b9f34892e 100644
--- a/src/vol/volume.c
+++ b/src/vol/volume.c
@@ -46,7 +46,7 @@
#endif
#endif
#else /* AFS_VFSINCL_ENV */
-#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_ARM_DARWIN_ENV)
#include
#endif
#endif /* AFS_VFSINCL_ENV */