aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon/xmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/xmon/xmon.c')
-rw-r--r--arch/powerpc/xmon/xmon.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 33794c1d92c3..42541bbcc7fa 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -334,7 +334,7 @@ static void release_output_lock(void)
334 334
335int cpus_are_in_xmon(void) 335int cpus_are_in_xmon(void)
336{ 336{
337 return !cpus_empty(cpus_in_xmon); 337 return !cpumask_empty(&cpus_in_xmon);
338} 338}
339#endif 339#endif
340 340
@@ -373,7 +373,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
373 373
374#ifdef CONFIG_SMP 374#ifdef CONFIG_SMP
375 cpu = smp_processor_id(); 375 cpu = smp_processor_id();
376 if (cpu_isset(cpu, cpus_in_xmon)) { 376 if (cpumask_test_cpu(cpu, &cpus_in_xmon)) {
377 get_output_lock(); 377 get_output_lock();
378 excprint(regs); 378 excprint(regs);
379 printf("cpu 0x%x: Exception %lx %s in xmon, " 379 printf("cpu 0x%x: Exception %lx %s in xmon, "
@@ -396,10 +396,10 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
396 } 396 }
397 397
398 xmon_fault_jmp[cpu] = recurse_jmp; 398 xmon_fault_jmp[cpu] = recurse_jmp;
399 cpu_set(cpu, cpus_in_xmon); 399 cpumask_set_cpu(cpu, &cpus_in_xmon);
400 400
401 bp = NULL; 401 bp = NULL;
402 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) 402 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT))
403 bp = at_breakpoint(regs->nip); 403 bp = at_breakpoint(regs->nip);
404 if (bp || unrecoverable_excp(regs)) 404 if (bp || unrecoverable_excp(regs))
405 fromipi = 0; 405 fromipi = 0;
@@ -437,10 +437,10 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
437 xmon_owner = cpu; 437 xmon_owner = cpu;
438 mb(); 438 mb();
439 if (ncpus > 1) { 439 if (ncpus > 1) {
440 smp_send_debugger_break(MSG_ALL_BUT_SELF); 440 smp_send_debugger_break();
441 /* wait for other cpus to come in */ 441 /* wait for other cpus to come in */
442 for (timeout = 100000000; timeout != 0; --timeout) { 442 for (timeout = 100000000; timeout != 0; --timeout) {
443 if (cpus_weight(cpus_in_xmon) >= ncpus) 443 if (cpumask_weight(&cpus_in_xmon) >= ncpus)
444 break; 444 break;
445 barrier(); 445 barrier();
446 } 446 }
@@ -484,7 +484,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
484 } 484 }
485 } 485 }
486 leave: 486 leave:
487 cpu_clear(cpu, cpus_in_xmon); 487 cpumask_clear_cpu(cpu, &cpus_in_xmon);
488 xmon_fault_jmp[cpu] = NULL; 488 xmon_fault_jmp[cpu] = NULL;
489#else 489#else
490 /* UP is simple... */ 490 /* UP is simple... */
@@ -529,7 +529,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
529 } 529 }
530 } 530 }
531#else 531#else
532 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) { 532 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) {
533 bp = at_breakpoint(regs->nip); 533 bp = at_breakpoint(regs->nip);
534 if (bp != NULL) { 534 if (bp != NULL) {
535 int stepped = emulate_step(regs, bp->instr[0]); 535 int stepped = emulate_step(regs, bp->instr[0]);
@@ -578,7 +578,7 @@ static int xmon_bpt(struct pt_regs *regs)
578 struct bpt *bp; 578 struct bpt *bp;
579 unsigned long offset; 579 unsigned long offset;
580 580
581 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) 581 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT))
582 return 0; 582 return 0;
583 583
584 /* Are we at the trap at bp->instr[1] for some bp? */ 584 /* Are we at the trap at bp->instr[1] for some bp? */
@@ -609,7 +609,7 @@ static int xmon_sstep(struct pt_regs *regs)
609 609
610static int xmon_dabr_match(struct pt_regs *regs) 610static int xmon_dabr_match(struct pt_regs *regs)
611{ 611{
612 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) 612 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT))
613 return 0; 613 return 0;
614 if (dabr.enabled == 0) 614 if (dabr.enabled == 0)
615 return 0; 615 return 0;
@@ -619,7 +619,7 @@ static int xmon_dabr_match(struct pt_regs *regs)
619 619
620static int xmon_iabr_match(struct pt_regs *regs) 620static int xmon_iabr_match(struct pt_regs *regs)
621{ 621{
622 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) 622 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT))
623 return 0; 623 return 0;
624 if (iabr == NULL) 624 if (iabr == NULL)
625 return 0; 625 return 0;
@@ -630,7 +630,7 @@ static int xmon_iabr_match(struct pt_regs *regs)
630static int xmon_ipi(struct pt_regs *regs) 630static int xmon_ipi(struct pt_regs *regs)
631{ 631{
632#ifdef CONFIG_SMP 632#ifdef CONFIG_SMP
633 if (in_xmon && !cpu_isset(smp_processor_id(), cpus_in_xmon)) 633 if (in_xmon && !cpumask_test_cpu(smp_processor_id(), &cpus_in_xmon))
634 xmon_core(regs, 1); 634 xmon_core(regs, 1);
635#endif 635#endif
636 return 0; 636 return 0;
@@ -644,7 +644,7 @@ static int xmon_fault_handler(struct pt_regs *regs)
644 if (in_xmon && catch_memory_errors) 644 if (in_xmon && catch_memory_errors)
645 handle_fault(regs); /* doesn't return */ 645 handle_fault(regs); /* doesn't return */
646 646
647 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) { 647 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) {
648 bp = in_breakpoint_table(regs->nip, &offset); 648 bp = in_breakpoint_table(regs->nip, &offset);
649 if (bp != NULL) { 649 if (bp != NULL) {
650 regs->nip = bp->address + offset; 650 regs->nip = bp->address + offset;
@@ -929,7 +929,7 @@ static int do_step(struct pt_regs *regs)
929 int stepped; 929 int stepped;
930 930
931 /* check we are in 64-bit kernel mode, translation enabled */ 931 /* check we are in 64-bit kernel mode, translation enabled */
932 if ((regs->msr & (MSR_SF|MSR_PR|MSR_IR)) == (MSR_SF|MSR_IR)) { 932 if ((regs->msr & (MSR_64BIT|MSR_PR|MSR_IR)) == (MSR_64BIT|MSR_IR)) {
933 if (mread(regs->nip, &instr, 4) == 4) { 933 if (mread(regs->nip, &instr, 4) == 4) {
934 stepped = emulate_step(regs, instr); 934 stepped = emulate_step(regs, instr);
935 if (stepped < 0) { 935 if (stepped < 0) {
@@ -976,7 +976,7 @@ static int cpu_cmd(void)
976 printf("cpus stopped:"); 976 printf("cpus stopped:");
977 count = 0; 977 count = 0;
978 for (cpu = 0; cpu < NR_CPUS; ++cpu) { 978 for (cpu = 0; cpu < NR_CPUS; ++cpu) {
979 if (cpu_isset(cpu, cpus_in_xmon)) { 979 if (cpumask_test_cpu(cpu, &cpus_in_xmon)) {
980 if (count == 0) 980 if (count == 0)
981 printf(" %x", cpu); 981 printf(" %x", cpu);
982 ++count; 982 ++count;
@@ -992,7 +992,7 @@ static int cpu_cmd(void)
992 return 0; 992 return 0;
993 } 993 }
994 /* try to switch to cpu specified */ 994 /* try to switch to cpu specified */
995 if (!cpu_isset(cpu, cpus_in_xmon)) { 995 if (!cpumask_test_cpu(cpu, &cpus_in_xmon)) {
996 printf("cpu 0x%x isn't in xmon\n", cpu); 996 printf("cpu 0x%x isn't in xmon\n", cpu);
997 return 0; 997 return 0;
998 } 998 }
@@ -1497,6 +1497,10 @@ static void prregs(struct pt_regs *fp)
1497#endif 1497#endif
1498 printf("pc = "); 1498 printf("pc = ");
1499 xmon_print_symbol(fp->nip, " ", "\n"); 1499 xmon_print_symbol(fp->nip, " ", "\n");
1500 if (TRAP(fp) != 0xc00 && cpu_has_feature(CPU_FTR_CFAR)) {
1501 printf("cfar= ");
1502 xmon_print_symbol(fp->orig_gpr3, " ", "\n");
1503 }
1500 printf("lr = "); 1504 printf("lr = ");
1501 xmon_print_symbol(fp->link, " ", "\n"); 1505 xmon_print_symbol(fp->link, " ", "\n");
1502 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr); 1506 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr);
@@ -2663,7 +2667,7 @@ static void dump_stab(void)
2663 2667
2664void dump_segments(void) 2668void dump_segments(void)
2665{ 2669{
2666 if (cpu_has_feature(CPU_FTR_SLB)) 2670 if (mmu_has_feature(MMU_FTR_SLB))
2667 dump_slb(); 2671 dump_slb();
2668 else 2672 else
2669 dump_stab(); 2673 dump_stab();