am 691ef3c8: Merge "Add mlockall and munlockall for Google TV."

* commit '691ef3c80b4af278aa90d6e005ba42de1e52c140':
  Add mlockall and munlockall for Google TV.
This commit is contained in:
Elliott Hughes 2012-09-07 11:07:10 -07:00 committed by Android Git Automerger
commit 72fcdbe902
11 changed files with 130 additions and 1 deletions

View File

@ -23,7 +23,7 @@
# a relevant C stub
#
# - additionally, if the syscall number is different amoung ARM, and x86, MIPS use:
# return_type funcname[:syscall_name](parameters) arm_number,x86_number, mips_number
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,mips_number
#
# the file is processed by a python script named gensyscalls.py
#
@ -123,6 +123,8 @@ int mprotect(const void *, size_t, int) 125
int madvise(const void *, size_t, int) 220,219,218
int mlock(const void *addr, size_t len) 150,150,154
int munlock(const void *addr, size_t len) 151,151,155
int mlockall(int flags) 152,152,156
int munlockall() 153,153,157
int mincore(void* start, size_t length, unsigned char* vec) 219,218,217
int __ioctl:ioctl(int, int, void *) 54
int readv(int, const struct iovec *, int) 145

View File

@ -59,6 +59,8 @@ syscall_src += arch-arm/syscalls/mprotect.S
syscall_src += arch-arm/syscalls/madvise.S
syscall_src += arch-arm/syscalls/mlock.S
syscall_src += arch-arm/syscalls/munlock.S
syscall_src += arch-arm/syscalls/mlockall.S
syscall_src += arch-arm/syscalls/munlockall.S
syscall_src += arch-arm/syscalls/mincore.S
syscall_src += arch-arm/syscalls/__ioctl.S
syscall_src += arch-arm/syscalls/readv.S

View File

@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(mlockall)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_mlockall
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(mlockall)

View File

@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(munlockall)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_munlockall
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(munlockall)

View File

@ -63,6 +63,8 @@ syscall_src += arch-mips/syscalls/mprotect.S
syscall_src += arch-mips/syscalls/madvise.S
syscall_src += arch-mips/syscalls/mlock.S
syscall_src += arch-mips/syscalls/munlock.S
syscall_src += arch-mips/syscalls/mlockall.S
syscall_src += arch-mips/syscalls/munlockall.S
syscall_src += arch-mips/syscalls/mincore.S
syscall_src += arch-mips/syscalls/__ioctl.S
syscall_src += arch-mips/syscalls/readv.S

View File

@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl mlockall
.align 4
.ent mlockall
mlockall:
.set noreorder
.cpload $t9
li $v0, __NR_mlockall
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end mlockall

View File

@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl munlockall
.align 4
.ent munlockall
munlockall:
.set noreorder
.cpload $t9
li $v0, __NR_munlockall
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end munlockall

View File

@ -63,6 +63,8 @@ syscall_src += arch-x86/syscalls/mprotect.S
syscall_src += arch-x86/syscalls/madvise.S
syscall_src += arch-x86/syscalls/mlock.S
syscall_src += arch-x86/syscalls/munlock.S
syscall_src += arch-x86/syscalls/mlockall.S
syscall_src += arch-x86/syscalls/munlockall.S
syscall_src += arch-x86/syscalls/mincore.S
syscall_src += arch-x86/syscalls/__ioctl.S
syscall_src += arch-x86/syscalls/readv.S

View File

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

View File

@ -0,0 +1,20 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type munlockall, @function
.globl munlockall
.align 4
munlockall:
movl $__NR_munlockall, %eax
int $0x80
cmpl $-129, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret

View File

@ -119,6 +119,8 @@
#define __NR_madvise (__NR_SYSCALL_BASE + 220)
#define __NR_mlock (__NR_SYSCALL_BASE + 150)
#define __NR_munlock (__NR_SYSCALL_BASE + 151)
#define __NR_mlockall (__NR_SYSCALL_BASE + 152)
#define __NR_munlockall (__NR_SYSCALL_BASE + 153)
#define __NR_mincore (__NR_SYSCALL_BASE + 219)
#define __NR_pipe (__NR_SYSCALL_BASE + 42)
#define __NR_pipe2 (__NR_SYSCALL_BASE + 359)
@ -222,6 +224,8 @@
#define __NR_fdatasync (__NR_SYSCALL_BASE + 148)
#define __NR_mlock (__NR_SYSCALL_BASE + 150)
#define __NR_munlock (__NR_SYSCALL_BASE + 151)
#define __NR_mlockall (__NR_SYSCALL_BASE + 152)
#define __NR_munlockall (__NR_SYSCALL_BASE + 153)
#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154)
#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155)
#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156)
@ -350,6 +354,8 @@
#define __NR_fdatasync (__NR_SYSCALL_BASE + 152)
#define __NR_mlock (__NR_SYSCALL_BASE + 154)
#define __NR_munlock (__NR_SYSCALL_BASE + 155)
#define __NR_mlockall (__NR_SYSCALL_BASE + 156)
#define __NR_munlockall (__NR_SYSCALL_BASE + 157)
#define __NR_sched_setparam (__NR_SYSCALL_BASE + 158)
#define __NR_sched_getparam (__NR_SYSCALL_BASE + 159)
#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 160)