~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/sh/kernel/process_64.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <linux/fs.h>
22
22
#include <linux/ptrace.h>
23
23
#include <linux/reboot.h>
 
24
#include <linux/slab.h>
24
25
#include <linux/init.h>
25
26
#include <linux/module.h>
26
27
#include <linux/io.h>
32
33
 
33
34
struct task_struct *last_task_used_math = NULL;
34
35
 
35
 
void machine_restart(char * __unused)
36
 
{
37
 
        extern void phys_stext(void);
38
 
 
39
 
        phys_stext();
40
 
}
41
 
 
42
 
void machine_halt(void)
43
 
{
44
 
        for (;;);
45
 
}
46
 
 
47
 
void machine_power_off(void)
48
 
{
49
 
        __asm__ __volatile__ (
50
 
                "sleep\n\t"
51
 
                "synci\n\t"
52
 
                "nop;nop;nop;nop\n\t"
53
 
        );
54
 
 
55
 
        panic("Unexpected wakeup!\n");
56
 
}
57
 
 
58
 
void show_regs(struct pt_regs * regs)
 
36
void show_regs(struct pt_regs *regs)
59
37
{
60
38
        unsigned long long ah, al, bh, bl, ch, cl;
61
39
 
335
313
        return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
336
314
                      &regs, 0, NULL, NULL);
337
315
}
 
316
EXPORT_SYMBOL(kernel_thread);
338
317
 
339
318
/*
340
319
 * Free current thread data structures etc..
367
346
void flush_thread(void)
368
347
{
369
348
 
370
 
        /* Called by fs/exec.c (flush_old_exec) to remove traces of a
 
349
        /* Called by fs/exec.c (setup_new_exec) to remove traces of a
371
350
         * previously running executable. */
372
351
#ifdef CONFIG_SH_FPU
373
352
        if (last_task_used_math == current) {
403
382
        if (fpvalid) {
404
383
                if (current == last_task_used_math) {
405
384
                        enable_fpu();
406
 
                        save_fpu(tsk, regs);
 
385
                        save_fpu(tsk);
407
386
                        disable_fpu();
408
387
                        last_task_used_math = 0;
409
388
                        regs->sr |= SR_FD;
410
389
                }
411
390
 
412
 
                memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu));
 
391
                memcpy(fpu, &tsk->thread.xstate->hardfpu, sizeof(*fpu));
413
392
        }
414
393
 
415
394
        return fpvalid;
417
396
        return 0; /* Task didn't use the fpu at all. */
418
397
#endif
419
398
}
 
399
EXPORT_SYMBOL(dump_fpu);
420
400
 
421
401
asmlinkage void ret_from_fork(void);
422
402
 
429
409
#ifdef CONFIG_SH_FPU
430
410
        if(last_task_used_math == current) {
431
411
                enable_fpu();
432
 
                save_fpu(current, regs);
 
412
                save_fpu(current);
433
413
                disable_fpu();
434
414
                last_task_used_math = NULL;
435
415
                regs->sr |= SR_FD;
503
483
/*
504
484
 * sys_execve() executes a new program.
505
485
 */
506
 
asmlinkage int sys_execve(char *ufilename, char **uargv,
 
486
asmlinkage int sys_execve(const char *ufilename, char **uargv,
507
487
                          char **uenvp, unsigned long r5,
508
488
                          unsigned long r6, unsigned long r7,
509
489
                          struct pt_regs *pregs)
517
497
                goto out;
518
498
 
519
499
        error = do_execve(filename,
520
 
                          (char __user * __user *)uargv,
521
 
                          (char __user * __user *)uenvp,
 
500
                          (const char __user *const __user *)uargv,
 
501
                          (const char __user *const __user *)uenvp,
522
502
                          pregs);
523
503
        putname(filename);
524
504
out:
525
505
        return error;
526
506
}
527
507
 
528
 
/*
529
 
 * These bracket the sleeping functions..
530
 
 */
531
 
extern void interruptible_sleep_on(wait_queue_head_t *q);
532
 
 
533
 
#define mid_sched       ((unsigned long) interruptible_sleep_on)
534
 
 
535
508
#ifdef CONFIG_FRAME_POINTER
536
509
static int in_sh64_switch_to(unsigned long pc)
537
510
{