diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-26 14:04:15 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-26 14:06:24 -0500 |
commit | a7790532f5b7358c33a6b1834dc2b318de209f31 (patch) | |
tree | 0ceb9e24b3f54cb5c8453fb5a218e2a94a0f1cce /arch/x86/kernel/process_64.c | |
parent | 2764fb4244cc1bc08df3667924ca4a972e90ac70 (diff) | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
The SmartMedia FTL code depends on new kfifo bits from 2.6.33
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r-- | arch/x86/kernel/process_64.c | 65 |
1 files changed, 24 insertions, 41 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index e5ab0cd0ef36..126f0b493d04 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -57,8 +57,6 @@ asmlinkage extern void ret_from_fork(void); | |||
57 | DEFINE_PER_CPU(unsigned long, old_rsp); | 57 | DEFINE_PER_CPU(unsigned long, old_rsp); |
58 | static DEFINE_PER_CPU(unsigned char, is_idle); | 58 | static DEFINE_PER_CPU(unsigned char, is_idle); |
59 | 59 | ||
60 | unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; | ||
61 | |||
62 | static ATOMIC_NOTIFIER_HEAD(idle_notifier); | 60 | static ATOMIC_NOTIFIER_HEAD(idle_notifier); |
63 | 61 | ||
64 | void idle_notifier_register(struct notifier_block *n) | 62 | void idle_notifier_register(struct notifier_block *n) |
@@ -163,19 +161,19 @@ void __show_regs(struct pt_regs *regs, int all) | |||
163 | unsigned int ds, cs, es; | 161 | unsigned int ds, cs, es; |
164 | 162 | ||
165 | show_regs_common(); | 163 | show_regs_common(); |
166 | printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); | 164 | printk(KERN_DEFAULT "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); |
167 | printk_address(regs->ip, 1); | 165 | printk_address(regs->ip, 1); |
168 | printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, | 166 | printk(KERN_DEFAULT "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, |
169 | regs->sp, regs->flags); | 167 | regs->sp, regs->flags); |
170 | printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n", | 168 | printk(KERN_DEFAULT "RAX: %016lx RBX: %016lx RCX: %016lx\n", |
171 | regs->ax, regs->bx, regs->cx); | 169 | regs->ax, regs->bx, regs->cx); |
172 | printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n", | 170 | printk(KERN_DEFAULT "RDX: %016lx RSI: %016lx RDI: %016lx\n", |
173 | regs->dx, regs->si, regs->di); | 171 | regs->dx, regs->si, regs->di); |
174 | printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n", | 172 | printk(KERN_DEFAULT "RBP: %016lx R08: %016lx R09: %016lx\n", |
175 | regs->bp, regs->r8, regs->r9); | 173 | regs->bp, regs->r8, regs->r9); |
176 | printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n", | 174 | printk(KERN_DEFAULT "R10: %016lx R11: %016lx R12: %016lx\n", |
177 | regs->r10, regs->r11, regs->r12); | 175 | regs->r10, regs->r11, regs->r12); |
178 | printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n", | 176 | printk(KERN_DEFAULT "R13: %016lx R14: %016lx R15: %016lx\n", |
179 | regs->r13, regs->r14, regs->r15); | 177 | regs->r13, regs->r14, regs->r15); |
180 | 178 | ||
181 | asm("movl %%ds,%0" : "=r" (ds)); | 179 | asm("movl %%ds,%0" : "=r" (ds)); |
@@ -196,21 +194,21 @@ void __show_regs(struct pt_regs *regs, int all) | |||
196 | cr3 = read_cr3(); | 194 | cr3 = read_cr3(); |
197 | cr4 = read_cr4(); | 195 | cr4 = read_cr4(); |
198 | 196 | ||
199 | printk(KERN_INFO "FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", | 197 | printk(KERN_DEFAULT "FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", |
200 | fs, fsindex, gs, gsindex, shadowgs); | 198 | fs, fsindex, gs, gsindex, shadowgs); |
201 | printk(KERN_INFO "CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds, | 199 | printk(KERN_DEFAULT "CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds, |
202 | es, cr0); | 200 | es, cr0); |
203 | printk(KERN_INFO "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, | 201 | printk(KERN_DEFAULT "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, |
204 | cr4); | 202 | cr4); |
205 | 203 | ||
206 | get_debugreg(d0, 0); | 204 | get_debugreg(d0, 0); |
207 | get_debugreg(d1, 1); | 205 | get_debugreg(d1, 1); |
208 | get_debugreg(d2, 2); | 206 | get_debugreg(d2, 2); |
209 | printk(KERN_INFO "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); | 207 | printk(KERN_DEFAULT "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); |
210 | get_debugreg(d3, 3); | 208 | get_debugreg(d3, 3); |
211 | get_debugreg(d6, 6); | 209 | get_debugreg(d6, 6); |
212 | get_debugreg(d7, 7); | 210 | get_debugreg(d7, 7); |
213 | printk(KERN_INFO "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); | 211 | printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); |
214 | } | 212 | } |
215 | 213 | ||
216 | void show_regs(struct pt_regs *regs) | 214 | void show_regs(struct pt_regs *regs) |
@@ -273,8 +271,9 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
273 | *childregs = *regs; | 271 | *childregs = *regs; |
274 | 272 | ||
275 | childregs->ax = 0; | 273 | childregs->ax = 0; |
276 | childregs->sp = sp; | 274 | if (user_mode(regs)) |
277 | if (sp == ~0UL) | 275 | childregs->sp = sp; |
276 | else | ||
278 | childregs->sp = (unsigned long)childregs; | 277 | childregs->sp = (unsigned long)childregs; |
279 | 278 | ||
280 | p->thread.sp = (unsigned long) childregs; | 279 | p->thread.sp = (unsigned long) childregs; |
@@ -508,25 +507,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
508 | return prev_p; | 507 | return prev_p; |
509 | } | 508 | } |
510 | 509 | ||
511 | /* | ||
512 | * sys_execve() executes a new program. | ||
513 | */ | ||
514 | asmlinkage | ||
515 | long sys_execve(char __user *name, char __user * __user *argv, | ||
516 | char __user * __user *envp, struct pt_regs *regs) | ||
517 | { | ||
518 | long error; | ||
519 | char *filename; | ||
520 | |||
521 | filename = getname(name); | ||
522 | error = PTR_ERR(filename); | ||
523 | if (IS_ERR(filename)) | ||
524 | return error; | ||
525 | error = do_execve(filename, argv, envp, regs); | ||
526 | putname(filename); | ||
527 | return error; | ||
528 | } | ||
529 | |||
530 | void set_personality_64bit(void) | 510 | void set_personality_64bit(void) |
531 | { | 511 | { |
532 | /* inherit personality from parent */ | 512 | /* inherit personality from parent */ |
@@ -541,13 +521,16 @@ void set_personality_64bit(void) | |||
541 | current->personality &= ~READ_IMPLIES_EXEC; | 521 | current->personality &= ~READ_IMPLIES_EXEC; |
542 | } | 522 | } |
543 | 523 | ||
544 | asmlinkage long | 524 | void set_personality_ia32(void) |
545 | sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
546 | void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) | ||
547 | { | 525 | { |
548 | if (!newsp) | 526 | /* inherit personality from parent */ |
549 | newsp = regs->sp; | 527 | |
550 | return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); | 528 | /* Make sure to be in 32bit mode */ |
529 | set_thread_flag(TIF_IA32); | ||
530 | current->personality |= force_personality32; | ||
531 | |||
532 | /* Prepare the first "return" to user space */ | ||
533 | current_thread_info()->status |= TS_COMPAT; | ||
551 | } | 534 | } |
552 | 535 | ||
553 | unsigned long get_wchan(struct task_struct *p) | 536 | unsigned long get_wchan(struct task_struct *p) |