Add back Darling specific changes.

This commit is contained in:
Thomas A 2021-12-12 09:28:49 -08:00
parent 53b3cfe92e
commit ef0b4e2b16
3 changed files with 8 additions and 4 deletions

View File

@ -252,6 +252,7 @@ OS_ATOMIC_FUNCTION_START(OSAtomicDequeue, 2)
* void OSAtomicFifoEnqueue( OSFifoQueueHead *list, void *new, size_t offset);
*/
OS_ATOMIC_FUNCTION_START(OSAtomicFifoEnqueue$VARIANT$PFZ, 2)
#ifndef DARLING // Linux has not preemption free zone (PFZ), this needs to be rewrittenc
pushq %rbx
xorl %ebx,%ebx // clear "preemption pending" flag
movq _commpage_pfz_base(%rip),%rcx
@ -262,11 +263,13 @@ OS_ATOMIC_FUNCTION_START(OSAtomicFifoEnqueue$VARIANT$PFZ, 2)
call _preempt // call into the kernel to pfz_exit
1:
popq %rbx
#endif
ret
/* void* OSAtomicFifoDequeue( OSFifoQueueHead *list, size_t offset); */
OS_ATOMIC_FUNCTION_START(OSAtomicFifoDequeue$VARIANT$PFZ, 2)
#ifndef DARLING
pushq %rbx
xorl %ebx,%ebx // clear "preemption pending" flag
movq _commpage_pfz_base(%rip), %rcx
@ -278,6 +281,7 @@ OS_ATOMIC_FUNCTION_START(OSAtomicFifoDequeue$VARIANT$PFZ, 2)
call _preempt // call into the kernel to pfz_exit
1:
popq %rbx
#endif
ret // ptr to 1st element in Q in %rax
// Local Variables:

View File

@ -57,7 +57,7 @@ ffsll(long long mask)
#endif
}
#if VARIANT_DYLD && TARGET_OS_SIMULATOR
// #if VARIANT_DYLD && TARGET_OS_SIMULATOR
int
ffsl(long mask)
{
@ -99,5 +99,5 @@ ffs(int mask)
return (bit);
#endif
}
#endif
// #endif

View File

@ -57,7 +57,7 @@ flsll(long long mask)
#endif
}
#if VARIANT_DYLD && TARGET_OS_SIMULATOR
// #if VARIANT_DYLD && TARGET_OS_SIMULATOR
int
flsl(long mask)
{
@ -99,4 +99,4 @@ fls(int mask)
return (bit);
#endif
}
#endif
// #endif