summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-05-20 10:55:45 -0700
committerDavid 'Digit' Turner <digit@google.com>2010-06-09 13:12:15 -0700
commitaa4b1d042927872224e4bf5d22e4db5367e389fa (patch)
treede40a80b8f9d1d2dd6a75b45901927378a1aed45
parent6304d8b21891fd0cb7b5a4c25159a3d3b1709d62 (diff)
downloadbionic-aa4b1d042927872224e4bf5d22e4db5367e389fa.zip
bionic-aa4b1d042927872224e4bf5d22e4db5367e389fa.tar.gz
bionic-aa4b1d042927872224e4bf5d22e4db5367e389fa.tar.bz2
Add missing sysinfo() implementation (already declared in <sys/sysinfo.h>) - DO NOT MERGE
Change-Id: Iac4eb5911ffe4a7ab72b84df44e907685ac816af
-rw-r--r--libc/SYSCALLS.TXT1
-rw-r--r--libc/arch-arm/syscalls.mk1
-rw-r--r--libc/arch-arm/syscalls/sysinfo.S19
-rw-r--r--libc/arch-sh/syscalls.mk1
-rw-r--r--libc/arch-sh/syscalls/sysinfo.S32
-rw-r--r--libc/arch-x86/syscalls.mk1
-rw-r--r--libc/arch-x86/syscalls/sysinfo.S23
-rw-r--r--libc/docs/CHANGES.TXT3
-rw-r--r--libc/include/sys/linux-syscalls.h1
-rw-r--r--libc/include/sys/linux-unistd.h1
10 files changed, 83 insertions, 0 deletions
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 11407b9..bf65a6f 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -244,6 +244,7 @@ int __syslog:syslog(int, char *, int) 103
int init_module(void *, unsigned long, const char *) 128
int delete_module(const char*, unsigned int) 129
int klogctl:syslog(int, char *, int) 103
+int sysinfo(struct sysinfo *) 116
# futex
int futex(void *, int, int, void *, void *, int) 240
diff --git a/libc/arch-arm/syscalls.mk b/libc/arch-arm/syscalls.mk
index 9cdd28a..f6312e5 100644
--- a/libc/arch-arm/syscalls.mk
+++ b/libc/arch-arm/syscalls.mk
@@ -161,6 +161,7 @@ syscall_src += arch-arm/syscalls/__syslog.S
syscall_src += arch-arm/syscalls/init_module.S
syscall_src += arch-arm/syscalls/delete_module.S
syscall_src += arch-arm/syscalls/klogctl.S
+syscall_src += arch-arm/syscalls/sysinfo.S
syscall_src += arch-arm/syscalls/futex.S
syscall_src += arch-arm/syscalls/epoll_create.S
syscall_src += arch-arm/syscalls/epoll_ctl.S
diff --git a/libc/arch-arm/syscalls/sysinfo.S b/libc/arch-arm/syscalls/sysinfo.S
new file mode 100644
index 0000000..197324d
--- /dev/null
+++ b/libc/arch-arm/syscalls/sysinfo.S
@@ -0,0 +1,19 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sysinfo, #function
+ .globl sysinfo
+ .align 4
+ .fnstart
+
+sysinfo:
+ .save {r4, r7}
+ stmfd sp!, {r4, r7}
+ ldr r7, =__NR_sysinfo
+ swi #0
+ ldmfd sp!, {r4, r7}
+ movs r0, r0
+ bxpl lr
+ b __set_syscall_errno
+ .fnend
diff --git a/libc/arch-sh/syscalls.mk b/libc/arch-sh/syscalls.mk
index ab2f3d1..a8a151a 100644
--- a/libc/arch-sh/syscalls.mk
+++ b/libc/arch-sh/syscalls.mk
@@ -150,6 +150,7 @@ syscall_src += arch-sh/syscalls/__syslog.S
syscall_src += arch-sh/syscalls/init_module.S
syscall_src += arch-sh/syscalls/delete_module.S
syscall_src += arch-sh/syscalls/klogctl.S
+syscall_src += arch-sh/syscalls/sysinfo.S
syscall_src += arch-sh/syscalls/futex.S
syscall_src += arch-sh/syscalls/epoll_create.S
syscall_src += arch-sh/syscalls/epoll_ctl.S
diff --git a/libc/arch-sh/syscalls/sysinfo.S b/libc/arch-sh/syscalls/sysinfo.S
new file mode 100644
index 0000000..ae042ab
--- /dev/null
+++ b/libc/arch-sh/syscalls/sysinfo.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sysinfo, @function
+ .globl sysinfo
+ .align 4
+
+sysinfo:
+
+ /* invoke trap */
+ mov.l 0f, r3 /* trap num */
+ trapa #(1 + 0x10)
+
+ /* check return value */
+ cmp/pz r0
+ bt __NR_sysinfo_end
+
+ /* keep error number */
+ sts.l pr, @-r15
+ mov.l 1f, r1
+ jsr @r1
+ mov r0, r4
+ lds.l @r15+, pr
+
+__NR_sysinfo_end:
+ rts
+ nop
+
+ .align 2
+0: .long __NR_sysinfo
+1: .long __set_syscall_errno
diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk
index ab026fe..bd9a9ab 100644
--- a/libc/arch-x86/syscalls.mk
+++ b/libc/arch-x86/syscalls.mk
@@ -164,6 +164,7 @@ syscall_src += arch-x86/syscalls/__syslog.S
syscall_src += arch-x86/syscalls/init_module.S
syscall_src += arch-x86/syscalls/delete_module.S
syscall_src += arch-x86/syscalls/klogctl.S
+syscall_src += arch-x86/syscalls/sysinfo.S
syscall_src += arch-x86/syscalls/futex.S
syscall_src += arch-x86/syscalls/epoll_create.S
syscall_src += arch-x86/syscalls/epoll_ctl.S
diff --git a/libc/arch-x86/syscalls/sysinfo.S b/libc/arch-x86/syscalls/sysinfo.S
new file mode 100644
index 0000000..c60c37b
--- /dev/null
+++ b/libc/arch-x86/syscalls/sysinfo.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sysinfo, @function
+ .globl sysinfo
+ .align 4
+
+sysinfo:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sysinfo, %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
diff --git a/libc/docs/CHANGES.TXT b/libc/docs/CHANGES.TXT
index ce43f1e..256607c 100644
--- a/libc/docs/CHANGES.TXT
+++ b/libc/docs/CHANGES.TXT
@@ -8,6 +8,9 @@ Differences between current and Android 2.2:
- <semaphore.h>: Use private futexes for semaphore implementation,
unless your set 'pshared' to non-0 when calling sem_init().
+- <sys/sysinfo.h>: Added missing sysinfo() system call implementation
+ (the function was already declared in the header though).
+
-------------------------------------------------------------------------------
Differences between Android 2.2. and Android 2.1:
diff --git a/libc/include/sys/linux-syscalls.h b/libc/include/sys/linux-syscalls.h
index 6e373e0..5f03863 100644
--- a/libc/include/sys/linux-syscalls.h
+++ b/libc/include/sys/linux-syscalls.h
@@ -126,6 +126,7 @@
#define __NR_init_module (__NR_SYSCALL_BASE + 128)
#define __NR_delete_module (__NR_SYSCALL_BASE + 129)
#define __NR_syslog (__NR_SYSCALL_BASE + 103)
+#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
#define __NR_futex (__NR_SYSCALL_BASE + 240)
#define __NR_poll (__NR_SYSCALL_BASE + 168)
diff --git a/libc/include/sys/linux-unistd.h b/libc/include/sys/linux-unistd.h
index b0e7822..27db2a9 100644
--- a/libc/include/sys/linux-unistd.h
+++ b/libc/include/sys/linux-unistd.h
@@ -192,6 +192,7 @@ int __syslog (int, char *, int);
int init_module (void *, unsigned long, const char *);
int delete_module (const char*, unsigned int);
int klogctl (int, char *, int);
+int sysinfo (struct sysinfo *);
int futex (void *, int, int, void *, void *, int);
int epoll_create (int size);
int epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);