arch/loongarch/kernel/entry.S
Source file repositories/reference/linux-study-clean/arch/loongarch/kernel/entry.S
File Facts
- System
- Linux kernel
- Corpus path
arch/loongarch/kernel/entry.S- Extension
.S- Size
- 2106 bytes
- Lines
- 102
- Domain
- Architecture Layer
- Bucket
- arch/loongarch
- Inferred role
- Architecture Layer: arch/loongarch
- 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/asm.hasm/asmmacro.hasm/loongarch.hasm/regdef.hasm/stackframe.hasm/thread_info.hasm/unwind_hints.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#include <asm/asm.h>
#include <asm/asmmacro.h>
#include <asm/loongarch.h>
#include <asm/regdef.h>
#include <asm/stackframe.h>
#include <asm/thread_info.h>
#include <asm/unwind_hints.h>
.text
.cfi_sections .debug_frame
.align 5
SYM_CODE_START(handle_syscall)
UNWIND_HINT_UNDEFINED
csrrd t0, PERCPU_BASE_KS
la.pcrel t1, kernelsp
PTR_ADD t1, t1, t0
move t2, sp
PTR_L sp, t1, 0
PTR_ADDI sp, sp, -PT_SIZE
cfi_st t2, PT_R3
cfi_rel_offset sp, PT_R3
LONG_S zero, sp, PT_R0
csrrd t2, LOONGARCH_CSR_PRMD
LONG_S t2, sp, PT_PRMD
csrrd t2, LOONGARCH_CSR_CRMD
LONG_S t2, sp, PT_CRMD
csrrd t2, LOONGARCH_CSR_EUEN
LONG_S t2, sp, PT_EUEN
csrrd t2, LOONGARCH_CSR_ECFG
LONG_S t2, sp, PT_ECFG
csrrd t2, LOONGARCH_CSR_ESTAT
LONG_S t2, sp, PT_ESTAT
cfi_st ra, PT_R1
cfi_st a0, PT_R4
cfi_st a1, PT_R5
cfi_st a2, PT_R6
cfi_st a3, PT_R7
cfi_st a4, PT_R8
cfi_st a5, PT_R9
cfi_st a6, PT_R10
cfi_st a7, PT_R11
csrrd ra, LOONGARCH_CSR_ERA
LONG_S ra, sp, PT_ERA
cfi_rel_offset ra, PT_ERA
cfi_st tp, PT_R2
cfi_st u0, PT_R21
cfi_st fp, PT_R22
SAVE_STATIC
UNWIND_HINT_REGS
#ifdef CONFIG_KGDB
li.w t1, CSR_CRMD_WE
csrxchg t1, t1, LOONGARCH_CSR_CRMD
#endif
move u0, t0
LONG_LI tp, ~_THREAD_MASK
and tp, tp, sp
move a0, sp
bl do_syscall
STACKLEAK_ERASE
RESTORE_ALL_AND_RET
SYM_CODE_END(handle_syscall)
_ASM_NOKPROBE(handle_syscall)
Annotation
- Immediate include surface: `asm/asm.h`, `asm/asmmacro.h`, `asm/loongarch.h`, `asm/regdef.h`, `asm/stackframe.h`, `asm/thread_info.h`, `asm/unwind_hints.h`.
- Atlas domain: Architecture Layer / arch/loongarch.
- 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.