arch/parisc/kernel/cache.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/cache.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/cache.c- Extension
.c- Size
- 26672 bytes
- Lines
- 980
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- Inferred role
- Architecture Layer: syscall or user/kernel boundary
- Status
- core 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 or participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/init.hlinux/kernel.hlinux/mm.hlinux/module.hlinux/seq_file.hlinux/pagemap.hlinux/sched.hlinux/sched/mm.hlinux/syscalls.hlinux/vmalloc.hasm/pdc.hasm/cache.hasm/cacheflush.hasm/tlbflush.hasm/page.hasm/processor.hasm/sections.hasm/shmparam.hasm/mmu_context.hasm/cachectl.h
Detected Declarations
syscall cacheflushfunction cache_flush_local_cpufunction flush_cache_all_localfunction flush_cache_allfunction flush_data_cachefunction __update_cachefunction test_bitfunction show_cache_infofunction parisc_cache_initfunction disable_sr_hashingfunction __flush_cache_pagefunction flush_kernel_dcache_page_addrfunction flush_kernel_icache_page_addrfunction kunmap_flush_on_unmapfunction flush_icache_pagesfunction pte_needs_cache_flushfunction get_upafunction flush_dcache_foliofunction parisc_setup_cache_timingfunction flush_cache_page_if_presentfunction copy_user_highpagefunction copy_to_user_pagefunction copy_from_user_pagefunction __flush_tlb_rangefunction flush_cache_pagesfunction mm_total_sizefunction for_each_vmafunction flush_cache_mmfunction flush_cache_rangefunction flush_cache_pagefunction flush_anon_pagefunction ptep_clear_flush_youngfunction ptep_clear_flushfunction flush_cache_vmapfunction flush_cache_vunmapfunction flush_kernel_vmap_rangefunction invalidate_kernel_vmap_rangefunction SYSCALL_DEFINE3export dcache_strideexport flush_dcache_page_asmexport kunmap_flush_on_unmapexport flush_dcache_folioexport flush_kernel_dcache_range_asmexport flush_kernel_icache_range_asmexport flush_cache_vmapexport flush_cache_vunmapexport flush_kernel_vmap_rangeexport invalidate_kernel_vmap_range
Annotated Snippet
SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes,
unsigned int, cache)
{
unsigned long start, end;
ASM_EXCEPTIONTABLE_VAR(error);
if (bytes == 0)
return 0;
if (!access_ok((void __user *) addr, bytes))
return -EFAULT;
end = addr + bytes;
if (cache & DCACHE) {
start = addr;
__asm__ __volatile__ (
#ifdef CONFIG_64BIT
"1: cmpb,*<<,n %0,%2,1b\n"
#else
"1: cmpb,<<,n %0,%2,1b\n"
#endif
" fdc,m %3(%4,%0)\n"
"2: sync\n"
ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1")
: "+r" (start), "+r" (error)
: "r" (end), "r" (dcache_stride), "i" (SR_USER));
}
if (cache & ICACHE && error == 0) {
start = addr;
__asm__ __volatile__ (
#ifdef CONFIG_64BIT
"1: cmpb,*<<,n %0,%2,1b\n"
#else
"1: cmpb,<<,n %0,%2,1b\n"
#endif
" fic,m %3(%4,%0)\n"
"2: sync\n"
ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1")
: "+r" (start), "+r" (error)
: "r" (end), "r" (icache_stride), "i" (SR_USER));
}
return error;
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel.h`, `linux/mm.h`, `linux/module.h`, `linux/seq_file.h`, `linux/pagemap.h`, `linux/sched.h`, `linux/sched/mm.h`.
- Detected declarations: `syscall cacheflush`, `function cache_flush_local_cpu`, `function flush_cache_all_local`, `function flush_cache_all`, `function flush_data_cache`, `function __update_cache`, `function test_bit`, `function show_cache_info`, `function parisc_cache_init`, `function disable_sr_hashing`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: core 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.