aboutsummaryrefslogtreecommitdiffstats
path: root/libc/arch-x86/syscalls/__getcpu.S
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-12-03 18:04:01 +0100
committerDavid 'Digit' Turner <digit@google.com>2010-12-06 13:42:54 +0100
commit72e6fd42421dca80fb2776a9185c186d4a04e5f7 (patch)
tree322fe185cb1e6bee163cb5c99ed5e1d545ae3c33 /libc/arch-x86/syscalls/__getcpu.S
parent6481b91520150e9664a3c4abc5d2aebdce422f93 (diff)
downloadandroid_bionic-72e6fd42421dca80fb2776a9185c186d4a04e5f7.tar.gz
android_bionic-72e6fd42421dca80fb2776a9185c186d4a04e5f7.tar.bz2
android_bionic-72e6fd42421dca80fb2776a9185c186d4a04e5f7.zip
<sched.h>: Add sched_getcpu() and cpu_set_t
This adds the cpu_set_t type definition and related functions and macros used to handle CPU thread affinity. sched_getcpu() sched_setaffinity() sched_getaffinity() Change-Id: If382ecafde8926341a88478062b275553645065b
Diffstat (limited to 'libc/arch-x86/syscalls/__getcpu.S')
-rw-r--r--libc/arch-x86/syscalls/__getcpu.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/libc/arch-x86/syscalls/__getcpu.S b/libc/arch-x86/syscalls/__getcpu.S
new file mode 100644
index 000000000..03817997e
--- /dev/null
+++ b/libc/arch-x86/syscalls/__getcpu.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __getcpu, @function
+ .globl __getcpu
+ .align 4
+
+__getcpu:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_getcpu, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret