Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
10d8f7ec
Commit
10d8f7ec
authored
Aug 17, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken x86_64 ioport code
parent
affd2b3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
arch/x86_64/kernel/ioport.c
arch/x86_64/kernel/ioport.c
+4
-8
No files found.
arch/x86_64/kernel/ioport.c
View file @
10d8f7ec
...
...
@@ -58,15 +58,13 @@ static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_
asmlinkage
long
sys_ioperm
(
unsigned
long
from
,
unsigned
long
num
,
int
turn_on
)
{
struct
thread_struct
*
t
=
&
current
->
thread
;
int
cpu
=
get_cpu
()
;
struct
tss_struct
*
tss
;
if
((
from
+
num
<=
from
)
||
(
from
+
num
>
IO_BITMAP_SIZE
*
32
))
return
-
EINVAL
;
if
(
turn_on
&&
!
capable
(
CAP_SYS_RAWIO
))
return
-
EPERM
;
struct
tss_struct
*
tss
=
init_tss
+
cpu
;
/*
* If it's the first ioperm() call in this thread's lifetime, set the
* IO bitmap up. ioperm() is much less timing critical than clone(),
...
...
@@ -74,10 +72,8 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
*/
if
(
!
t
->
io_bitmap_ptr
)
{
t
->
io_bitmap_ptr
=
kmalloc
(
IO_BITMAP_BYTES
,
GFP_KERNEL
);
if
(
!
t
->
io_bitmap_ptr
)
{
put_cpu
();
if
(
!
t
->
io_bitmap_ptr
)
return
-
ENOMEM
;
}
memset
(
t
->
io_bitmap_ptr
,
0xff
,
IO_BITMAP_BYTES
);
}
...
...
@@ -86,13 +82,13 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
* do it in the per-thread copy and in the TSS ...
*/
set_bitmap
((
unsigned
long
*
)
t
->
io_bitmap_ptr
,
from
,
num
,
!
turn_on
);
tss
=
init_tss
+
get_cpu
();
if
(
tss
->
io_map_base
!=
IO_BITMAP_OFFSET
)
{
memcpy
(
tss
->
io_bitmap
,
t
->
io_bitmap_ptr
,
sizeof
(
tss
->
io_bitmap
));
tss
->
io_map_base
=
IO_BITMAP_OFFSET
;
}
else
{
set_bitmap
((
unsigned
long
*
)
tss
->
io_bitmap
,
from
,
num
,
!
turn_on
);
}
put_cpu
();
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment