dect
/
linux-2.6
Archived
13
0
Fork 0

um: kill HOST_TASK_PID

just provide get_current_pid() to the userland side of things
instead of get_current() + manual poking in its results

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Al Viro 2012-01-30 16:30:48 -05:00 committed by Richard Weinberger
parent 28a12cb598
commit c2220b2a12
4 changed files with 4 additions and 8 deletions

View File

@ -2,8 +2,6 @@
DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
OFFSET(HOST_TASK_PID, task_struct, pid);
DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);
DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK);
DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT);

View File

@ -48,7 +48,7 @@ extern void do_uml_exitcalls(void);
* GFP_ATOMIC.
*/
extern int __cant_sleep(void);
extern void *get_current(void);
extern int get_current_pid(void);
extern int copy_from_user_proc(void *to, void *from, int size);
extern int cpu(void);
extern char *uml_strdup(const char *string);

View File

@ -126,9 +126,9 @@ void exit_thread(void)
{
}
void *get_current(void)
int get_current_pid(void)
{
return current;
return task_pid_nr(current);
}
/*

View File

@ -13,8 +13,6 @@
static int host_has_cmov = 1;
static jmp_buf cmov_test_return;
#define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID]))
static void cmov_sigill_test_handler(int sig)
{
host_has_cmov = 0;
@ -51,7 +49,7 @@ void arch_examine_signal(int sig, struct uml_pt_regs *regs)
* This is testing for a cmov (0x0f 0x4x) instruction causing a
* SIGILL in init.
*/
if ((sig != SIGILL) || (TASK_PID(get_current()) != 1))
if ((sig != SIGILL) || (get_current_pid() != 1))
return;
if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) {