Lines Matching refs:bp

108 #define BP_NUM(bp)	((bp) - bpts + 1)  argument
405 struct bpt *bp; in xmon_core() local
418 bp = in_breakpoint_table(regs->nip, &offset); in xmon_core()
419 if (bp != NULL) { in xmon_core()
420 regs->nip = bp->address + offset; in xmon_core()
421 atomic_dec(&bp->ref_count); in xmon_core()
452 bp = NULL; in xmon_core()
454 bp = at_breakpoint(regs->nip); in xmon_core()
455 if (bp || unrecoverable_excp(regs)) in xmon_core()
461 if (bp) { in xmon_core()
463 cpu, BP_NUM(bp)); in xmon_core()
504 if (bp || TRAP(regs) == 0xd00) in xmon_core()
554 bp = at_breakpoint(regs->nip); in xmon_core()
555 if (bp) { in xmon_core()
556 printf("Stopped at breakpoint %lx (", BP_NUM(bp)); in xmon_core()
565 if (bp || TRAP(regs) == 0xd00) in xmon_core()
578 bp = at_breakpoint(regs->nip); in xmon_core()
579 if (bp != NULL) { in xmon_core()
580 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
581 atomic_inc(&bp->ref_count); in xmon_core()
586 bp = at_breakpoint(regs->nip); in xmon_core()
587 if (bp != NULL) { in xmon_core()
588 int stepped = emulate_step(regs, bp->instr[0]); in xmon_core()
590 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
591 atomic_inc(&bp->ref_count); in xmon_core()
594 (IS_RFID(bp->instr[0])? "rfid": "mtmsrd")); in xmon_core()
632 struct bpt *bp; in xmon_bpt() local
639 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
640 if (bp != NULL && offset == 4) { in xmon_bpt()
641 regs->nip = bp->address + 4; in xmon_bpt()
642 atomic_dec(&bp->ref_count); in xmon_bpt()
647 bp = at_breakpoint(regs->nip); in xmon_bpt()
648 if (!bp) in xmon_bpt()
695 struct bpt *bp; in xmon_fault_handler() local
702 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
703 if (bp != NULL) { in xmon_fault_handler()
704 regs->nip = bp->address + offset; in xmon_fault_handler()
705 atomic_dec(&bp->ref_count); in xmon_fault_handler()
715 struct bpt *bp; in at_breakpoint() local
717 bp = bpts; in at_breakpoint()
718 for (i = 0; i < NBPTS; ++i, ++bp) in at_breakpoint()
719 if (bp->enabled && pc == bp->address) in at_breakpoint()
720 return bp; in at_breakpoint()
741 struct bpt *bp; in new_breakpoint() local
744 bp = at_breakpoint(a); in new_breakpoint()
745 if (bp) in new_breakpoint()
746 return bp; in new_breakpoint()
748 for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { in new_breakpoint()
749 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
750 bp->address = a; in new_breakpoint()
751 bp->instr[1] = bpinstr; in new_breakpoint()
752 store_inst(&bp->instr[1]); in new_breakpoint()
753 return bp; in new_breakpoint()
764 struct bpt *bp; in insert_bpts() local
766 bp = bpts; in insert_bpts()
767 for (i = 0; i < NBPTS; ++i, ++bp) { in insert_bpts()
768 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
770 if (mread(bp->address, &bp->instr[0], 4) != 4) { in insert_bpts()
772 "disabling breakpoint there\n", bp->address); in insert_bpts()
773 bp->enabled = 0; in insert_bpts()
776 if (IS_MTMSRD(bp->instr[0]) || IS_RFID(bp->instr[0])) { in insert_bpts()
778 "instruction, disabling it\n", bp->address); in insert_bpts()
779 bp->enabled = 0; in insert_bpts()
782 store_inst(&bp->instr[0]); in insert_bpts()
783 if (bp->enabled & BP_CIABR) in insert_bpts()
785 if (mwrite(bp->address, &bpinstr, 4) != 4) { in insert_bpts()
787 "disabling breakpoint there\n", bp->address); in insert_bpts()
788 bp->enabled &= ~BP_TRAP; in insert_bpts()
791 store_inst((void *)bp->address); in insert_bpts()
813 struct bpt *bp; in remove_bpts() local
816 bp = bpts; in remove_bpts()
817 for (i = 0; i < NBPTS; ++i, ++bp) { in remove_bpts()
818 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
820 if (mread(bp->address, &instr, 4) == 4 in remove_bpts()
822 && mwrite(bp->address, &bp->instr, 4) != 4) in remove_bpts()
824 bp->address); in remove_bpts()
826 store_inst((void *)bp->address); in remove_bpts()
1178 struct bpt *bp; in bpt_cmds() local
1220 bp = new_breakpoint(a); in bpt_cmds()
1221 if (bp != NULL) { in bpt_cmds()
1222 bp->enabled |= BP_CIABR; in bpt_cmds()
1223 iabr = bp; in bpt_cmds()
1241 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1244 bp = at_breakpoint(a); in bpt_cmds()
1245 if (bp == NULL) { in bpt_cmds()
1251 printf("Cleared breakpoint %lx (", BP_NUM(bp)); in bpt_cmds()
1252 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1253 bp->enabled = 0; in bpt_cmds()
1275 for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { in bpt_cmds()
1276 if (!bp->enabled) in bpt_cmds()
1278 printf("%2x %s ", BP_NUM(bp), in bpt_cmds()
1279 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1280 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1287 bp = new_breakpoint(a); in bpt_cmds()
1288 if (bp != NULL) in bpt_cmds()
1289 bp->enabled |= BP_TRAP; in bpt_cmds()