/* Check if this is a suitable place to put a breakpoint.  */
static long check_bp_loc(unsigned long addr)
/* Check if this is a suitable place to put a breakpoint.  */
static long check_bp_loc(unsigned long addr)
{
	unsigned int instr;
	addr &= ~3;
	if (!is_kernel_addr(addr)) {
		printf("Breakpoints may only be placed at kernel addresses\n");
		return 0;
	}
	if (!mread(addr, &instr, sizeof(instr))) {
		printf("Can't read instruction at address %lx\n", addr);
		return 0;
	}
	if (IS_MTMSRD(instr) || IS_RFID(instr)) {
		printf("Breakpoints may not be placed on mtmsrd or rfid "
		       "instructions\n");
		return 0;
	}
	return 1;
}