add sigaltstack syscall

This commit is contained in:
Andrei Popescu 2010-02-25 13:27:46 +00:00
parent 8f8b5310d2
commit eb9d5ed347
10 changed files with 85 additions and 0 deletions

View file

@ -79,6 +79,7 @@ int chroot(const char *) 61
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172 int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172
int capget(cap_user_header_t header, cap_user_data_t data) 184 int capget(cap_user_header_t header, cap_user_data_t data) 184
int capset(cap_user_header_t header, const cap_user_data_t data) 185 int capset(cap_user_header_t header, const cap_user_data_t data) 185
int sigaltstack(const stack_t*, stack_t*) 186
int acct(const char* filepath) 51 int acct(const char* filepath) 51
# file descriptors # file descriptors

View file

@ -37,6 +37,7 @@ syscall_src += arch-arm/syscalls/chroot.S
syscall_src += arch-arm/syscalls/prctl.S syscall_src += arch-arm/syscalls/prctl.S
syscall_src += arch-arm/syscalls/capget.S syscall_src += arch-arm/syscalls/capget.S
syscall_src += arch-arm/syscalls/capset.S syscall_src += arch-arm/syscalls/capset.S
syscall_src += arch-arm/syscalls/sigaltstack.S
syscall_src += arch-arm/syscalls/acct.S syscall_src += arch-arm/syscalls/acct.S
syscall_src += arch-arm/syscalls/read.S syscall_src += arch-arm/syscalls/read.S
syscall_src += arch-arm/syscalls/write.S syscall_src += arch-arm/syscalls/write.S

View file

@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type sigaltstack, #function
.globl sigaltstack
.align 4
.fnstart
sigaltstack:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_sigaltstack
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View file

@ -41,6 +41,7 @@ syscall_src += arch-sh/syscalls/chroot.S
syscall_src += arch-sh/syscalls/prctl.S syscall_src += arch-sh/syscalls/prctl.S
syscall_src += arch-sh/syscalls/capget.S syscall_src += arch-sh/syscalls/capget.S
syscall_src += arch-sh/syscalls/capset.S syscall_src += arch-sh/syscalls/capset.S
syscall_src += arch-sh/syscalls/sigaltstack.S
syscall_src += arch-sh/syscalls/acct.S syscall_src += arch-sh/syscalls/acct.S
syscall_src += arch-sh/syscalls/read.S syscall_src += arch-sh/syscalls/read.S
syscall_src += arch-sh/syscalls/write.S syscall_src += arch-sh/syscalls/write.S

View file

@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type sigaltstack, @function
.globl sigaltstack
.align 4
sigaltstack:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(2 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_sigaltstack_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_sigaltstack_end:
rts
nop
.align 2
0: .long __NR_sigaltstack
1: .long __set_syscall_errno

View file

@ -40,6 +40,7 @@ syscall_src += arch-x86/syscalls/chroot.S
syscall_src += arch-x86/syscalls/prctl.S syscall_src += arch-x86/syscalls/prctl.S
syscall_src += arch-x86/syscalls/capget.S syscall_src += arch-x86/syscalls/capget.S
syscall_src += arch-x86/syscalls/capset.S syscall_src += arch-x86/syscalls/capset.S
syscall_src += arch-x86/syscalls/sigaltstack.S
syscall_src += arch-x86/syscalls/acct.S syscall_src += arch-x86/syscalls/acct.S
syscall_src += arch-x86/syscalls/read.S syscall_src += arch-x86/syscalls/read.S
syscall_src += arch-x86/syscalls/write.S syscall_src += arch-x86/syscalls/write.S

View file

@ -0,0 +1,26 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type sigaltstack, @function
.globl sigaltstack
.align 4
sigaltstack:
pushl %ebx
pushl %ecx
mov 12(%esp), %ebx
mov 16(%esp), %ecx
movl $__NR_sigaltstack, %eax
int $0x80
cmpl $-129, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx
ret

View file

@ -68,6 +68,8 @@ Differences between current and Android 2.1:
errno. Previous implementation returned -1 on error, setting errno, which errno. Previous implementation returned -1 on error, setting errno, which
is not Posix compliant. is not Posix compliant.
- add sigaltstack() implementation for ARM.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Differences between Android 2.1 and 2.0.1: Differences between Android 2.1 and 2.0.1:

View file

@ -42,6 +42,7 @@
#define __NR_prctl (__NR_SYSCALL_BASE + 172) #define __NR_prctl (__NR_SYSCALL_BASE + 172)
#define __NR_capget (__NR_SYSCALL_BASE + 184) #define __NR_capget (__NR_SYSCALL_BASE + 184)
#define __NR_capset (__NR_SYSCALL_BASE + 185) #define __NR_capset (__NR_SYSCALL_BASE + 185)
#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186)
#define __NR_acct (__NR_SYSCALL_BASE + 51) #define __NR_acct (__NR_SYSCALL_BASE + 51)
#define __NR_read (__NR_SYSCALL_BASE + 3) #define __NR_read (__NR_SYSCALL_BASE + 3)
#define __NR_write (__NR_SYSCALL_BASE + 4) #define __NR_write (__NR_SYSCALL_BASE + 4)

View file

@ -48,6 +48,7 @@ int chroot (const char *);
int prctl (int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5); int prctl (int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5);
int capget (cap_user_header_t header, cap_user_data_t data); int capget (cap_user_header_t header, cap_user_data_t data);
int capset (cap_user_header_t header, const cap_user_data_t data); int capset (cap_user_header_t header, const cap_user_data_t data);
int sigaltstack (const stack_t*, stack_t*);
int acct (const char* filepath); int acct (const char* filepath);
ssize_t read (int, void*, size_t); ssize_t read (int, void*, size_t);
ssize_t write (int, const void*, size_t); ssize_t write (int, const void*, size_t);