acpi_status __init acpi_initialize_tables(struct acpi_table_desc * initial_table_array, u32 initial_table_count, u8 allow_resize) { acpi_physical_address rsdp_address; acpi_status status; ACPI_FUNCTION_TRACE(acpi_initialize_tables); /* * Set up the Root Table Array * Allocate the table array if requested */ if (!initial_table_array) { /* * ACPI code allows for much flexibility. Kitten doesn't need it * that desperately. */ ACPI_ERROR((AE_INFO, "Don't give me a NULL table for storing headers.\n")); return_ACPI_STATUS(AE_BAD_PARAMETER); } else { /* Root Table Array has been statically allocated by the host */ ACPI_MEMSET(initial_table_array, 0, (acpi_size) initial_table_count * sizeof(struct acpi_table_desc)); acpi_gbl_root_table_list.tables = initial_table_array; acpi_gbl_root_table_list.max_table_count = initial_table_count; acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN; if (allow_resize) { acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; } } /* Get the address of the RSDP */ rsdp_address = acpi_os_get_root_pointer(); if (!rsdp_address) { ACPI_ERROR((AE_INFO, "Could not find RSDP\n")); return_ACPI_STATUS(AE_NOT_FOUND); } /* * Get the root table (RSDT or XSDT) and extract all entries to the local * Root Table Array. This array contains the information of the RSDT/XSDT * in a common, more useable format. */ status = acpi_tb_parse_root_table(rsdp_address); return_ACPI_STATUS(status); }
acpi_status __init acpi_initialize_tables(struct acpi_table_desc * initial_table_array, u32 initial_table_count, u8 allow_resize) { acpi_physical_address rsdp_address; acpi_status status; ACPI_FUNCTION_TRACE(acpi_initialize_tables); /* * Set up the Root Table Array * Allocate the table array if requested */ if (!initial_table_array) { status = acpi_allocate_root_table(initial_table_count); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } } else { /* Root Table Array has been statically allocated by the host */ ACPI_MEMSET(initial_table_array, 0, (acpi_size) initial_table_count * sizeof(struct acpi_table_desc)); acpi_gbl_root_table_list.tables = initial_table_array; acpi_gbl_root_table_list.size = initial_table_count; acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN; if (allow_resize) { acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; } } /* Get the address of the RSDP */ rsdp_address = acpi_os_get_root_pointer(); if (!rsdp_address) { return_ACPI_STATUS(AE_NOT_FOUND); } /* * Get the root table (RSDT or XSDT) and extract all entries to the local * Root Table Array. This array contains the information of the RSDT/XSDT * in a common, more useable format. */ status = acpi_tb_parse_root_table(rsdp_address, ACPI_TABLE_ORIGIN_MAPPED); return_ACPI_STATUS(status); }