diff options
Diffstat (limited to 'arch/x86/kernel/ioport.c')
| -rw-r--r-- | arch/x86/kernel/ioport.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 8eec0ec59af2..8c968974253d 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c | |||
| @@ -14,22 +14,9 @@ | |||
| 14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
| 15 | #include <linux/thread_info.h> | 15 | #include <linux/thread_info.h> |
| 16 | #include <linux/syscalls.h> | 16 | #include <linux/syscalls.h> |
| 17 | #include <linux/bitmap.h> | ||
| 17 | #include <asm/syscalls.h> | 18 | #include <asm/syscalls.h> |
| 18 | 19 | ||
| 19 | /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ | ||
| 20 | static void set_bitmap(unsigned long *bitmap, unsigned int base, | ||
| 21 | unsigned int extent, int new_value) | ||
| 22 | { | ||
| 23 | unsigned int i; | ||
| 24 | |||
| 25 | for (i = base; i < base + extent; i++) { | ||
| 26 | if (new_value) | ||
| 27 | __set_bit(i, bitmap); | ||
| 28 | else | ||
| 29 | __clear_bit(i, bitmap); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | /* | 20 | /* |
| 34 | * this changes the io permissions bitmap in the current task. | 21 | * this changes the io permissions bitmap in the current task. |
| 35 | */ | 22 | */ |
| @@ -69,7 +56,10 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) | |||
| 69 | */ | 56 | */ |
| 70 | tss = &per_cpu(init_tss, get_cpu()); | 57 | tss = &per_cpu(init_tss, get_cpu()); |
| 71 | 58 | ||
| 72 | set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); | 59 | if (turn_on) |
| 60 | bitmap_clear(t->io_bitmap_ptr, from, num); | ||
| 61 | else | ||
| 62 | bitmap_set(t->io_bitmap_ptr, from, num); | ||
| 73 | 63 | ||
| 74 | /* | 64 | /* |
| 75 | * Search for a (possibly new) maximum. This is simple and stupid, | 65 | * Search for a (possibly new) maximum. This is simple and stupid, |
