tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
Source file repositories/reference/linux-study-clean/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
File Facts
- System
- Linux kernel
- Corpus path
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c- Extension
.c- Size
- 35419 bytes
- Lines
- 1374
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpidump.h
Detected Declarations
function osl_get_last_statusfunction acpi_os_get_table_by_addressfunction acpi_os_get_table_by_namefunction osl_add_table_to_listfunction acpi_os_get_table_by_indexfunction osl_find_rsdp_via_efi_by_keywordfunction osl_find_rsdp_via_efifunction osl_load_rsdpfunction osl_can_use_xsdtfunction osl_table_initializefunction osl_list_bios_tablesfunction osl_get_bios_tablefunction osl_list_customized_tablesfunction osl_map_tablefunction osl_unmap_tablefunction osl_table_name_from_filefunction osl_read_table_from_filefunction osl_get_customized_table
Annotated Snippet
if (gbl_dump_dynamic_tables) {
/* Attempt to get a dynamic table */
status =
osl_get_customized_table(DYNAMIC_TABLE_DIR,
signature, instance, table,
address);
}
}
return (status);
}
/******************************************************************************
*
* FUNCTION: osl_add_table_to_list
*
* PARAMETERS: signature - Table signature
* instance - Table instance
*
* RETURN: Status; Successfully added if AE_OK.
* AE_NO_MEMORY: Memory allocation error
*
* DESCRIPTION: Insert a table structure into OSL table list.
*
*****************************************************************************/
static acpi_status osl_add_table_to_list(char *signature, u32 instance)
{
struct osl_table_info *new_info;
struct osl_table_info *next;
u32 next_instance = 0;
u8 found = FALSE;
new_info = calloc(1, sizeof(struct osl_table_info));
if (!new_info) {
return (AE_NO_MEMORY);
}
ACPI_COPY_NAMESEG(new_info->signature, signature);
if (!gbl_table_list_head) {
gbl_table_list_head = new_info;
} else {
next = gbl_table_list_head;
while (1) {
if (ACPI_COMPARE_NAMESEG(next->signature, signature)) {
if (next->instance == instance) {
found = TRUE;
}
if (next->instance >= next_instance) {
next_instance = next->instance + 1;
}
}
if (!next->next) {
break;
}
next = next->next;
}
next->next = new_info;
}
if (found) {
if (instance) {
fprintf(stderr,
"%4.4s: Warning unmatched table instance %d, expected %d\n",
signature, instance, next_instance);
}
instance = next_instance;
}
new_info->instance = instance;
gbl_table_count++;
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: acpi_os_get_table_by_index
*
* PARAMETERS: index - Which table to get
* table - Where a pointer to the table is returned
* instance - Where a pointer to the table instance no. is
* returned
* address - Where the table physical address is returned
*
* RETURN: Status; Table buffer and physical address returned if AE_OK.
Annotation
- Immediate include surface: `acpidump.h`.
- Detected declarations: `function osl_get_last_status`, `function acpi_os_get_table_by_address`, `function acpi_os_get_table_by_name`, `function osl_add_table_to_list`, `function acpi_os_get_table_by_index`, `function osl_find_rsdp_via_efi_by_keyword`, `function osl_find_rsdp_via_efi`, `function osl_load_rsdp`, `function osl_can_use_xsdt`, `function osl_table_initialize`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.