Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234644
b: refs/heads/master
c: da1016d
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Ingo Molnar committed Feb 17, 2011
1 parent 9d68f23 commit 366006b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b82fef82d56789439e6be638a87a1a5bba1e6e75
refs/heads/master: da1016df85ed67b6f7dbb765532c54bc35ba08d7
20 changes: 5 additions & 15 deletions trunk/arch/x86/kernel/ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,9 @@
#include <linux/slab.h>
#include <linux/thread_info.h>
#include <linux/syscalls.h>
#include <linux/bitmap.h>
#include <asm/syscalls.h>

/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
static void set_bitmap(unsigned long *bitmap, unsigned int base,
unsigned int extent, int new_value)
{
unsigned int i;

for (i = base; i < base + extent; i++) {
if (new_value)
__set_bit(i, bitmap);
else
__clear_bit(i, bitmap);
}
}

/*
* this changes the io permissions bitmap in the current task.
*/
Expand Down Expand Up @@ -69,7 +56,10 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
*/
tss = &per_cpu(init_tss, get_cpu());

set_bitmap(t->io_bitmap_ptr, from, num, !turn_on);
if (turn_on)
bitmap_clear(t->io_bitmap_ptr, from, num);
else
bitmap_set(t->io_bitmap_ptr, from, num);

/*
* Search for a (possibly new) maximum. This is simple and stupid,
Expand Down

0 comments on commit 366006b

Please sign in to comment.