arch/mips/mm/uasm.c
Source file repositories/reference/linux-study-clean/arch/mips/mm/uasm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/mm/uasm.c- Extension
.c- Size
- 14376 bytes
- Lines
- 645
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/octeon/octeon.h
Detected Declarations
struct insnenum fieldsenum opcodefunction build_rsfunction build_rtfunction build_rdfunction build_refunction build_simmfunction build_uimmfunction build_scimmfunction build_scimm9function build_funcfunction build_setfunction uasm_i_preffunction uasm_build_labelfunction uasm_in_compat_space_pfunction uasm_rel_highestfunction uasm_rel_higherfunction uasm_rel_hifunction uasm_rel_lofunction UASM_i_LA_mostlyfunction UASM_i_LAfunction uasm_r_mips_pc16function uasm_resolve_relocsfunction uasm_move_relocsfunction uasm_move_labelsfunction uasm_copy_handlerfunction uasm_insn_has_bdelayfunction uasm_il_bltzfunction uasm_il_bfunction uasm_il_beqfunction uasm_il_beqzfunction uasm_il_beqzlfunction uasm_il_bnefunction uasm_il_bnezfunction uasm_il_bgezlfunction uasm_il_bgezfunction uasm_il_bbit0function uasm_il_bbit1
Annotated Snippet
struct insn {
u32 match;
enum fields fields;
};
static inline u32 build_rs(u32 arg)
{
WARN(arg & ~RS_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return (arg & RS_MASK) << RS_SH;
}
static inline u32 build_rt(u32 arg)
{
WARN(arg & ~RT_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return (arg & RT_MASK) << RT_SH;
}
static inline u32 build_rd(u32 arg)
{
WARN(arg & ~RD_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return (arg & RD_MASK) << RD_SH;
}
static inline u32 build_re(u32 arg)
{
WARN(arg & ~RE_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return (arg & RE_MASK) << RE_SH;
}
static inline u32 build_simm(s32 arg)
{
WARN(arg > 0x7fff || arg < -0x8000,
KERN_WARNING "Micro-assembler field overflow\n");
return arg & 0xffff;
}
static inline u32 build_uimm(u32 arg)
{
WARN(arg & ~IMM_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return arg & IMM_MASK;
}
static inline u32 build_scimm(u32 arg)
{
WARN(arg & ~SCIMM_MASK,
KERN_WARNING "Micro-assembler field overflow\n");
return (arg & SCIMM_MASK) << SCIMM_SH;
}
static inline u32 build_scimm9(s32 arg)
{
WARN((arg > 0xff || arg < -0x100),
KERN_WARNING "Micro-assembler field overflow\n");
return (arg & SIMM9_MASK) << SIMM9_SH;
}
static inline u32 build_func(u32 arg)
{
WARN(arg & ~FUNC_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return arg & FUNC_MASK;
}
static inline u32 build_set(u32 arg)
{
WARN(arg & ~SET_MASK, KERN_WARNING "Micro-assembler field overflow\n");
return arg & SET_MASK;
}
static void build_insn(u32 **buf, enum opcode opc, ...);
#define I_u1u2u3(op) \
Ip_u1u2u3(op) \
{ \
build_insn(buf, insn##op, a, b, c); \
} \
UASM_EXPORT_SYMBOL(uasm_i##op);
#define I_s3s1s2(op) \
Ip_s3s1s2(op) \
{ \
Annotation
- Immediate include surface: `asm/octeon/octeon.h`.
- Detected declarations: `struct insn`, `enum fields`, `enum opcode`, `function build_rs`, `function build_rt`, `function build_rd`, `function build_re`, `function build_simm`, `function build_uimm`, `function build_scimm`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.