summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libc/SYSCALLS.TXT4
-rw-r--r--libc/arch-arm/syscalls.mk2
-rw-r--r--libc/arch-arm/syscalls/ioprio_get.S19
-rw-r--r--libc/arch-arm/syscalls/ioprio_set.S19
-rw-r--r--libc/arch-sh/syscalls.mk2
-rw-r--r--libc/arch-sh/syscalls/ioprio_get.S32
-rw-r--r--libc/arch-sh/syscalls/ioprio_set.S32
-rw-r--r--libc/arch-x86/syscalls.mk2
-rw-r--r--libc/arch-x86/syscalls/ioprio_get.S26
-rw-r--r--libc/arch-x86/syscalls/ioprio_set.S29
-rw-r--r--libc/include/sys/linux-syscalls.h6
-rw-r--r--libc/include/sys/linux-unistd.h2
12 files changed, 175 insertions, 0 deletions
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 6a21b04..423a24e 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -227,6 +227,10 @@ int sched_get_priority_max(int policy) 159
int sched_get_priority_min(int policy) 160
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161
+# io priorities
+int ioprio_set(int which, int who, int ioprio) 314,289
+int ioprio_get(int which, int who) 315,290
+
# other
int uname(struct utsname *) 122
pid_t __wait4:wait4(pid_t pid, int *status, int options, struct rusage *rusage) 114
diff --git a/libc/arch-arm/syscalls.mk b/libc/arch-arm/syscalls.mk
index 5f416e8..96471bf 100644
--- a/libc/arch-arm/syscalls.mk
+++ b/libc/arch-arm/syscalls.mk
@@ -150,6 +150,8 @@ syscall_src += arch-arm/syscalls/sched_getparam.S
syscall_src += arch-arm/syscalls/sched_get_priority_max.S
syscall_src += arch-arm/syscalls/sched_get_priority_min.S
syscall_src += arch-arm/syscalls/sched_rr_get_interval.S
+syscall_src += arch-arm/syscalls/ioprio_set.S
+syscall_src += arch-arm/syscalls/ioprio_get.S
syscall_src += arch-arm/syscalls/uname.S
syscall_src += arch-arm/syscalls/__wait4.S
syscall_src += arch-arm/syscalls/umask.S
diff --git a/libc/arch-arm/syscalls/ioprio_get.S b/libc/arch-arm/syscalls/ioprio_get.S
new file mode 100644
index 0000000..d686e98
--- /dev/null
+++ b/libc/arch-arm/syscalls/ioprio_get.S
@@ -0,0 +1,19 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ioprio_get, #function
+ .globl ioprio_get
+ .align 4
+ .fnstart
+
+ioprio_get:
+ .save {r4, r7}
+ stmfd sp!, {r4, r7}
+ ldr r7, =__NR_ioprio_get
+ swi #0
+ ldmfd sp!, {r4, r7}
+ movs r0, r0
+ bxpl lr
+ b __set_syscall_errno
+ .fnend
diff --git a/libc/arch-arm/syscalls/ioprio_set.S b/libc/arch-arm/syscalls/ioprio_set.S
new file mode 100644
index 0000000..a812557
--- /dev/null
+++ b/libc/arch-arm/syscalls/ioprio_set.S
@@ -0,0 +1,19 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ioprio_set, #function
+ .globl ioprio_set
+ .align 4
+ .fnstart
+
+ioprio_set:
+ .save {r4, r7}
+ stmfd sp!, {r4, r7}
+ ldr r7, =__NR_ioprio_set
+ 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 d3e531e..ac12ae4 100644
--- a/libc/arch-sh/syscalls.mk
+++ b/libc/arch-sh/syscalls.mk
@@ -139,6 +139,8 @@ syscall_src += arch-sh/syscalls/sched_getparam.S
syscall_src += arch-sh/syscalls/sched_get_priority_max.S
syscall_src += arch-sh/syscalls/sched_get_priority_min.S
syscall_src += arch-sh/syscalls/sched_rr_get_interval.S
+syscall_src += arch-sh/syscalls/ioprio_set.S
+syscall_src += arch-sh/syscalls/ioprio_get.S
syscall_src += arch-sh/syscalls/uname.S
syscall_src += arch-sh/syscalls/__wait4.S
syscall_src += arch-sh/syscalls/umask.S
diff --git a/libc/arch-sh/syscalls/ioprio_get.S b/libc/arch-sh/syscalls/ioprio_get.S
new file mode 100644
index 0000000..802eb91
--- /dev/null
+++ b/libc/arch-sh/syscalls/ioprio_get.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ioprio_get, @function
+ .globl ioprio_get
+ .align 4
+
+ioprio_get:
+
+ /* invoke trap */
+ mov.l 0f, r3 /* trap num */
+ trapa #(2 + 0x10)
+
+ /* check return value */
+ cmp/pz r0
+ bt __NR_ioprio_get_end
+
+ /* keep error number */
+ sts.l pr, @-r15
+ mov.l 1f, r1
+ jsr @r1
+ mov r0, r4
+ lds.l @r15+, pr
+
+__NR_ioprio_get_end:
+ rts
+ nop
+
+ .align 2
+0: .long __NR_ioprio_get
+1: .long __set_syscall_errno
diff --git a/libc/arch-sh/syscalls/ioprio_set.S b/libc/arch-sh/syscalls/ioprio_set.S
new file mode 100644
index 0000000..209d756
--- /dev/null
+++ b/libc/arch-sh/syscalls/ioprio_set.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ioprio_set, @function
+ .globl ioprio_set
+ .align 4
+
+ioprio_set:
+
+ /* invoke trap */
+ mov.l 0f, r3 /* trap num */
+ trapa #(3 + 0x10)
+
+ /* check return value */
+ cmp/pz r0
+ bt __NR_ioprio_set_end
+
+ /* keep error number */
+ sts.l pr, @-r15
+ mov.l 1f, r1
+ jsr @r1
+ mov r0, r4
+ lds.l @r15+, pr
+
+__NR_ioprio_set_end:
+ rts
+ nop
+
+ .align 2
+0: .long __NR_ioprio_set
+1: .long __set_syscall_errno
diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk
index e718e18..dbc55e6 100644
--- a/libc/arch-x86/syscalls.mk
+++ b/libc/arch-x86/syscalls.mk
@@ -153,6 +153,8 @@ syscall_src += arch-x86/syscalls/sched_getparam.S
syscall_src += arch-x86/syscalls/sched_get_priority_max.S
syscall_src += arch-x86/syscalls/sched_get_priority_min.S
syscall_src += arch-x86/syscalls/sched_rr_get_interval.S
+syscall_src += arch-x86/syscalls/ioprio_set.S
+syscall_src += arch-x86/syscalls/ioprio_get.S
syscall_src += arch-x86/syscalls/uname.S
syscall_src += arch-x86/syscalls/__wait4.S
syscall_src += arch-x86/syscalls/umask.S
diff --git a/libc/arch-x86/syscalls/ioprio_get.S b/libc/arch-x86/syscalls/ioprio_get.S
new file mode 100644
index 0000000..3620271
--- /dev/null
+++ b/libc/arch-x86/syscalls/ioprio_get.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ioprio_get, @function
+ .globl ioprio_get
+ .align 4
+
+ioprio_get:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_ioprio_get, %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
diff --git a/libc/arch-x86/syscalls/ioprio_set.S b/libc/arch-x86/syscalls/ioprio_set.S
new file mode 100644
index 0000000..174d923
--- /dev/null
+++ b/libc/arch-x86/syscalls/ioprio_set.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ioprio_set, @function
+ .globl ioprio_set
+ .align 4
+
+ioprio_set:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_ioprio_set, %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
diff --git a/libc/include/sys/linux-syscalls.h b/libc/include/sys/linux-syscalls.h
index 5d2b55e..c4e6e45 100644
--- a/libc/include/sys/linux-syscalls.h
+++ b/libc/include/sys/linux-syscalls.h
@@ -170,6 +170,8 @@
#define __NR_getsockopt (__NR_SYSCALL_BASE + 295)
#define __NR_sendmsg (__NR_SYSCALL_BASE + 296)
#define __NR_recvmsg (__NR_SYSCALL_BASE + 297)
+#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314)
+#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315)
#define __NR_epoll_create (__NR_SYSCALL_BASE + 250)
#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 251)
#define __NR_epoll_wait (__NR_SYSCALL_BASE + 252)
@@ -210,6 +212,8 @@
#define __NR_timer_delete (__NR_SYSCALL_BASE + 263)
#define __NR_utimes (__NR_SYSCALL_BASE + 271)
#define __NR_socketcall (__NR_SYSCALL_BASE + 102)
+#define __NR_ioprio_set (__NR_SYSCALL_BASE + 289)
+#define __NR_ioprio_get (__NR_SYSCALL_BASE + 290)
#define __NR_epoll_create (__NR_SYSCALL_BASE + 254)
#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 255)
#define __NR_epoll_wait (__NR_SYSCALL_BASE + 256)
@@ -264,6 +268,8 @@
#define __NR_socketcall (__NR_SYSCALL_BASE + 102)
#define __NR_socketcall (__NR_SYSCALL_BASE + 102)
#define __NR___socketcall (__NR_SYSCALL_BASE + 102)
+#define __NR_ioprio_set (__NR_SYSCALL_BASE + 289)
+#define __NR_ioprio_get (__NR_SYSCALL_BASE + 290)
#define __NR_epoll_create (__NR_SYSCALL_BASE + 254)
#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 255)
#define __NR_epoll_wait (__NR_SYSCALL_BASE + 256)
diff --git a/libc/include/sys/linux-unistd.h b/libc/include/sys/linux-unistd.h
index 9a151d2..f48dbcd 100644
--- a/libc/include/sys/linux-unistd.h
+++ b/libc/include/sys/linux-unistd.h
@@ -180,6 +180,8 @@ int sched_getparam (pid_t pid, struct sched_param *param);
int sched_get_priority_max (int policy);
int sched_get_priority_min (int policy);
int sched_rr_get_interval (pid_t pid, struct timespec *interval);
+int ioprio_set (int which, int who, int ioprio);
+int ioprio_get (int which, int who);
int uname (struct utsname *);
pid_t __wait4 (pid_t pid, int *status, int options, struct rusage *rusage);
mode_t umask (mode_t);