From d426b045332718ae6d42237303d657fd97c51455 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 23 Jul 2012 16:54:53 -0400 Subject: add ioperm/iopl syscalls based on patches by orc and Isaac Dunham, with some fixes. sys/io.h exists and contains prototypes for these functions regardless of whether the target arch has them; this is a bit unorthodox but I don't think it will break anything. the function definitions do not exist unless the appropriate SYS_* syscall number macro is defined, which should make sure configure scripts looking for these functions don't find them on other systems. presently, sys/io.h does not have the inb/outb/etc. port io macros/functions. I'd be surprised if ioperm/iopl are useful without them, so they probably need to be added at some point in appropriate bits/io.h files... --- src/linux/ioperm.c | 9 +++++++++ src/linux/iopl.c | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/linux/ioperm.c create mode 100644 src/linux/iopl.c (limited to 'src/linux') diff --git a/src/linux/ioperm.c b/src/linux/ioperm.c new file mode 100644 index 00000000..6d7c37d0 --- /dev/null +++ b/src/linux/ioperm.c @@ -0,0 +1,9 @@ +#include +#include "syscall.h" + +#ifdef SYS_ioperm +int ioperm(unsigned long from, unsigned long num, int turn_on) +{ + return syscall(SYS_ioperm, from, num, turn_on); +} +#endif diff --git a/src/linux/iopl.c b/src/linux/iopl.c new file mode 100644 index 00000000..5a626e16 --- /dev/null +++ b/src/linux/iopl.c @@ -0,0 +1,9 @@ +#include +#include "syscall.h" + +#ifdef SYS_iopl +int iopl(int level) +{ + return syscall(SYS_iopl, level); +} +#endif -- cgit v1.2.1