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
afb34093
Commit
afb34093
authored
Apr 08, 2003
by
Linus Torvalds
Committed by
Linus Torvalds
Apr 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate scheduler system calls as taking user pointers.
parent
5ef73fa6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
kernel/sched.c
kernel/sched.c
+9
-8
No files found.
kernel/sched.c
View file @
afb34093
...
@@ -1711,7 +1711,7 @@ static inline task_t *find_process_by_pid(pid_t pid)
...
@@ -1711,7 +1711,7 @@ static inline task_t *find_process_by_pid(pid_t pid)
/*
/*
* setscheduler - change the scheduling policy and/or RT priority of a thread.
* setscheduler - change the scheduling policy and/or RT priority of a thread.
*/
*/
static
int
setscheduler
(
pid_t
pid
,
int
policy
,
struct
sched_param
*
param
)
static
int
setscheduler
(
pid_t
pid
,
int
policy
,
struct
sched_param
__user
*
param
)
{
{
struct
sched_param
lp
;
struct
sched_param
lp
;
int
retval
=
-
EINVAL
;
int
retval
=
-
EINVAL
;
...
@@ -1804,7 +1804,7 @@ static int setscheduler(pid_t pid, int policy, struct sched_param *param)
...
@@ -1804,7 +1804,7 @@ static int setscheduler(pid_t pid, int policy, struct sched_param *param)
* @param: structure containing the new RT priority.
* @param: structure containing the new RT priority.
*/
*/
asmlinkage
long
sys_sched_setscheduler
(
pid_t
pid
,
int
policy
,
asmlinkage
long
sys_sched_setscheduler
(
pid_t
pid
,
int
policy
,
struct
sched_param
*
param
)
struct
sched_param
__user
*
param
)
{
{
return
setscheduler
(
pid
,
policy
,
param
);
return
setscheduler
(
pid
,
policy
,
param
);
}
}
...
@@ -1814,7 +1814,7 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
...
@@ -1814,7 +1814,7 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
* @pid: the pid in question.
* @pid: the pid in question.
* @param: structure containing the new RT priority.
* @param: structure containing the new RT priority.
*/
*/
asmlinkage
long
sys_sched_setparam
(
pid_t
pid
,
struct
sched_param
*
param
)
asmlinkage
long
sys_sched_setparam
(
pid_t
pid
,
struct
sched_param
__user
*
param
)
{
{
return
setscheduler
(
pid
,
-
1
,
param
);
return
setscheduler
(
pid
,
-
1
,
param
);
}
}
...
@@ -1850,7 +1850,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid)
...
@@ -1850,7 +1850,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid)
* @pid: the pid in question.
* @pid: the pid in question.
* @param: structure containing the RT priority.
* @param: structure containing the RT priority.
*/
*/
asmlinkage
long
sys_sched_getparam
(
pid_t
pid
,
struct
sched_param
*
param
)
asmlinkage
long
sys_sched_getparam
(
pid_t
pid
,
struct
sched_param
__user
*
param
)
{
{
struct
sched_param
lp
;
struct
sched_param
lp
;
int
retval
=
-
EINVAL
;
int
retval
=
-
EINVAL
;
...
@@ -1892,7 +1892,7 @@ asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param)
...
@@ -1892,7 +1892,7 @@ asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param)
* @user_mask_ptr: user-space pointer to the new cpu mask
* @user_mask_ptr: user-space pointer to the new cpu mask
*/
*/
asmlinkage
long
sys_sched_setaffinity
(
pid_t
pid
,
unsigned
int
len
,
asmlinkage
long
sys_sched_setaffinity
(
pid_t
pid
,
unsigned
int
len
,
unsigned
long
*
user_mask_ptr
)
unsigned
long
__user
*
user_mask_ptr
)
{
{
unsigned
long
new_mask
;
unsigned
long
new_mask
;
int
retval
;
int
retval
;
...
@@ -1944,7 +1944,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
...
@@ -1944,7 +1944,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
* @user_mask_ptr: user-space pointer to hold the current cpu mask
* @user_mask_ptr: user-space pointer to hold the current cpu mask
*/
*/
asmlinkage
long
sys_sched_getaffinity
(
pid_t
pid
,
unsigned
int
len
,
asmlinkage
long
sys_sched_getaffinity
(
pid_t
pid
,
unsigned
int
len
,
unsigned
long
*
user_mask_ptr
)
unsigned
long
__user
*
user_mask_ptr
)
{
{
unsigned
int
real_len
;
unsigned
int
real_len
;
unsigned
long
mask
;
unsigned
long
mask
;
...
@@ -2110,7 +2110,7 @@ asmlinkage long sys_sched_get_priority_min(int policy)
...
@@ -2110,7 +2110,7 @@ asmlinkage long sys_sched_get_priority_min(int policy)
* this syscall writes the default timeslice value of a given process
* this syscall writes the default timeslice value of a given process
* into the user-space timespec buffer. A value of '0' means infinity.
* into the user-space timespec buffer. A value of '0' means infinity.
*/
*/
asmlinkage
long
sys_sched_rr_get_interval
(
pid_t
pid
,
struct
timespec
*
interval
)
asmlinkage
long
sys_sched_rr_get_interval
(
pid_t
pid
,
struct
timespec
__user
*
interval
)
{
{
int
retval
=
-
EINVAL
;
int
retval
=
-
EINVAL
;
struct
timespec
t
;
struct
timespec
t
;
...
@@ -2343,7 +2343,8 @@ void set_cpus_allowed(task_t *p, unsigned long new_mask)
...
@@ -2343,7 +2343,8 @@ void set_cpus_allowed(task_t *p, unsigned long new_mask)
*/
*/
static
int
migration_thread
(
void
*
data
)
static
int
migration_thread
(
void
*
data
)
{
{
struct
sched_param
param
=
{
.
sched_priority
=
MAX_RT_PRIO
-
1
};
/* Marking "param" __user is ok, since we do a set_fs(KERNEL_DS); */
struct
sched_param
__user
param
=
{
.
sched_priority
=
MAX_RT_PRIO
-
1
};
int
cpu
=
(
long
)
data
;
int
cpu
=
(
long
)
data
;
runqueue_t
*
rq
;
runqueue_t
*
rq
;
int
ret
;
int
ret
;
...
...
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