arch/x86/boot/compressed/acpi.c
Source file repositories/reference/linux-study-clean/arch/x86/boot/compressed/acpi.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/boot/compressed/acpi.c- Extension
.c- Size
- 7827 bytes
- Lines
- 318
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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
misc.herror.h../string.hefi.hasm/bootparam.hlinux/numa.h
Detected Declarations
function __efi_get_rsdp_addrfunction efi_get_rsdp_addrfunction compute_checksumfunction bios_get_rsdp_addrfunction paragraphsfunction get_rsdp_addrfunction get_cmdline_acpi_rsdpfunction get_acpi_srat_tablefunction count_immovable_mem_regions
Annotated Snippet
if (acpi_table) {
header = (struct acpi_table_header *)acpi_table;
if (ACPI_COMPARE_NAMESEG(header->signature, ACPI_SIG_SRAT))
return acpi_table;
}
entry += size;
}
return 0;
}
/**
* count_immovable_mem_regions - Parse SRAT and cache the immovable
* memory regions into the immovable_mem array.
*
* Return the number of immovable memory regions on success, 0 on failure:
*
* - Too many immovable memory regions
* - ACPI off or no SRAT found
* - No immovable memory region found.
*/
int count_immovable_mem_regions(void)
{
unsigned long table_addr, table_end, table;
struct acpi_subtable_header *sub_table;
struct acpi_table_header *table_header;
char arg[MAX_ACPI_ARG_LENGTH];
int num = 0;
if (cmdline_find_option("acpi", arg, sizeof(arg)) == 3 &&
!strncmp(arg, "off", 3))
return 0;
table_addr = get_acpi_srat_table();
if (!table_addr)
return 0;
table_header = (struct acpi_table_header *)table_addr;
table_end = table_addr + table_header->length;
table = table_addr + sizeof(struct acpi_table_srat);
while (table + sizeof(struct acpi_subtable_header) < table_end) {
sub_table = (struct acpi_subtable_header *)table;
if (!sub_table->length) {
debug_putstr("Invalid zero length SRAT subtable.\n");
return 0;
}
if (sub_table->type == ACPI_SRAT_TYPE_MEMORY_AFFINITY) {
struct acpi_srat_mem_affinity *ma;
ma = (struct acpi_srat_mem_affinity *)sub_table;
if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && ma->length) {
immovable_mem[num].start = ma->base_address;
immovable_mem[num].size = ma->length;
num++;
}
if (num >= MAX_NUMNODES*2) {
debug_putstr("Too many immovable memory regions, aborting.\n");
return 0;
}
}
table += sub_table->length;
}
return num;
}
#endif /* CONFIG_RANDOMIZE_BASE && CONFIG_MEMORY_HOTREMOVE */
Annotation
- Immediate include surface: `misc.h`, `error.h`, `../string.h`, `efi.h`, `asm/bootparam.h`, `linux/numa.h`.
- Detected declarations: `function __efi_get_rsdp_addr`, `function efi_get_rsdp_addr`, `function compute_checksum`, `function bios_get_rsdp_addr`, `function paragraphs`, `function get_rsdp_addr`, `function get_cmdline_acpi_rsdp`, `function get_acpi_srat_table`, `function count_immovable_mem_regions`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.