patch-2.3.16 linux/arch/arm/kernel/ioport.c

Next file: linux/arch/arm/kernel/irq.c
Previous file: linux/arch/arm/kernel/hw-footbridge.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/arch/arm/kernel/ioport.c linux/arch/arm/kernel/ioport.c
@@ -0,0 +1,27 @@
+/*
+ * linux/arch/arm/kernel/ioport.c
+ *
+ * IO permission support for ARM.
+ */
+
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/ioport.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+
+asmlinkage int sys_iopl(unsigned long turn_on)
+{
+	if (turn_on && !capable(CAP_SYS_RAWIO))
+		return -EPERM;
+
+	/*
+	 * We only support an on_off approach
+	 */
+	modify_domain(DOMAIN_IO, turn_on ? DOMAIN_MANAGER : DOMAIN_CLIENT);
+
+	return 0;
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)