arch/x86/mm/pat/memtype.c
Source file repositories/reference/linux-study-clean/arch/x86/mm/pat/memtype.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/mm/pat/memtype.c- Extension
.c- Size
- 27817 bytes
- Lines
- 1050
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/seq_file.hlinux/memblock.hlinux/debugfs.hlinux/ioport.hlinux/kernel.hlinux/slab.hlinux/io.hlinux/mm.hlinux/highmem.hlinux/fs.hlinux/rbtree.hlinux/kvm_types.hasm/cpu_device_id.hasm/cacheflush.hasm/cacheinfo.hasm/processor.hasm/tlbflush.hasm/x86_init.hasm/fcntl.hasm/e820/api.hasm/mtrr.hasm/page.hasm/msr.hasm/memtype.hasm/io.hmemtype.h../mm_internal.h
Detected Declarations
struct pagerange_statefunction pat_disablefunction nopatfunction pat_enabledfunction pat_debug_setupfunction get_page_memtypefunction set_page_memtypefunction get_page_memtypefunction set_page_memtypefunction init_cache_modesfunction pat_cpu_initfunction pat_cpu_initfunction pat_x_mtrr_typefunction pagerange_is_ram_callbackfunction pat_pagerange_is_ramfunction reserve_ram_pages_typefunction free_ram_pages_typefunction sanitize_physfunction memtype_reservefunction memtype_freefunction lookup_memtypefunction pat_pfn_immune_to_uc_mtrrfunction memtype_reserve_iofunction memtype_free_iofunction arch_io_reserve_memtype_wcfunction arch_io_free_memtype_wcfunction phys_mem_access_protfunction pgprot_set_cachemodefunction phys_mem_access_prot_allowedfunction memtype_kernel_map_syncfunction mappingfunction reserve_pfn_rangefunction free_pfn_rangefunction pfnmap_setup_cachemodefunction pfnmap_trackfunction pfnmap_untrackfunction pgprot_writecombinefunction pgprot_writethroughfunction seq_startfunction memtype_seq_stopfunction memtype_seq_showfunction memtype_seq_openfunction pat_memtype_list_initexport pat_enabledexport arch_io_reserve_memtype_wcexport arch_io_free_memtype_wcexport pgprot_writecombineexport pgprot_writethrough
Annotated Snippet
static const struct file_operations memtype_fops = {
.open = memtype_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static int __init pat_memtype_list_init(void)
{
if (pat_enabled()) {
debugfs_create_file("pat_memtype_list", S_IRUSR,
arch_debugfs_dir, NULL, &memtype_fops);
}
return 0;
}
late_initcall(pat_memtype_list_init);
#endif /* CONFIG_DEBUG_FS && CONFIG_X86_PAT */
Annotation
- Immediate include surface: `linux/seq_file.h`, `linux/memblock.h`, `linux/debugfs.h`, `linux/ioport.h`, `linux/kernel.h`, `linux/slab.h`, `linux/io.h`, `linux/mm.h`.
- Detected declarations: `struct pagerange_state`, `function pat_disable`, `function nopat`, `function pat_enabled`, `function pat_debug_setup`, `function get_page_memtype`, `function set_page_memtype`, `function get_page_memtype`, `function set_page_memtype`, `function init_cache_modes`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.