arch/powerpc/kernel/ppc_save_regs.S
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/ppc_save_regs.S
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/ppc_save_regs.S- Extension
.S- Size
- 1316 bytes
- Lines
- 54
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: arch/powerpc
- Status
- atlas-only
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.
Dependency Surface
asm/processor.hasm/ppc_asm.hasm/asm-offsets.hasm/ptrace.hasm/asm-compat.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#include <asm/processor.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
#include <asm/asm-compat.h>
/*
* Grab the register values as they are now.
* This won't do a particularly good job because we really
* want our caller's caller's registers, and our caller has
* already executed its prologue.
* ToDo: We could reach back into the caller's save area to do
* a better job of representing the caller's state (note that
* that will be different for 32-bit and 64-bit, because of the
* different ABIs, though).
*/
_GLOBAL(ppc_save_regs)
/* This allows stack frame accessor macros and offsets to be used */
subi r3,r3,STACK_INT_FRAME_REGS
PPC_STL r0,GPR0(r3)
#ifdef CONFIG_PPC32
stmw r2,GPR2(r3)
#else
SAVE_GPRS(2, 31, r3)
lbz r0,PACAIRQSOFTMASK(r13)
PPC_STL r0,SOFTE(r3)
#endif
/* store current SP */
PPC_STL r1,GPR1(r3)
/* get caller's LR */
PPC_LL r4,0(r1)
PPC_LL r0,LRSAVE(r4)
PPC_STL r0,_LINK(r3)
mflr r0
PPC_STL r0,_NIP(r3)
mfmsr r0
PPC_STL r0,_MSR(r3)
mfctr r0
PPC_STL r0,_CTR(r3)
mfxer r0
PPC_STL r0,_XER(r3)
mfcr r0
PPC_STL r0,_CCR(r3)
li r0,0
PPC_STL r0,_TRAP(r3)
PPC_STL r0,ORIG_GPR3(r3)
blr
Annotation
- Immediate include surface: `asm/processor.h`, `asm/ppc_asm.h`, `asm/asm-offsets.h`, `asm/ptrace.h`, `asm/asm-compat.h`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: atlas-only.
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.