arch/parisc/kernel/module.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/module.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/module.c- Extension
.c- Size
- 26361 bytes
- Lines
- 962
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/moduleloader.hlinux/elf.hlinux/fs.hlinux/ftrace.hlinux/string.hlinux/kernel.hlinux/bug.hlinux/mm.hlinux/slab.hasm/unwind.hasm/sections.h
Detected Declarations
struct got_entrystruct stub_entrystruct got_entrystruct stub_entryenum elf_stub_typefunction sign_unextfunction low_sign_unextfunction reassemble_14function reassemble_16afunction reassemble_17function reassemble_21function reassemble_22function count_gotsfunction count_fdescsfunction count_stubsfunction count_gotsfunction count_fdescsfunction count_stubsfunction module_arch_freeing_initfunction arch_mod_section_prependfunction module_frob_arch_sectionsfunction get_gotfunction get_fdescfunction get_stubfunction bvefunction apply_relocate_addfunction apply_relocate_addfunction register_unwind_tablefunction deregister_unwind_tablefunction module_finalizefunction module_arch_cleanup
Annotated Snippet
struct got_entry {
Elf32_Addr addr;
};
struct stub_entry {
Elf32_Word insns[2]; /* each stub entry has two insns */
};
#else
struct got_entry {
Elf64_Addr addr;
};
struct stub_entry {
Elf64_Word insns[4]; /* each stub entry has four insns */
};
#endif
/* Field selection types defined by hppa */
#define rnd(x) (((x)+0x1000)&~0x1fff)
/* fsel: full 32 bits */
#define fsel(v,a) ((v)+(a))
/* lsel: select left 21 bits */
#define lsel(v,a) (((v)+(a))>>11)
/* rsel: select right 11 bits */
#define rsel(v,a) (((v)+(a))&0x7ff)
/* lrsel with rounding of addend to nearest 8k */
#define lrsel(v,a) (((v)+rnd(a))>>11)
/* rrsel with rounding of addend to nearest 8k */
#define rrsel(v,a) ((((v)+rnd(a))&0x7ff)+((a)-rnd(a)))
#define mask(x,sz) ((x) & ~((1<<(sz))-1))
/* The reassemble_* functions prepare an immediate value for
insertion into an opcode. pa-risc uses all sorts of weird bitfields
in the instruction to hold the value. */
static inline int sign_unext(int x, int len)
{
int len_ones;
len_ones = (1 << len) - 1;
return x & len_ones;
}
static inline int low_sign_unext(int x, int len)
{
int sign, temp;
sign = (x >> (len-1)) & 1;
temp = sign_unext(x, len-1);
return (temp << 1) | sign;
}
static inline int reassemble_14(int as14)
{
return (((as14 & 0x1fff) << 1) |
((as14 & 0x2000) >> 13));
}
static inline int reassemble_16a(int as16)
{
int s, t;
/* Unusual 16-bit encoding, for wide mode only. */
t = (as16 << 1) & 0xffff;
s = (as16 & 0x8000);
return (t ^ s ^ (s >> 1)) | (s >> 15);
}
static inline int reassemble_17(int as17)
{
return (((as17 & 0x10000) >> 16) |
((as17 & 0x0f800) << 5) |
((as17 & 0x00400) >> 8) |
((as17 & 0x003ff) << 3));
}
static inline int reassemble_21(int as21)
{
return (((as21 & 0x100000) >> 20) |
((as21 & 0x0ffe00) >> 8) |
((as21 & 0x000180) << 7) |
((as21 & 0x00007c) << 14) |
((as21 & 0x000003) << 12));
}
static inline int reassemble_22(int as22)
{
return (((as22 & 0x200000) >> 21) |
Annotation
- Immediate include surface: `linux/moduleloader.h`, `linux/elf.h`, `linux/fs.h`, `linux/ftrace.h`, `linux/string.h`, `linux/kernel.h`, `linux/bug.h`, `linux/mm.h`.
- Detected declarations: `struct got_entry`, `struct stub_entry`, `struct got_entry`, `struct stub_entry`, `enum elf_stub_type`, `function sign_unext`, `function low_sign_unext`, `function reassemble_14`, `function reassemble_16a`, `function reassemble_17`.
- Atlas domain: Architecture Layer / arch/parisc.
- 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.