am f0f4fa3f: Merge "libc: add timerfd calls"
* commit 'f0f4fa3fb1ea8623b1e1bc59f7967e0470c8e532': libc: add timerfd calls
This commit is contained in:
commit
562804ff87
@ -221,6 +221,9 @@ int __timer_getoverrun:timer_getoverrun(timer_t)
|
||||
int __timer_delete:timer_delete(timer_t) 1
|
||||
int utimes(const char*, const struct timeval tvp[2]) 1
|
||||
int utimensat(int, const char *, const struct timespec times[2], int) 1
|
||||
int timerfd_create(clockid_t, int) 1
|
||||
int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *) 1
|
||||
int timerfd_gettime(int, struct itimerspec *) 1
|
||||
|
||||
# signals
|
||||
int sigaction(int, const struct sigaction *, struct sigaction *) 1
|
||||
|
@ -144,6 +144,9 @@ syscall_src += arch-arm/syscalls/__timer_getoverrun.S
|
||||
syscall_src += arch-arm/syscalls/__timer_delete.S
|
||||
syscall_src += arch-arm/syscalls/utimes.S
|
||||
syscall_src += arch-arm/syscalls/utimensat.S
|
||||
syscall_src += arch-arm/syscalls/timerfd_create.S
|
||||
syscall_src += arch-arm/syscalls/timerfd_settime.S
|
||||
syscall_src += arch-arm/syscalls/timerfd_gettime.S
|
||||
syscall_src += arch-arm/syscalls/sigaction.S
|
||||
syscall_src += arch-arm/syscalls/sigprocmask.S
|
||||
syscall_src += arch-arm/syscalls/__sigsuspend.S
|
||||
|
15
libc/arch-arm/syscalls/timerfd_create.S
Normal file
15
libc/arch-arm/syscalls/timerfd_create.S
Normal file
@ -0,0 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(timerfd_create)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timerfd_create
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(timerfd_create)
|
15
libc/arch-arm/syscalls/timerfd_gettime.S
Normal file
15
libc/arch-arm/syscalls/timerfd_gettime.S
Normal file
@ -0,0 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(timerfd_gettime)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timerfd_gettime
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(timerfd_gettime)
|
15
libc/arch-arm/syscalls/timerfd_settime.S
Normal file
15
libc/arch-arm/syscalls/timerfd_settime.S
Normal file
@ -0,0 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(timerfd_settime)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timerfd_settime
|
||||
swi #0
|
||||
mov r7, ip
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(timerfd_settime)
|
@ -147,6 +147,9 @@ syscall_src += arch-mips/syscalls/__timer_getoverrun.S
|
||||
syscall_src += arch-mips/syscalls/__timer_delete.S
|
||||
syscall_src += arch-mips/syscalls/utimes.S
|
||||
syscall_src += arch-mips/syscalls/utimensat.S
|
||||
syscall_src += arch-mips/syscalls/timerfd_create.S
|
||||
syscall_src += arch-mips/syscalls/timerfd_settime.S
|
||||
syscall_src += arch-mips/syscalls/timerfd_gettime.S
|
||||
syscall_src += arch-mips/syscalls/sigaction.S
|
||||
syscall_src += arch-mips/syscalls/sigprocmask.S
|
||||
syscall_src += arch-mips/syscalls/__sigsuspend.S
|
||||
|
22
libc/arch-mips/syscalls/timerfd_create.S
Normal file
22
libc/arch-mips/syscalls/timerfd_create.S
Normal file
@ -0,0 +1,22 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
.text
|
||||
.globl timerfd_create
|
||||
.align 4
|
||||
.ent timerfd_create
|
||||
|
||||
timerfd_create:
|
||||
.set noreorder
|
||||
.cpload $t9
|
||||
li $v0, __NR_timerfd_create
|
||||
syscall
|
||||
bnez $a3, 1f
|
||||
move $a0, $v0
|
||||
j $ra
|
||||
nop
|
||||
1:
|
||||
la $t9,__set_errno
|
||||
j $t9
|
||||
nop
|
||||
.set reorder
|
||||
.end timerfd_create
|
22
libc/arch-mips/syscalls/timerfd_gettime.S
Normal file
22
libc/arch-mips/syscalls/timerfd_gettime.S
Normal file
@ -0,0 +1,22 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
.text
|
||||
.globl timerfd_gettime
|
||||
.align 4
|
||||
.ent timerfd_gettime
|
||||
|
||||
timerfd_gettime:
|
||||
.set noreorder
|
||||
.cpload $t9
|
||||
li $v0, __NR_timerfd_gettime
|
||||
syscall
|
||||
bnez $a3, 1f
|
||||
move $a0, $v0
|
||||
j $ra
|
||||
nop
|
||||
1:
|
||||
la $t9,__set_errno
|
||||
j $t9
|
||||
nop
|
||||
.set reorder
|
||||
.end timerfd_gettime
|
22
libc/arch-mips/syscalls/timerfd_settime.S
Normal file
22
libc/arch-mips/syscalls/timerfd_settime.S
Normal file
@ -0,0 +1,22 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
.text
|
||||
.globl timerfd_settime
|
||||
.align 4
|
||||
.ent timerfd_settime
|
||||
|
||||
timerfd_settime:
|
||||
.set noreorder
|
||||
.cpload $t9
|
||||
li $v0, __NR_timerfd_settime
|
||||
syscall
|
||||
bnez $a3, 1f
|
||||
move $a0, $v0
|
||||
j $ra
|
||||
nop
|
||||
1:
|
||||
la $t9,__set_errno
|
||||
j $t9
|
||||
nop
|
||||
.set reorder
|
||||
.end timerfd_settime
|
@ -148,6 +148,9 @@ syscall_src += arch-x86/syscalls/__timer_getoverrun.S
|
||||
syscall_src += arch-x86/syscalls/__timer_delete.S
|
||||
syscall_src += arch-x86/syscalls/utimes.S
|
||||
syscall_src += arch-x86/syscalls/utimensat.S
|
||||
syscall_src += arch-x86/syscalls/timerfd_create.S
|
||||
syscall_src += arch-x86/syscalls/timerfd_settime.S
|
||||
syscall_src += arch-x86/syscalls/timerfd_gettime.S
|
||||
syscall_src += arch-x86/syscalls/sigaction.S
|
||||
syscall_src += arch-x86/syscalls/sigprocmask.S
|
||||
syscall_src += arch-x86/syscalls/__sigsuspend.S
|
||||
|
24
libc/arch-x86/syscalls/timerfd_create.S
Normal file
24
libc/arch-x86/syscalls/timerfd_create.S
Normal file
@ -0,0 +1,24 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
ENTRY(timerfd_create)
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
mov 12(%esp), %ebx
|
||||
mov 16(%esp), %ecx
|
||||
movl $__NR_timerfd_create, %eax
|
||||
int $0x80
|
||||
cmpl $-MAX_ERRNO, %eax
|
||||
jb 1f
|
||||
negl %eax
|
||||
pushl %eax
|
||||
call __set_errno
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
||||
END(timerfd_create)
|
24
libc/arch-x86/syscalls/timerfd_gettime.S
Normal file
24
libc/arch-x86/syscalls/timerfd_gettime.S
Normal file
@ -0,0 +1,24 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
ENTRY(timerfd_gettime)
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
mov 12(%esp), %ebx
|
||||
mov 16(%esp), %ecx
|
||||
movl $__NR_timerfd_gettime, %eax
|
||||
int $0x80
|
||||
cmpl $-MAX_ERRNO, %eax
|
||||
jb 1f
|
||||
negl %eax
|
||||
pushl %eax
|
||||
call __set_errno
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
||||
END(timerfd_gettime)
|
30
libc/arch-x86/syscalls/timerfd_settime.S
Normal file
30
libc/arch-x86/syscalls/timerfd_settime.S
Normal file
@ -0,0 +1,30 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
ENTRY(timerfd_settime)
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
pushl %edx
|
||||
pushl %esi
|
||||
mov 20(%esp), %ebx
|
||||
mov 24(%esp), %ecx
|
||||
mov 28(%esp), %edx
|
||||
mov 32(%esp), %esi
|
||||
movl $__NR_timerfd_settime, %eax
|
||||
int $0x80
|
||||
cmpl $-MAX_ERRNO, %eax
|
||||
jb 1f
|
||||
negl %eax
|
||||
pushl %eax
|
||||
call __set_errno
|
||||
addl $4, %esp
|
||||
orl $-1, %eax
|
||||
1:
|
||||
popl %esi
|
||||
popl %edx
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
||||
END(timerfd_settime)
|
45
libc/include/sys/timerfd.h
Normal file
45
libc/include/sys/timerfd.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIMERFD_H_
|
||||
#define _SYS_TIMERFD_H_
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/timerfd.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int timerfd_create(clockid_t, int);
|
||||
extern int timerfd_settime(int, int, const struct itimerspec*,
|
||||
struct itimerspec*);
|
||||
extern int timerfd_gettime(int, struct itimerspec*);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_TIMERFD_H */
|
31
libc/kernel/common/linux/timerfd.h
Normal file
31
libc/kernel/common/linux/timerfd.h
Normal file
@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
*** To edit the content of this header, modify the corresponding
|
||||
*** source file (e.g. under external/kernel-headers/original/) then
|
||||
*** run bionic/libc/kernel/tools/update_all.py
|
||||
***
|
||||
*** Any manual change here will be lost the next time this script will
|
||||
*** be run. You've been warned!
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_TIMERFD_H
|
||||
#define _LINUX_TIMERFD_H
|
||||
#include <linux/fcntl.h>
|
||||
#define TFD_TIMER_ABSTIME (1 << 0)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
|
||||
#define TFD_CLOEXEC O_CLOEXEC
|
||||
#define TFD_NONBLOCK O_NONBLOCK
|
||||
#define TFD_SHARED_FCNTL_FLAGS (TFD_CLOEXEC | TFD_NONBLOCK)
|
||||
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
||||
#define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS
|
||||
#define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET)
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user