arch/x86/lib/atomic64_386_32.S
Source file repositories/reference/linux-study-clean/arch/x86/lib/atomic64_386_32.S
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/lib/atomic64_386_32.S- Extension
.S- Size
- 2668 bytes
- Lines
- 196
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: arch/x86
- 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
linux/linkage.hasm/alternative.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#include <linux/linkage.h>
#include <asm/alternative.h>
/* if you want SMP support, implement these with real spinlocks */
.macro IRQ_SAVE reg
pushfl
cli
.endm
.macro IRQ_RESTORE reg
popfl
.endm
#define BEGIN_IRQ_SAVE(op) \
.macro endp; \
SYM_FUNC_END(atomic64_##op##_386); \
.purgem endp; \
.endm; \
SYM_FUNC_START(atomic64_##op##_386); \
IRQ_SAVE v;
#define ENDP endp
#define RET_IRQ_RESTORE \
IRQ_RESTORE v; \
RET
#define v %ecx
BEGIN_IRQ_SAVE(read)
movl (v), %eax
movl 4(v), %edx
RET_IRQ_RESTORE
ENDP
#undef v
#define v %esi
BEGIN_IRQ_SAVE(set)
movl %ebx, (v)
movl %ecx, 4(v)
RET_IRQ_RESTORE
ENDP
#undef v
#define v %esi
BEGIN_IRQ_SAVE(xchg)
movl (v), %eax
movl 4(v), %edx
movl %ebx, (v)
movl %ecx, 4(v)
RET_IRQ_RESTORE
ENDP
#undef v
#define v %ecx
BEGIN_IRQ_SAVE(add)
addl %eax, (v)
adcl %edx, 4(v)
RET_IRQ_RESTORE
ENDP
#undef v
#define v %ecx
BEGIN_IRQ_SAVE(add_return)
addl (v), %eax
adcl 4(v), %edx
movl %eax, (v)
movl %edx, 4(v)
RET_IRQ_RESTORE
ENDP
#undef v
Annotation
- Immediate include surface: `linux/linkage.h`, `asm/alternative.h`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.