Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83186
b: refs/heads/master
c: a5a678c
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 5, 2008
1 parent 9e41423 commit 9c5e707
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 42 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: 009ec2a915ba52f6b647c4076f4a2e259cba85aa
refs/heads/master: a5a678c80beac4d163babda243a27eeb9c89bd89
8 changes: 4 additions & 4 deletions trunk/arch/um/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void default_idle(void)

void cpu_idle(void)
{
cpu_tasks[current_thread->cpu].pid = os_getpid();
cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
default_idle();
}

Expand All @@ -269,7 +269,7 @@ int user_context(unsigned long sp)
unsigned long stack;

stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER);
return stack != (unsigned long) current_thread;
return stack != (unsigned long) current_thread_info();
}

extern exitcall_t __uml_exitcall_begin, __uml_exitcall_end;
Expand Down Expand Up @@ -311,7 +311,7 @@ int strlen_user_proc(char __user *str)
int smp_sigio_handler(void)
{
#ifdef CONFIG_SMP
int cpu = current_thread->cpu;
int cpu = current_thread_info()->cpu;
IPI_handler(cpu);
if (cpu != 0)
return 1;
Expand All @@ -321,7 +321,7 @@ int smp_sigio_handler(void)

int cpu(void)
{
return current_thread->cpu;
return current_thread_info()->cpu;
}

static atomic_t using_sysemu = ATOMIC_INIT(0);
Expand Down
18 changes: 8 additions & 10 deletions trunk/arch/um/sys-i386/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ static int copy_sc_from_user(struct pt_regs *regs,
struct sigcontext __user *from)
{
struct sigcontext sc;
int err;
int err, pid;

err = copy_from_user(&sc, from, sizeof(sc));
if (err)
return err;

pid = userspace_pid[current_thread_info()->cpu];
copy_sc(&regs->regs, &sc);
if (have_fpx_regs) {
struct user_fxsr_struct fpx;
Expand All @@ -187,8 +188,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
if (err)
return 1;

err = restore_fpx_registers(userspace_pid[current_thread->cpu],
(unsigned long *) &fpx);
err = restore_fpx_registers(pid, (unsigned long *) &fpx);
if (err < 0) {
printk(KERN_ERR "copy_sc_from_user - "
"restore_fpx_registers failed, errno = %d\n",
Expand All @@ -204,8 +204,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
if (err)
return 1;

err = restore_fp_registers(userspace_pid[current_thread->cpu],
(unsigned long *) &fp);
err = restore_fp_registers(pid, (unsigned long *) &fp);
if (err < 0) {
printk(KERN_ERR "copy_sc_from_user - "
"restore_fp_registers failed, errno = %d\n",
Expand All @@ -223,7 +222,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
{
struct sigcontext sc;
struct faultinfo * fi = &current->thread.arch.faultinfo;
int err;
int err, pid;

sc.gs = REGS_GS(regs->regs.gp);
sc.fs = REGS_FS(regs->regs.gp);
Expand All @@ -249,11 +248,11 @@ static int copy_sc_to_user(struct sigcontext __user *to,
to_fp = (to_fp ? to_fp : (struct _fpstate __user *) (to + 1));
sc.fpstate = to_fp;

pid = userspace_pid[current_thread_info()->cpu];
if (have_fpx_regs) {
struct user_fxsr_struct fpx;

err = save_fpx_registers(userspace_pid[current_thread->cpu],
(unsigned long *) &fpx);
err = save_fpx_registers(pid, (unsigned long *) &fpx);
if (err < 0){
printk(KERN_ERR "copy_sc_to_user - save_fpx_registers "
"failed, errno = %d\n", err);
Expand All @@ -276,8 +275,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
else {
struct user_i387_struct fp;

err = save_fp_registers(userspace_pid[current_thread->cpu],
(unsigned long *) &fp);
err = save_fp_registers(pid, (unsigned long *) &fp);
if (copy_to_user(to_fp, &fp, sizeof(struct user_i387_struct)))
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/um/sys-x86_64/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
if (err)
return 1;

err = restore_fp_registers(userspace_pid[current_thread->cpu],
err = restore_fp_registers(userspace_pid[current_thread_info()->cpu],
(unsigned long *) &fp);
if (err < 0) {
printk(KERN_ERR "copy_sc_from_user - "
Expand Down Expand Up @@ -143,7 +143,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
if (err)
return 1;

err = save_fp_registers(userspace_pid[current_thread->cpu],
err = save_fp_registers(userspace_pid[current_thread_info()->cpu],
(unsigned long *) &fp);
if (err < 0) {
printk(KERN_ERR "copy_sc_from_user - restore_fp_registers "
Expand Down
23 changes: 2 additions & 21 deletions trunk/include/asm-um/current.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
/*
* Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
/*
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/

#ifndef __UM_CURRENT_H
#define __UM_CURRENT_H

#ifndef __ASSEMBLY__

#include "asm/page.h"
#include "linux/thread_info.h"

#define current (current_thread_info()->task)

/*Backward compatibility - it's used inside arch/um.*/
#define current_thread current_thread_info()

#endif /* __ASSEMBLY__ */

#endif

/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
8 changes: 4 additions & 4 deletions trunk/include/asm-um/thread_info.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
/*
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/

Expand Down Expand Up @@ -76,8 +76,8 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
#define TIF_SIGPENDING 1 /* signal pending */
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
* TIF_NEED_RESCHED
#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
* TIF_NEED_RESCHED
*/
#define TIF_RESTART_BLOCK 4
#define TIF_MEMDIE 5
Expand Down

0 comments on commit 9c5e707

Please sign in to comment.