]> git.saurik.com Git - apple/libpthread.git/blobdiff - src/pthread_asm.s
libpthread-218.51.1.tar.gz
[apple/libpthread.git] / src / pthread_asm.s
index df03a2592a4f10c6174bf7d1897e0936ee160380..8fc11c7187690b6f937f8edf8f1214e8f0e87478 100644 (file)
 
 #include <mach/i386/syscall_sw.h>
 
-       .text
-       .align 2, 0x90
-       .globl ___pthread_set_self
-___pthread_set_self:
-       movl    $0, %esi        // 0 as the second argument
-       movl    $ SYSCALL_CONSTRUCT_MDEP(3), %eax       // Machine-dependent syscall number 3
-       MACHDEP_SYSCALL_TRAP
-       ret
-
 #ifndef VARIANT_DYLD
 
        .align 2, 0x90
@@ -64,17 +55,6 @@ _thread_start:
 
 #include <mach/i386/syscall_sw.h>
 
-       .text
-       .align 2, 0x90
-       .globl ___pthread_set_self
-___pthread_set_self:
-       pushl   4(%esp)
-       pushl   $0
-       movl    $3,%eax
-       MACHDEP_SYSCALL_TRAP
-       addl    $8,%esp
-       ret
-
 #ifndef VARIANT_DYLD
 
        .align 2, 0x90
@@ -84,6 +64,7 @@ _start_wqthread:
        push   %ebp
        mov    %esp,%ebp
        sub    $28,%esp         // align the stack
+       mov    %esi,20(%esp)    //arg5
        mov    %edi,16(%esp)    //arg5
        mov    %edx,12(%esp)    //arg4
        mov    %ecx,8(%esp)             //arg3
@@ -116,16 +97,6 @@ _thread_start:
 
 #include <mach/arm/syscall_sw.h>
 
-       .text
-       .align 2
-       .globl ___pthread_set_self
-___pthread_set_self:
-       /* fast trap for thread_set_cthread */
-       mov     r3, #2
-       mov     r12, #0x80000000
-       swi     #SWI_SYSCALL
-       bx      lr
-
 #ifndef VARIANT_DYLD
 
 // This routine is never called directly by user code, jumped from kernel
@@ -138,6 +109,10 @@ ___pthread_set_self:
        .align 2
        .globl _start_wqthread
 _start_wqthread:
+#if __ARM_ARCH_7K__
+       /* align stack to 16 bytes before calling C */
+       sub sp, sp, #8
+#endif
        stmfd sp!, {r4, r5}
        bl __pthread_wqthread
 // Stackshots will show the routine that happens to link immediately following
@@ -149,6 +124,10 @@ _start_wqthread:
        .align 2
        .globl _thread_start
 _thread_start:
+#if __ARM_ARCH_7K__
+       /* align stack to 16 bytes before calling C */
+       sub sp, sp, #8
+#endif
        stmfd sp!, {r4, r5}
        bl __pthread_start
 // See above