arch/riscv/lib/strrchr.S
Source file repositories/reference/linux-study-clean/arch/riscv/lib/strrchr.S
File Facts
- System
- Linux kernel
- Corpus path
arch/riscv/lib/strrchr.S- Extension
.S- Size
- 624 bytes
- Lines
- 38
- Domain
- Architecture Layer
- Bucket
- arch/riscv
- 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/linkage.hasm/asm.h
Detected Declarations
export strrchr
Annotated Snippet
#include <linux/linkage.h>
#include <asm/asm.h>
/* char *strrchr(const char *s, int c) */
SYM_FUNC_START(strrchr)
/*
* Parameters
* a0 - The string to be searched
* a1 - The character to seaerch for
*
* Returns
* a0 - Address of last occurrence of 'c' or 0
*
* Clobbers
* t0, t1
*/
andi a1, a1, 0xff
mv t1, a0
li a0, 0
1:
lbu t0, 0(t1)
bne t0, a1, 2f
mv a0, t1
2:
addi t1, t1, 1
bnez t0, 1b
ret
SYM_FUNC_END(strrchr)
SYM_FUNC_ALIAS_WEAK(__pi_strrchr, strrchr)
EXPORT_SYMBOL(strrchr)
Annotation
- Immediate include surface: `linux/linkage.h`, `asm/asm.h`.
- Detected declarations: `export strrchr`.
- Atlas domain: Architecture Layer / arch/riscv.
- 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.