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.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/uaccess.hlinux/sched.hasm/hw_breakpoint.hasm/sstep.hasm/cache.h
Detected Declarations
function dar_in_user_rangefunction ea_user_range_overlapsfunction dar_in_hw_rangefunction ea_hw_range_overlapsfunction check_dawrx_constraintsfunction wp_check_constraintsfunction wp_get_instr_detail
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
- Immediate include surface: `linux/kernel.h`, `linux/uaccess.h`, `linux/sched.h`, `asm/hw_breakpoint.h`, `asm/sstep.h`, `asm/cache.h`.
- Detected declarations: `function dar_in_user_range`, `function ea_user_range_overlaps`, `function dar_in_hw_range`, `function ea_hw_range_overlaps`, `function check_dawrx_constraints`, `function wp_check_constraints`, `function wp_get_instr_detail`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.