arch/mips/mm/tlbex.c
Source file repositories/reference/linux-study-clean/arch/mips/mm/tlbex.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/mm/tlbex.c- Extension
.c- Size
- 72074 bytes
- Lines
- 2586
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/bug.hlinux/export.hlinux/kernel.hlinux/types.hlinux/smp.hlinux/string.hlinux/cache.hlinux/pgtable.hasm/cacheflush.hasm/cpu-type.hasm/mipsregs.hasm/mmu_context.hasm/regdef.hasm/uasm.hasm/setup.hasm/tlbex.h
Detected Declarations
struct work_registersstruct tlb_reg_savestruct mips_huge_tlb_infoenum label_idenum vmalloc64_modefunction xpa_disablefunction r45k_bvahwbugfunction r4k_250MHZhwbugfunction bcm1250_m3_warfunction r10000_llsc_warfunction use_bbit_insnsfunction use_lwx_insnsfunction scratchpad_availablefunction scratchpad_offsetfunction scratchpad_availablefunction scratchpad_offsetfunction m4kc_tlbp_warfunction uasm_bgezl_hazardfunction uasm_bgezl_labelfunction output_pgtable_bits_definesfunction dump_handlerfunction c0_kscratchfunction allocate_kscratchfunction build_get_work_registersfunction build_restore_work_registersfunction build_r3000_tlb_refill_handlerfunction RM5230function build_tlb_write_entryfunction build_convert_pte_to_entrylofunction build_restore_pagemaskfunction build_huge_tlb_write_entryfunction build_is_huge_ptefunction build_huge_update_entriesfunction build_huge_handler_tailfunction build_get_pmde64function build_get_pgd_vmalloc64function build_get_pgde32function build_adjust_contextfunction build_get_ptepfunction build_update_entriesfunction build_fast_tlb_refill_handlerfunction build_r4000_tlb_refill_handlerfunction setup_pwfunction build_loongson3_tlb_refill_handlerfunction build_setup_pgdfunction iPTE_LWfunction iPTE_SWfunction build_pte_present
Annotated Snippet
struct work_registers {
int r1;
int r2;
int r3;
};
struct tlb_reg_save {
unsigned long a;
unsigned long b;
} ____cacheline_aligned_in_smp;
static struct tlb_reg_save handler_reg_save[NR_CPUS];
static inline int r45k_bvahwbug(void)
{
/* XXX: We should probe for the presence of this bug, but we don't. */
return 0;
}
static inline int r4k_250MHZhwbug(void)
{
/* XXX: We should probe for the presence of this bug, but we don't. */
return 0;
}
extern int sb1250_m3_workaround_needed(void);
static inline int __maybe_unused bcm1250_m3_war(void)
{
if (IS_ENABLED(CONFIG_SB1_PASS_2_WORKAROUNDS))
return sb1250_m3_workaround_needed();
return 0;
}
static inline int __maybe_unused r10000_llsc_war(void)
{
return IS_ENABLED(CONFIG_WAR_R10000_LLSC);
}
static int use_bbit_insns(void)
{
switch (current_cpu_type()) {
case CPU_CAVIUM_OCTEON:
case CPU_CAVIUM_OCTEON_PLUS:
case CPU_CAVIUM_OCTEON2:
case CPU_CAVIUM_OCTEON3:
return 1;
default:
return 0;
}
}
static int use_lwx_insns(void)
{
switch (current_cpu_type()) {
case CPU_CAVIUM_OCTEON2:
case CPU_CAVIUM_OCTEON3:
return 1;
default:
return 0;
}
}
#if defined(CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE) && \
CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
static bool scratchpad_available(void)
{
return true;
}
static int scratchpad_offset(int i)
{
/*
* CVMSEG starts at address -32768 and extends for
* CAVIUM_OCTEON_CVMSEG_SIZE 128 byte cache lines.
*/
i += 1; /* Kernel use starts at the top and works down. */
return CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE * 128 - (8 * i) - 32768;
}
#else
static bool scratchpad_available(void)
{
return false;
}
static int scratchpad_offset(int i)
{
BUG();
/* Really unreachable, but evidently some GCC want this. */
return 0;
}
#endif
/*
Annotation
- Immediate include surface: `linux/bug.h`, `linux/export.h`, `linux/kernel.h`, `linux/types.h`, `linux/smp.h`, `linux/string.h`, `linux/cache.h`, `linux/pgtable.h`.
- Detected declarations: `struct work_registers`, `struct tlb_reg_save`, `struct mips_huge_tlb_info`, `enum label_id`, `enum vmalloc64_mode`, `function xpa_disable`, `function r45k_bvahwbug`, `function r4k_250MHZhwbug`, `function bcm1250_m3_war`, `function r10000_llsc_war`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: integration 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.