The SLIT/SRAT tables needs to be parsed for on arm64 platforms that use UEFI/ACPI firmware and support NUMA. To do this, we need to move most of the logic of x86/acpica/srat.c to dev/acpica and provide an API which other architectures can use to parse and configure NUMA proximity information.
This commit adds the API to srat.c as a first step, without making any functional changes. We will move the common code as the next step.
The functions added are:
- int acpi_pxm_init(int ncpus, vm_paddr_t maxphys) - to allocate and initialize data structures used.
- void acpi_pxm_parse_tables(void) - parse SRAT/SLIT, save the cpu and memory proximity information
- void acpi_pxm_set_mem_locality(void) - the use saved data to set memory locality
- void acpi_pxm_set_cpu_locality(void) - use saved data to set cpu locality
- void acpi_pxm_free(void) - free data structs allocated by init
On arm64, we do not have an cpu APIC id that can be used as index to store CPU data, we need to use the Processor Uid. To help with this, define internal functions cpus_add, cpus_find, cpus_get_info to store and get CPU info.