arch/arm64/kernel/return_address.c
Source file repositories/reference/linux-study-clean/arch/arm64/kernel/return_address.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kernel/return_address.c- Extension
.c- Size
- 948 bytes
- Lines
- 51
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/ftrace.hlinux/kprobes.hlinux/stacktrace.hasm/stack_pointer.h
Detected Declarations
struct return_address_datafunction save_return_addrexport return_address
Annotated Snippet
struct return_address_data {
unsigned int level;
void *addr;
};
static bool save_return_addr(void *d, unsigned long pc)
{
struct return_address_data *data = d;
if (!data->level) {
data->addr = (void *)pc;
return false;
} else {
--data->level;
return true;
}
}
NOKPROBE_SYMBOL(save_return_addr);
void *return_address(unsigned int level)
{
struct return_address_data data;
data.level = level + 2;
data.addr = NULL;
arch_stack_walk(save_return_addr, &data, current, NULL);
if (!data.level)
return data.addr;
else
return NULL;
}
EXPORT_SYMBOL_GPL(return_address);
NOKPROBE_SYMBOL(return_address);
Annotation
- Immediate include surface: `linux/export.h`, `linux/ftrace.h`, `linux/kprobes.h`, `linux/stacktrace.h`, `asm/stack_pointer.h`.
- Detected declarations: `struct return_address_data`, `function save_return_addr`, `export return_address`.
- Atlas domain: Architecture Layer / arch/arm64.
- 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.