Nico Huber has uploaded this change for review. ( https://review.coreboot.org/21324
Change subject: [WIP] arch/x86/acpigen: Add function to write a CPU package ......................................................................
[WIP] arch/x86/acpigen: Add function to write a CPU package
Emits a list of CPU cores, e.g.
Name (PPKG, Package (2) { _PR.CP00, _PR.CP01 })
Change-Id: I10e9ebad84343d1fb282b3fbb28f5f014f664f14 Signed-off-by: Nico Huber nico.h@gmx.de --- M src/arch/x86/acpigen.c M src/arch/x86/include/arch/acpigen.h 2 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/21324/1
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c index 758386d..d97723c 100644 --- a/src/arch/x86/acpigen.c +++ b/src/arch/x86/acpigen.c @@ -353,6 +353,23 @@ acpigen_emit_byte(pblock_len); }
+void acpigen_write_processor_package(const char *const name, + const size_t first_core, + const size_t core_count) +{ + size_t i; + char pscope[16]; + + acpigen_write_name(name); + acpigen_write_package(core_count); + for (i = first_core; i < core_count; ++i) { + snprintf(pscope, sizeof(pscope), + CONFIG_ACPI_CPU_STRING, (unsigned int)i); + acpigen_emit_namestring(pscope); + } + acpigen_pop_len(); +} + /* * Generate ACPI AML code for OperationRegion * Arg0: Pointer to struct opregion opreg = OPREGION(rname, space, offset, len) diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h index 37d0d55..68d7957 100644 --- a/src/arch/x86/include/arch/acpigen.h +++ b/src/arch/x86/include/arch/acpigen.h @@ -219,6 +219,8 @@ void acpigen_write_CSD_package(u32 domain, u32 numprocs, CSD_coord coordtype, u32 index); void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len); +void acpigen_write_processor_package(const char *name, + size_t first_core, size_t core_count); void acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list); void acpigen_write_TSD_package(u32 domain, u32 numprocs, PSD_coord coordtype); void acpigen_write_mem32fixed(int readwrite, u32 base, u32 size);