Lines Matching refs:bp

108 #define BP_NUM(bp)	((bp) - bpts + 1)  argument
406 struct bpt *bp; in xmon_core() local
419 bp = in_breakpoint_table(regs->nip, &offset); in xmon_core()
420 if (bp != NULL) { in xmon_core()
421 regs->nip = bp->address + offset; in xmon_core()
422 atomic_dec(&bp->ref_count); in xmon_core()
453 bp = NULL; in xmon_core()
455 bp = at_breakpoint(regs->nip); in xmon_core()
456 if (bp || unrecoverable_excp(regs)) in xmon_core()
462 if (bp) { in xmon_core()
464 cpu, BP_NUM(bp)); in xmon_core()
505 if (bp || TRAP(regs) == 0xd00) in xmon_core()
555 bp = at_breakpoint(regs->nip); in xmon_core()
556 if (bp) { in xmon_core()
557 printf("Stopped at breakpoint %lx (", BP_NUM(bp)); in xmon_core()
566 if (bp || TRAP(regs) == 0xd00) in xmon_core()
579 bp = at_breakpoint(regs->nip); in xmon_core()
580 if (bp != NULL) { in xmon_core()
581 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
582 atomic_inc(&bp->ref_count); in xmon_core()
587 bp = at_breakpoint(regs->nip); in xmon_core()
588 if (bp != NULL) { in xmon_core()
589 int stepped = emulate_step(regs, bp->instr[0]); in xmon_core()
591 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
592 atomic_inc(&bp->ref_count); in xmon_core()
595 (IS_RFID(bp->instr[0])? "rfid": "mtmsrd")); in xmon_core()
633 struct bpt *bp; in xmon_bpt() local
640 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
641 if (bp != NULL && offset == 4) { in xmon_bpt()
642 regs->nip = bp->address + 4; in xmon_bpt()
643 atomic_dec(&bp->ref_count); in xmon_bpt()
648 bp = at_breakpoint(regs->nip); in xmon_bpt()
649 if (!bp) in xmon_bpt()
696 struct bpt *bp; in xmon_fault_handler() local
703 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
704 if (bp != NULL) { in xmon_fault_handler()
705 regs->nip = bp->address + offset; in xmon_fault_handler()
706 atomic_dec(&bp->ref_count); in xmon_fault_handler()
716 struct bpt *bp; in at_breakpoint() local
718 bp = bpts; in at_breakpoint()
719 for (i = 0; i < NBPTS; ++i, ++bp) in at_breakpoint()
720 if (bp->enabled && pc == bp->address) in at_breakpoint()
721 return bp; in at_breakpoint()
742 struct bpt *bp; in new_breakpoint() local
745 bp = at_breakpoint(a); in new_breakpoint()
746 if (bp) in new_breakpoint()
747 return bp; in new_breakpoint()
749 for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { in new_breakpoint()
750 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
751 bp->address = a; in new_breakpoint()
752 bp->instr[1] = bpinstr; in new_breakpoint()
753 store_inst(&bp->instr[1]); in new_breakpoint()
754 return bp; in new_breakpoint()
765 struct bpt *bp; in insert_bpts() local
767 bp = bpts; in insert_bpts()
768 for (i = 0; i < NBPTS; ++i, ++bp) { in insert_bpts()
769 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
771 if (mread(bp->address, &bp->instr[0], 4) != 4) { in insert_bpts()
773 "disabling breakpoint there\n", bp->address); in insert_bpts()
774 bp->enabled = 0; in insert_bpts()
777 if (IS_MTMSRD(bp->instr[0]) || IS_RFID(bp->instr[0])) { in insert_bpts()
779 "instruction, disabling it\n", bp->address); in insert_bpts()
780 bp->enabled = 0; in insert_bpts()
783 store_inst(&bp->instr[0]); in insert_bpts()
784 if (bp->enabled & BP_CIABR) in insert_bpts()
786 if (mwrite(bp->address, &bpinstr, 4) != 4) { in insert_bpts()
788 "disabling breakpoint there\n", bp->address); in insert_bpts()
789 bp->enabled &= ~BP_TRAP; in insert_bpts()
792 store_inst((void *)bp->address); in insert_bpts()
814 struct bpt *bp; in remove_bpts() local
817 bp = bpts; in remove_bpts()
818 for (i = 0; i < NBPTS; ++i, ++bp) { in remove_bpts()
819 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
821 if (mread(bp->address, &instr, 4) == 4 in remove_bpts()
823 && mwrite(bp->address, &bp->instr, 4) != 4) in remove_bpts()
825 bp->address); in remove_bpts()
827 store_inst((void *)bp->address); in remove_bpts()
1192 struct bpt *bp; in bpt_cmds() local
1234 bp = new_breakpoint(a); in bpt_cmds()
1235 if (bp != NULL) { in bpt_cmds()
1236 bp->enabled |= BP_CIABR; in bpt_cmds()
1237 iabr = bp; in bpt_cmds()
1255 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1258 bp = at_breakpoint(a); in bpt_cmds()
1259 if (bp == NULL) { in bpt_cmds()
1265 printf("Cleared breakpoint %lx (", BP_NUM(bp)); in bpt_cmds()
1266 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1267 bp->enabled = 0; in bpt_cmds()
1289 for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { in bpt_cmds()
1290 if (!bp->enabled) in bpt_cmds()
1292 printf("%2x %s ", BP_NUM(bp), in bpt_cmds()
1293 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1294 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1301 bp = new_breakpoint(a); in bpt_cmds()
1302 if (bp != NULL) in bpt_cmds()
1303 bp->enabled |= BP_TRAP; in bpt_cmds()