arch/powerpc/include/asm/probes.h

Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/probes.h

File Facts

System
Linux kernel
Corpus path
arch/powerpc/include/asm/probes.h
Extension
.h
Size
2523 bytes
Lines
91
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (get_xop(inst)) {
		case OP_19_XOP_RFID:		return false;
		case OP_19_XOP_RFMCI:		return false;
		case OP_19_XOP_RFDI:		return false;
		case OP_19_XOP_RFI:		return false;
		case OP_19_XOP_RFCI:		return false;
		case OP_19_XOP_RFSCV:		return false;
		case OP_19_XOP_HRFID:		return false;
		case OP_19_XOP_URFID:		return false;
		case OP_19_XOP_STOP:		return false;
		case OP_19_XOP_DOZE:		return false;
		case OP_19_XOP_NAP:		return false;
		case OP_19_XOP_SLEEP:		return false;
		case OP_19_XOP_RVWINKLE:	return false;
		}
		break;
	case OP_31:
		switch (get_xop(inst)) {
		case OP_31_XOP_TRAP:		return false;
		case OP_31_XOP_TRAP_64:		return false;
		case OP_31_XOP_MTMSR:		return false;
		case OP_31_XOP_MTMSRD:		return false;
		}
		break;
	}
	return true;
}

/* Enable single stepping for the current task */
static inline void enable_single_step(struct pt_regs *regs)
{
	regs_set_return_msr(regs, regs->msr | MSR_SINGLESTEP);
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
	/*
	 * We turn off Critical Input Exception(CE) to ensure that the single
	 * step will be for the instruction we have the probe on; if we don't,
	 * it is possible we'd get the single step reported for CE.
	 */
	regs_set_return_msr(regs, regs->msr & ~MSR_CE);
	mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
#ifdef CONFIG_PPC_47x
	isync();
#endif
#endif
}


#endif /* __KERNEL__ */
#endif	/* _ASM_POWERPC_PROBES_H */

Annotation

Implementation Notes