arch/powerpc/kernel/hw_breakpoint_constraints.c

Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/hw_breakpoint_constraints.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/kernel/hw_breakpoint_constraints.c
Extension
.c
Size
4086 bytes
Lines
159
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

if (dawrx_constraints) {
			info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
			return true;
		}
	}
	return false;
}

void wp_get_instr_detail(struct pt_regs *regs, ppc_inst_t *instr,
			 int *type, int *size, unsigned long *ea)
{
	struct instruction_op op;
	int err;

	pagefault_disable();
	err = __get_user_instr(*instr, (void __user *)regs->nip);
	pagefault_enable();

	if (err)
		return;

	analyse_instr(&op, regs, *instr);
	*type = GETTYPE(op.type);
	*ea = op.ea;

	if (!(regs->msr & MSR_64BIT))
		*ea &= 0xffffffffUL;


	*size = GETSIZE(op.type);
	if (*type == CACHEOP) {
		*size = l1_dcache_bytes();
		*ea &= ~(*size - 1);
	} else if (*type == LOAD_VMX || *type == STORE_VMX) {
		*ea &= ~(*size - 1);
	}
}

Annotation

Implementation Notes