arch/arm/include/asm/memory.h
Source file repositories/reference/linux-study-clean/arch/arm/include/asm/memory.h
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/include/asm/memory.h- Extension
.h- Size
- 10487 bytes
- Lines
- 391
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/const.hlinux/types.hlinux/sizes.hmach/memory.hasm/kasan_def.h
Detected Declarations
function __virt_to_phys_nodebugfunction __phys_to_virtfunction __virt_to_phys_nodebugfunction __phys_to_virtfunction virt_to_pfnfunction virt_to_physfunction arm_has_idmap_aliasfunction phys_to_idmapfunction idmap_to_physfunction __virt_to_idmap
Annotated Snippet
#ifndef __ASM_ARM_MEMORY_H
#define __ASM_ARM_MEMORY_H
#ifndef _ASMARM_PAGE_H
#error "Do not include <asm/memory.h> directly"
#endif
#include <linux/compiler.h>
#include <linux/const.h>
#include <linux/types.h>
#include <linux/sizes.h>
#ifdef CONFIG_NEED_MACH_MEMORY_H
#include <mach/memory.h>
#endif
#include <asm/kasan_def.h>
/*
* PAGE_OFFSET: the virtual address of the start of lowmem, memory above
* the virtual address range for userspace.
* KERNEL_OFFSET: the virtual address of the start of the kernel image.
* we may further offset this with TEXT_OFFSET in practice.
*/
#define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET)
#define KERNEL_OFFSET (PAGE_OFFSET)
#ifdef CONFIG_MMU
/*
* TASK_SIZE - the maximum size of a user space task.
* TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
*/
#ifndef CONFIG_KASAN
#define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M))
#else
#define TASK_SIZE (KASAN_SHADOW_START)
#endif
#define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M)
/*
* The maximum size of a 26-bit user space task.
*/
#define TASK_SIZE_26 (UL(1) << 26)
/*
* The module space lives between the addresses given by TASK_SIZE
* and PAGE_OFFSET - it must be within 32MB of the kernel text.
*/
#ifndef CONFIG_THUMB2_KERNEL
#define MODULES_VADDR (PAGE_OFFSET - SZ_16M)
#else
/* smaller range for Thumb-2 symbols relocation (2^24)*/
#define MODULES_VADDR (PAGE_OFFSET - SZ_8M)
#endif
#if TASK_SIZE > MODULES_VADDR
#error Top of user space clashes with start of module space
#endif
/*
* The highmem pkmap virtual space shares the end of the module area.
*/
#ifdef CONFIG_HIGHMEM
#define MODULES_END (PAGE_OFFSET - PMD_SIZE)
#else
#define MODULES_END (PAGE_OFFSET)
#endif
/*
* The XIP kernel gets mapped at the bottom of the module vm area.
* Since we use sections to map it, this macro replaces the physical address
* with its virtual address while keeping offset from the base section.
*/
#define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff))
#define FDT_FIXED_BASE UL(0xff800000)
#define FDT_FIXED_SIZE (2 * SECTION_SIZE)
#define FDT_VIRT_BASE(physbase) ((void *)(FDT_FIXED_BASE | (physbase) % SECTION_SIZE))
#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
/*
* Allow 16MB-aligned ioremap pages
*/
#define IOREMAP_MAX_ORDER 24
#endif
#define VECTORS_BASE UL(0xffff0000)
#else /* CONFIG_MMU */
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/const.h`, `linux/types.h`, `linux/sizes.h`, `mach/memory.h`, `asm/kasan_def.h`.
- Detected declarations: `function __virt_to_phys_nodebug`, `function __phys_to_virt`, `function __virt_to_phys_nodebug`, `function __phys_to_virt`, `function virt_to_pfn`, `function virt_to_phys`, `function arm_has_idmap_alias`, `function phys_to_idmap`, `function idmap_to_phys`, `function __virt_to_idmap`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source 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.