summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/ioport.c
blob: 07a52ba8e4c5ef833302a5477232cf685daaaecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * linux/arch/arm/kernel/ioport.c
 *
 * IO permission support for ARM.
 */

#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/mm.h>

#include <asm/pgtable.h>
#include <asm/uaccess.h>

#ifdef CONFIG_CPU_32
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;
}
#else
asmlinkage int sys_iopl(unsigned long turn_on)
{
	return -ENOSYS;
}
#endif