arch/powerpc/kernel/dawr.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/dawr.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/dawr.c- Extension
.c- Size
- 2678 bytes
- Lines
- 111
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/export.hlinux/fs.hlinux/debugfs.hasm/machdep.hasm/hvcall.hasm/firmware.h
Detected Declarations
function set_dawrfunction disable_dawrs_cbfunction dawr_write_file_boolfunction dawr_force_setupexport dawr_force_enable
Annotated Snippet
static const struct file_operations dawr_enable_fops = {
.read = debugfs_read_file_bool,
.write = dawr_write_file_bool,
.open = simple_open,
.llseek = default_llseek,
};
static int __init dawr_force_setup(void)
{
if (cpu_has_feature(CPU_FTR_DAWR)) {
/* Don't setup sysfs file for user control on P8 */
dawr_force_enable = true;
return 0;
}
if (PVR_VER(mfspr(SPRN_PVR)) == PVR_POWER9) {
/* Turn DAWR off by default, but allow admin to turn it on */
debugfs_create_file_unsafe("dawr_enable_dangerous", 0600,
arch_debugfs_dir,
&dawr_force_enable,
&dawr_enable_fops);
}
return 0;
}
arch_initcall(dawr_force_setup);
Annotation
- Immediate include surface: `linux/types.h`, `linux/export.h`, `linux/fs.h`, `linux/debugfs.h`, `asm/machdep.h`, `asm/hvcall.h`, `asm/firmware.h`.
- Detected declarations: `function set_dawr`, `function disable_dawrs_cb`, `function dawr_write_file_bool`, `function dawr_force_setup`, `export dawr_force_enable`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: pattern implementation candidate.
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.