arch/openrisc/kernel/module.c
Source file repositories/reference/linux-study-clean/arch/openrisc/kernel/module.c
File Facts
- System
- Linux kernel
- Corpus path
arch/openrisc/kernel/module.c- Extension
.c- Size
- 2173 bytes
- Lines
- 81
- Domain
- Architecture Layer
- Bucket
- arch/openrisc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/moduleloader.hlinux/elf.h
Detected Declarations
function Copyright
Annotated Snippet
switch (ELF32_R_TYPE(rel[i].r_info)) {
case R_OR1K_32:
*location = value;
break;
case R_OR1K_LO_16_IN_INSN:
*((uint16_t *)location + 1) = value;
break;
case R_OR1K_HI_16_IN_INSN:
*((uint16_t *)location + 1) = value >> 16;
break;
case R_OR1K_INSN_REL_26:
value -= (uint32_t)location;
value >>= 2;
value &= 0x03ffffff;
value |= *location & 0xfc000000;
*location = value;
break;
case R_OR1K_32_PCREL:
value -= (uint32_t)location;
*location = value;
break;
case R_OR1K_AHI16:
/* Adjust the operand to match with a signed LO16. */
value += 0x8000;
*((uint16_t *)location + 1) = value >> 16;
break;
case R_OR1K_SLO16:
/* Split value lower 16-bits. */
value = ((value & 0xf800) << 10) | (value & 0x7ff);
*location = (*location & ~0x3e007ff) | value;
break;
default:
pr_err("module %s: Unknown relocation: %u\n",
me->name, ELF32_R_TYPE(rel[i].r_info));
break;
}
}
return 0;
}
Annotation
- Immediate include surface: `linux/moduleloader.h`, `linux/elf.h`.
- Detected declarations: `function Copyright`.
- Atlas domain: Architecture Layer / arch/openrisc.
- Implementation status: source 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.