process.c (56012808f4d5606e401539f663d92009d964425b) process.c (172ae2e7f8ff9053905a36672453a6d2ff95b182)
1/*
2 * Derived from "arch/i386/kernel/process.c"
3 * Copyright (C) 1995 Linus Torvalds
4 *
5 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and
6 * Paul Mackerras (paulus@cs.anu.edu.au)
7 *
8 * PowerPC version

--- 244 unchanged lines hidden (view full) ---

253 if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
254 11, SIGSEGV) == NOTIFY_STOP)
255 return;
256
257 if (debugger_dabr_match(regs))
258 return;
259
260 /* Clear the DAC and struct entries. One shot trigger */
1/*
2 * Derived from "arch/i386/kernel/process.c"
3 * Copyright (C) 1995 Linus Torvalds
4 *
5 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and
6 * Paul Mackerras (paulus@cs.anu.edu.au)
7 *
8 * PowerPC version

--- 244 unchanged lines hidden (view full) ---

253 if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
254 11, SIGSEGV) == NOTIFY_STOP)
255 return;
256
257 if (debugger_dabr_match(regs))
258 return;
259
260 /* Clear the DAC and struct entries. One shot trigger */
261#if defined(CONFIG_BOOKE)
261#ifdef CONFIG_PPC_ADV_DEBUG_REGS
262 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~(DBSR_DAC1R | DBSR_DAC1W
263 | DBCR0_IDM));
264#endif
265
266 /* Clear the DABR */
267 set_dabr(0);
268
269 /* Deliver the signal to userspace */

--- 9 unchanged lines hidden (view full) ---

279int set_dabr(unsigned long dabr)
280{
281 __get_cpu_var(current_dabr) = dabr;
282
283 if (ppc_md.set_dabr)
284 return ppc_md.set_dabr(dabr);
285
286 /* XXX should we have a CPU_FTR_HAS_DABR ? */
262 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~(DBSR_DAC1R | DBSR_DAC1W
263 | DBCR0_IDM));
264#endif
265
266 /* Clear the DABR */
267 set_dabr(0);
268
269 /* Deliver the signal to userspace */

--- 9 unchanged lines hidden (view full) ---

279int set_dabr(unsigned long dabr)
280{
281 __get_cpu_var(current_dabr) = dabr;
282
283 if (ppc_md.set_dabr)
284 return ppc_md.set_dabr(dabr);
285
286 /* XXX should we have a CPU_FTR_HAS_DABR ? */
287#if defined(CONFIG_BOOKE)
287#ifdef CONFIG_PPC_ADV_DEBUG_REGS
288 mtspr(SPRN_DAC1, dabr);
289#elif defined(CONFIG_PPC_BOOK3S)
290 mtspr(SPRN_DABR, dabr);
291#endif
292
293
294 return 0;
295}

--- 70 unchanged lines hidden (view full) ---

366 * we don't set last_task_used_spe
367 */
368 if (new->thread.regs && last_task_used_spe == new)
369 new->thread.regs->msr |= MSR_SPE;
370#endif /* CONFIG_SPE */
371
372#endif /* CONFIG_SMP */
373
288 mtspr(SPRN_DAC1, dabr);
289#elif defined(CONFIG_PPC_BOOK3S)
290 mtspr(SPRN_DABR, dabr);
291#endif
292
293
294 return 0;
295}

--- 70 unchanged lines hidden (view full) ---

366 * we don't set last_task_used_spe
367 */
368 if (new->thread.regs && last_task_used_spe == new)
369 new->thread.regs->msr |= MSR_SPE;
370#endif /* CONFIG_SPE */
371
372#endif /* CONFIG_SMP */
373
374#if defined(CONFIG_BOOKE)
374#ifdef CONFIG_PPC_ADV_DEBUG_REGS
375 /* If new thread DAC (HW breakpoint) is the same then leave it */
376 if (new->thread.dabr)
377 set_dabr(new->thread.dabr);
378#else
379 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
380 set_dabr(new->thread.dabr);
381#endif
382

--- 126 unchanged lines hidden (view full) ---

509 regs->nip, regs->link, regs->ctr);
510 printk("REGS: %p TRAP: %04lx %s (%s)\n",
511 regs, regs->trap, print_tainted(), init_utsname()->release);
512 printk("MSR: "REG" ", regs->msr);
513 printbits(regs->msr, msr_bits);
514 printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
515 trap = TRAP(regs);
516 if (trap == 0x300 || trap == 0x600)
375 /* If new thread DAC (HW breakpoint) is the same then leave it */
376 if (new->thread.dabr)
377 set_dabr(new->thread.dabr);
378#else
379 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
380 set_dabr(new->thread.dabr);
381#endif
382

--- 126 unchanged lines hidden (view full) ---

509 regs->nip, regs->link, regs->ctr);
510 printk("REGS: %p TRAP: %04lx %s (%s)\n",
511 regs, regs->trap, print_tainted(), init_utsname()->release);
512 printk("MSR: "REG" ", regs->msr);
513 printbits(regs->msr, msr_bits);
514 printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
515 trap = TRAP(regs);
516 if (trap == 0x300 || trap == 0x600)
517#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
517#ifdef CONFIG_PPC_ADV_DEBUG_REGS
518 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
519#else
520 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
521#endif
522 printk("TASK = %p[%d] '%s' THREAD: %p",
523 current, task_pid_nr(current), current->comm, task_thread_info(current));
524
525#ifdef CONFIG_SMP

--- 29 unchanged lines hidden (view full) ---

555void flush_thread(void)
556{
557 discard_lazy_cpu_state();
558
559 if (current->thread.dabr) {
560 current->thread.dabr = 0;
561 set_dabr(0);
562
518 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
519#else
520 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
521#endif
522 printk("TASK = %p[%d] '%s' THREAD: %p",
523 current, task_pid_nr(current), current->comm, task_thread_info(current));
524
525#ifdef CONFIG_SMP

--- 29 unchanged lines hidden (view full) ---

555void flush_thread(void)
556{
557 discard_lazy_cpu_state();
558
559 if (current->thread.dabr) {
560 current->thread.dabr = 0;
561 set_dabr(0);
562
563#if defined(CONFIG_BOOKE)
563#ifdef CONFIG_PPC_ADV_DEBUG_REGS
564 current->thread.dbcr0 &= ~(DBSR_DAC1R | DBSR_DAC1W);
565#endif
566 }
567}
568
569void
570release_thread(struct task_struct *t)
571{

--- 620 unchanged lines hidden ---
564 current->thread.dbcr0 &= ~(DBSR_DAC1R | DBSR_DAC1W);
565#endif
566 }
567}
568
569void
570release_thread(struct task_struct *t)
571{

--- 620 unchanged lines hidden ---