]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/ppc/IOSharedLockImp.h
xnu-201.14.tar.gz
[apple/xnu.git] / iokit / IOKit / ppc / IOSharedLockImp.h
index 3bff4b078b9707f98e84e84d607a858f3748ac32..01bb64e76219fb2c7d35cd43a0d4c53d9145c2ad 100644 (file)
 #define _IOKIT_IOSHAREDLOCKIMP_H
 
 #include <architecture/ppc/asm_help.h>
+#ifdef KERNEL
+#undef END
+#include <mach/ppc/asm.h>
+#endif
 
-// 'Till we're building in kernel
 .macro DISABLE_PREEMPTION
 #ifdef KERNEL
+       stwu    r1,-(FM_SIZE)(r1)
+       mflr    r0
+       stw             r3,FM_ARG0(r1)
+       stw             r0,(FM_SIZE+FM_LR_SAVE)(r1)
+       bl              EXT(_disable_preemption)
+       lwz             r3,FM_ARG0(r1)
+       lwz             r1,0(r1)
+       lwz             r0,FM_LR_SAVE(r1)
+       mtlr    r0
 #endif
 .endmacro
 .macro ENABLE_PREEMPTION
 #ifdef KERNEL
+       stwu    r1,-(FM_SIZE)(r1)
+       mflr    r0
+       stw             r3,FM_ARG0(r1)
+       stw             r0,(FM_SIZE+FM_LR_SAVE)(r1)
+       bl              EXT(_enable_preemption)
+       lwz             r3,FM_ARG0(r1)
+       lwz             r1,0(r1)
+       lwz             r0,FM_LR_SAVE(r1)
+       mtlr    r0
 #endif
 .endmacro