arm darwin update
authorDerrick Brashear <shadow@dementia.org>
Sun, 27 Feb 2011 02:55:19 +0000 (21:55 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 27 Feb 2011 09:31:34 +0000 (01:31 -0800)
some stuff that got lost from the last batch

Change-Id: Id892a8fce7c90a07c359d77282c557a0a9b41cd2
Reviewed-on: http://gerrit.openafs.org/4064
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

15 files changed:
src/afsd/afsd.c
src/cf/osconf.m4
src/config/param.arm_darwin_100.h
src/libafs/afs.arm_darwin_100.plist.in [new file with mode: 0644]
src/libafsrpc/Makefile.in
src/libuafs/Makefile.common.in
src/lwp/Makefile.in
src/lwp/lwp.c
src/lwp/process.s
src/shlibafsrpc/Makefile.in
src/vol/devname.c
src/vol/salvaged.c
src/vol/salvager.c
src/vol/vol-salvage.c
src/vol/volume.c

index d0c3c1d..ee6d33b 100644 (file)
@@ -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,&notify,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) {
index 2677892..76b7698 100644 (file)
@@ -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}"
index 5b657c4..39ca469 100644 (file)
 #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 (file)
index 0000000..a138571
--- /dev/null
@@ -0,0 +1,33 @@
+<?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>8.0</string>
+       <key>CFBundleName</key>
+       <string>afs</string>
+       <key>CFBundlePackageType</key>
+       <string>KEXT</string>
+       <key>CFBundleShortVersionString</key>
+       <string>@MACOS_VERSION@</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>@MACOS_VERSION@</string>
+       <key>OSBundleLibraries</key>
+       <dict>
+               <key>com.apple.kpi.bsd</key>
+               <string>8.0.0</string>
+               <key>com.apple.kpi.mach</key>
+               <string>8.0.0</string>
+               <key>com.apple.kpi.libkern</key>
+               <string>8.0</string>
+       </dict>
+</dict>
+</plist>
index 96a6462..08f3ad3 100644 (file)
@@ -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;             \
index 7b5c082..ef06baa 100644 (file)
@@ -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
 
index b58fa27..2c2aefe 100644 (file)
@@ -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 ; \
index c47c967..3e1290b 100644 (file)
@@ -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
index 5d26c87..dda0e5d 100644 (file)
 #include <afs/param.h>
 
 #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);
 
        .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}
index c0a2a27..92fbd81 100644 (file)
@@ -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?? ) \
index e884ecb..e7f0147 100644 (file)
@@ -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 <sys/fs.h>
 #endif
 #endif /* AFS_VFSINCL_ENV */
index b765f42..29ecbe3 100644 (file)
@@ -60,7 +60,7 @@
 #ifdef AFS_OSF_ENV
 #include <ufs/inode.h>
 #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 <sys/inode.h>
 #endif
 #endif
index 3d294f5..1f66406 100644 (file)
@@ -63,7 +63,7 @@
 #ifdef AFS_OSF_ENV
 #include <ufs/inode.h>
 #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 <sys/inode.h>
 #endif
 #endif
index 5f80744..26c22a0 100644 (file)
@@ -130,7 +130,7 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #ifdef AFS_OSF_ENV
 #include <ufs/inode.h>
 #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 <sys/inode.h>
 #endif
 #endif
index 5b3973a..5b9f348 100644 (file)
@@ -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 <sys/fs.h>
 #endif
 #endif /* AFS_VFSINCL_ENV */