diff options
author | Nico Huber <nico.h@gmx.de> | 2017-09-01 21:14:36 +0200 |
---|---|---|
committer | Patrick Rudolph <siro@das-labor.org> | 2017-11-04 17:23:06 +0000 |
commit | 4d211ac08d79e3925d0ad168fc73631113090a6c (patch) | |
tree | 1fae9c806df99e51d1f14f0996b57af31582a1d1 /src/arch/x86/acpigen.c | |
parent | b2b2015be04c9e1e5a952bf9a54c4e284e068e9e (diff) | |
download | coreboot-4d211ac08d79e3925d0ad168fc73631113090a6c.tar.xz |
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 })
Tested on Lenovo Thinkpad T500.
Change-Id: I10e9ebad84343d1fb282b3fbb28f5f014f664f14
Signed-off-by: Nico Huber <nico.h@gmx.de>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/21324
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/x86/acpigen.c')
-rw-r--r-- | src/arch/x86/acpigen.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c index 758386d8a8..9637b7de96 100644 --- a/src/arch/x86/acpigen.c +++ b/src/arch/x86/acpigen.c @@ -353,6 +353,22 @@ void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len) acpigen_emit_byte(pblock_len); } +void acpigen_write_processor_package(const char *const name, + const unsigned int first_core, + const unsigned int core_count) +{ + unsigned int i; + char pscope[16]; + + acpigen_write_name(name); + acpigen_write_package(core_count); + for (i = first_core; i < first_core + core_count; ++i) { + snprintf(pscope, sizeof(pscope), CONFIG_ACPI_CPU_STRING, 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) |