We also don't need legacy syscall support (non-"swi 0").
Change-Id: Id1012e8ca18bf13f3f4e42200f39ba0e2e632cbf
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <asm/unistd.h>
+
#include <machine/asm.h>
+#include <sys/linux-syscalls.h>
-@ void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode)
+// void _exit_with_stack_teardown(void* stackBase, int stackSize, int retCode)
ENTRY(_exit_with_stack_teardown)
-
-#if __ARM_EABI__
mov lr, r2
ldr r7, =__NR_munmap
- swi #0 @ the stack is destroyed by this call
+ swi #0 // the stack is destroyed by this call
mov r0, lr
ldr r7, =__NR_exit
swi #0
-#else
- mov lr, r2
- swi # __NR_munmap @ the stack is destroyed by this call
- mov r0, lr
- swi # __NR_exit
-#endif
- @ exit() should never return, cause a crash if it does
- mov r0, #0
- ldr r0, [r0]
+ // exit() should never return, cause a crash if it does
+ mov r0, #0
+ ldr r0, [r0]
END(_exit_with_stack_teardown)
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <sys/linux-syscalls.h>
+
#include <machine/asm.h>
+#include <sys/linux-syscalls.h>
ENTRY(__pthread_clone)
@ insert the args onto the new stack
@ new sp is already in r1
-#if __ARM_EABI__
stmfd sp!, {r4, r7}
ldr r7, =__NR_clone
swi #0
-#else
- swi #__NR_clone
-#endif
movs r0, r0
-#if __ARM_EABI__
ldmnefd sp!, {r4, r7}
-#endif
blt __error
bxne lr
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
-#include <machine/cpu-features.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-/* __futex_wait(*ftx, val, *timespec) */
-/* __futex_wake(*ftx, counter) */
-/* __futex_syscall3(*ftx, op, val) */
-/* __futex_syscall4(*ftx, op, val, *timespec) */
-
-.global __futex_wait
-.type __futex_wait, %function
-
-.global __futex_wake
-.type __futex_wake, %function
-
-.global __futex_syscall3
-.type __futex_syscall3, %function
-
-.global __futex_syscall4
-.type __futex_syscall4, %function
-
-#if __ARM_EABI__
-
+// __futex_syscall3(*ftx, op, val)
ENTRY(__futex_syscall3)
stmdb sp!, {r4, r7}
.save {r4, r7}
bx lr
END(__futex_syscall3)
+// __futex_syscall4(*ftx, op, val, *timespec)
+ENTRY(__futex_syscall4)
+ b __futex_syscall3
+END(__futex_syscall4)
+
+// __futex_wait(*ftx, val, *timespec)
ENTRY(__futex_wait)
stmdb sp!, {r4, r7}
.save {r4, r7}
bx lr
END(__futex_wait)
+// __futex_wake(*ftx, counter)
ENTRY(__futex_wake)
.save {r4, r7}
stmdb sp!, {r4, r7}
ldmia sp!, {r4, r7}
bx lr
END(__futex_wake)
-
-#else
-
-ENTRY(__futex_syscall3)
- swi #__NR_futex
- bx lr
-END(__futex_syscall3)
-
-ENTRY(__futex_wait)
- mov r3, r2
- mov r2, r1
- mov r1, #FUTEX_WAIT
- swi #__NR_futex
- bx lr
-END(__futex_wait)
-
-ENTRY(__futex_wake)
- mov r2, r1
- mov r1, #FUTEX_WAKE
- swi #__NR_futex
- bx lr
-END(__futex_wake)
-
-#endif
-
-ENTRY(__futex_syscall4)
- b __futex_syscall3
-END(__futex_syscall4)
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <sys/linux-syscalls.h>
-
-
- .text
- .align 4
- .type syscall,#function
- .globl syscall
-
- .text
- .align
-#if __ARM_EABI__
+#include <machine/asm.h>
+#include <sys/linux-syscalls.h>
-syscall:
+ENTRY(syscall)
mov ip, sp
- stmfd sp!, {r4, r5, r6, r7}
+ stmfd sp!, {r4, r5, r6, r7}
mov r7, r0
mov r0, r1
mov r1, r2
mov r2, r3
- ldmfd ip, {r3, r4, r5, r6}
+ ldmfd ip, {r3, r4, r5, r6}
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
-
-#else
-
-#ifndef __NR_syscall
-#define __NR_syscall 113
-#endif
-
-syscall:
- stmfd sp!, {r4, r5, lr}
- ldr r4, [sp, #12]
- ldr r5, [sp, #16]
- swi __NR_syscall
- ldmfd sp!, {r4, r5, lr}
- movs r0, r0
- bxpl lr
- b __set_syscall_errno
-
-#endif
+END(syscall)