arch/alpha/lib/callback_srm.S
Source file repositories/reference/linux-study-clean/arch/alpha/lib/callback_srm.S
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/lib/callback_srm.S- Extension
.S- Size
- 3001 bytes
- Lines
- 110
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- 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.
Dependency Surface
linux/export.hasm/console.h
Detected Declarations
export callback_getenvexport callback_setenvexport callback_save_env
Annotated Snippet
#include <linux/export.h>
#include <asm/console.h>
.text
#define HWRPB_CRB_OFFSET 0xc0
#if defined(CONFIG_ALPHA_SRM) || defined(CONFIG_ALPHA_GENERIC)
.align 4
srm_dispatch:
#if defined(CONFIG_ALPHA_GENERIC)
ldl $4,alpha_using_srm
beq $4,nosrm
#endif
ldq $0,hwrpb # gp is set up by CALLBACK macro.
ldl $25,0($25) # Pick up the wrapper data.
mov $20,$21 # Shift arguments right.
mov $19,$20
ldq $1,HWRPB_CRB_OFFSET($0)
mov $18,$19
mov $17,$18
mov $16,$17
addq $0,$1,$2 # CRB address
ldq $27,0($2) # DISPATCH procedure descriptor (VMS call std)
extwl $25,0,$16 # SRM callback function code
ldq $3,8($27) # call address
extwl $25,2,$25 # argument information (VMS calling std)
jmp ($3) # Return directly to caller of wrapper.
.align 4
.globl srm_fixup
.ent srm_fixup
srm_fixup:
ldgp $29,0($27)
#if defined(CONFIG_ALPHA_GENERIC)
ldl $4,alpha_using_srm
beq $4,nosrm
#endif
ldq $0,hwrpb
ldq $1,HWRPB_CRB_OFFSET($0)
addq $0,$1,$2 # CRB address
ldq $27,16($2) # VA of FIXUP procedure descriptor
ldq $3,8($27) # call address
lda $25,2($31) # two integer arguments
jmp ($3) # Return directly to caller of srm_fixup.
.end srm_fixup
#if defined(CONFIG_ALPHA_GENERIC)
.align 3
nosrm:
lda $0,-1($31)
ret
#endif
#define CALLBACK(NAME, CODE, ARG_CNT) \
.align 4; .globl callback_##NAME; .ent callback_##NAME; callback_##NAME##: \
ldgp $29,0($27); br $25,srm_dispatch; .word CODE, ARG_CNT; .end callback_##NAME
#else /* defined(CONFIG_ALPHA_SRM) || defined(CONFIG_ALPHA_GENERIC) */
#define CALLBACK(NAME, CODE, ARG_CNT) \
.align 3; .globl callback_##NAME; .ent callback_##NAME; callback_##NAME##: \
lda $0,-1($31); ret; .end callback_##NAME
.align 3
.globl srm_fixup
.ent srm_fixup
srm_fixup:
lda $0,-1($31)
ret
.end srm_fixup
Annotation
- Immediate include surface: `linux/export.h`, `asm/console.h`.
- Detected declarations: `export callback_getenv`, `export callback_setenv`, `export callback_save_env`.
- Atlas domain: Architecture Layer / arch/alpha.
- 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.