git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git]
/
arch
/
mips
/
kernel
/
mips-mt.c
diff --git
a/arch/mips/kernel/mips-mt.c
b/arch/mips/kernel/mips-mt.c
index
02237a6
..
ba01800
100644
(file)
--- a/
arch/mips/kernel/mips-mt.c
+++ b/
arch/mips/kernel/mips-mt.c
@@
-3,10
+3,13
@@
* Copyright (C) 2005 Mips Technologies, Inc
*/
* Copyright (C) 2005 Mips Technologies, Inc
*/
+#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/cpumask.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/cpumask.h>
+#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
+#include <linux/security.h>
#include <asm/cpu.h>
#include <asm/processor.h>
#include <asm/cpu.h>
#include <asm/processor.h>
@@
-47,7
+50,7
@@
unsigned long mt_fpemul_threshold = 0;
* used in sys_sched_set/getaffinity() in kernel/sched.c, so
* cloned here.
*/
* used in sys_sched_set/getaffinity() in kernel/sched.c, so
* cloned here.
*/
-static inline
task_
t *find_process_by_pid(pid_t pid)
+static inline
struct task_struc
t *find_process_by_pid(pid_t pid)
{
return pid ? find_task_by_pid(pid) : current;
}
{
return pid ? find_task_by_pid(pid) : current;
}
@@
-62,7
+65,7
@@
asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
cpumask_t new_mask;
cpumask_t effective_mask;
int retval;
cpumask_t new_mask;
cpumask_t effective_mask;
int retval;
-
task_
t *p;
+
struct task_struc
t *p;
if (len < sizeof(new_mask))
return -EINVAL;
if (len < sizeof(new_mask))
return -EINVAL;
@@
-95,6
+98,10
@@
asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
goto out_unlock;
}
goto out_unlock;
}
+ retval = security_task_setscheduler(p, 0, NULL);
+ if (retval)
+ goto out_unlock;
+
/* Record new user-specified CPU set for future reference */
p->thread.user_cpus_allowed = new_mask;
/* Record new user-specified CPU set for future reference */
p->thread.user_cpus_allowed = new_mask;
@@
-127,7
+134,7
@@
asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,
unsigned int real_len;
cpumask_t mask;
int retval;
unsigned int real_len;
cpumask_t mask;
int retval;
-
task_
t *p;
+
struct task_struc
t *p;
real_len = sizeof(mask);
if (len < real_len)
real_len = sizeof(mask);
if (len < real_len)
@@
-140,8
+147,9
@@
asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,
p = find_process_by_pid(pid);
if (!p)
goto out_unlock;
p = find_process_by_pid(pid);
if (!p)
goto out_unlock;
-
- retval = 0;
+ retval = security_task_getscheduler(p);
+ if (retval)
+ goto out_unlock;
cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
@@
-447,3
+455,20
@@
void mt_cflush_release(void)
#endif /* CONFIG_MIPS_MT_SMTC */
/* FILL IN VSMP and AP/SP VERSIONS HERE */
}
#endif /* CONFIG_MIPS_MT_SMTC */
/* FILL IN VSMP and AP/SP VERSIONS HERE */
}
+
+struct class *mt_class;
+
+static int __init mt_init(void)
+{
+ struct class *mtc;
+
+ mtc = class_create(THIS_MODULE, "mt");
+ if (IS_ERR(mtc))
+ return PTR_ERR(mtc);
+
+ mt_class = mtc;
+
+ return 0;
+}
+
+subsys_initcall(mt_init);