From: Aaron Carroll Date: Fri, 12 Apr 2013 05:59:01 +0000 (+0200) Subject: android: add shm syscalls and fix ioprio definitions X-Git-Tag: fio-2.1~46 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=a415b2ccee389e27a2d5c8cdb28de9dbd65cea57 android: add shm syscalls and fix ioprio definitions Signed-off-by: Jens Axboe --- diff --git a/arch/arch-x86.h b/arch/arch-x86.h index 8eea5381..69cf60b3 100644 --- a/arch/arch-x86.h +++ b/arch/arch-x86.h @@ -20,6 +20,12 @@ #define __NR_sys_vmsplice 316 #endif +#ifndef __NR_shmget +#define __NR_shmget 29 +#define __NR_shmat 30 +#define __NR_shmctl 31 +#endif + #define FIO_HUGE_PAGE 4194304 #define nop __asm__ __volatile__("rep;nop": : :"memory") diff --git a/os/os-android.h b/os/os-android.h index 070aa1a3..b8449828 100644 --- a/os/os-android.h +++ b/os/os-android.h @@ -79,11 +79,6 @@ static inline int shmdt (const void *__shmaddr) #define SPLICE_DEF_SIZE (64*1024) -static inline int ioprio_set(int which, int who, int ioprio) -{ - return syscall(__NR_ioprio_set, which, who, ioprio); -} - enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, @@ -100,6 +95,18 @@ enum { #define IOPRIO_BITS 16 #define IOPRIO_CLASS_SHIFT 13 +static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio) +{ + /* + * If no class is set, assume BE + */ + if (!ioprio_class) + ioprio_class = IOPRIO_CLASS_BE; + + ioprio |= ioprio_class << IOPRIO_CLASS_SHIFT; + return syscall(__NR_ioprio_set, which, who, ioprio); +} + #ifndef BLKGETSIZE64 #define BLKGETSIZE64 _IOR(0x12,114,size_t) #endif