~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to arch/powerpc/kernel/process.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <linux/init.h>
29
29
#include <linux/prctl.h>
30
30
#include <linux/init_task.h>
31
 
#include <linux/module.h>
 
31
#include <linux/export.h>
32
32
#include <linux/kallsyms.h>
33
33
#include <linux/mqueue.h>
34
34
#include <linux/hardirq.h>
96
96
                preempt_enable();
97
97
        }
98
98
}
 
99
EXPORT_SYMBOL_GPL(flush_fp_to_thread);
99
100
 
100
101
void enable_kernel_fp(void)
101
102
{
145
146
                preempt_enable();
146
147
        }
147
148
}
 
149
EXPORT_SYMBOL_GPL(flush_altivec_to_thread);
148
150
#endif /* CONFIG_ALTIVEC */
149
151
 
150
152
#ifdef CONFIG_VSX
186
188
                preempt_enable();
187
189
        }
188
190
}
 
191
EXPORT_SYMBOL_GPL(flush_vsx_to_thread);
189
192
#endif /* CONFIG_VSX */
190
193
 
191
194
#ifdef CONFIG_SPE
213
216
#ifdef CONFIG_SMP
214
217
                        BUG_ON(tsk != current);
215
218
#endif
 
219
                        tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
216
220
                        giveup_spe(tsk);
217
221
                }
218
222
                preempt_enable();
482
486
        new_thread = &new->thread;
483
487
        old_thread = &current->thread;
484
488
 
485
 
#if defined(CONFIG_PPC_BOOK3E_64)
486
 
        /* XXX Current Book3E code doesn't deal with kernel side DBCR0,
487
 
         * we always hold the user values, so we set it now.
488
 
         *
489
 
         * However, we ensure the kernel MSR:DE is appropriately cleared too
490
 
         * to avoid spurrious single step exceptions in the kernel.
491
 
         *
492
 
         * This will have to change to merge with the ppc32 code at some point,
493
 
         * but I don't like much what ppc32 is doing today so there's some
494
 
         * thinking needed there
495
 
         */
496
 
        if ((new_thread->dbcr0 | old_thread->dbcr0) & DBCR0_IDM) {
497
 
                u32 dbcr0;
498
 
 
499
 
                mtmsr(mfmsr() & ~MSR_DE);
500
 
                isync();
501
 
                dbcr0 = mfspr(SPRN_DBCR0);
502
 
                dbcr0 = (dbcr0 & DBCR0_EDM) | new_thread->dbcr0;
503
 
                mtspr(SPRN_DBCR0, dbcr0);
504
 
        }
505
 
#endif /* CONFIG_PPC64_BOOK3E */
506
 
 
507
489
#ifdef CONFIG_PPC64
508
490
        /*
509
491
         * Collect processor utilization data per process
650
632
        printbits(regs->msr, msr_bits);
651
633
        printk("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
652
634
        trap = TRAP(regs);
 
635
        if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
 
636
                printk("CFAR: "REG"\n", regs->orig_gpr3);
653
637
        if (trap == 0x300 || trap == 0x600)
654
 
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
 
638
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
655
639
                printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
656
640
#else
657
641
                printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr);
831
815
        unsigned long load_addr = regs->gpr[2]; /* saved by ELF_PLAT_INIT */
832
816
#endif
833
817
 
834
 
        set_fs(USER_DS);
835
 
 
836
818
        /*
837
819
         * If we exec out of a kernel thread then thread.regs will not be
838
820
         * set.  Do it now.