summaryrefslogtreecommitdiffstats
path: root/src/include/acpi/acpigen.h
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-01-24 19:31:00 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-01-28 18:50:10 +0000
commitb57b12f729947c83515b96e45885b69d73027d79 (patch)
tree7a51066bdaf0142f4c60277f45e7f8da588c7a3a /src/include/acpi/acpigen.h
parent2fc2758e51d844b6759759b2d6931717ab9f7ca2 (diff)
downloadcoreboot-b57b12f729947c83515b96e45885b69d73027d79.tar.gz
coreboot-b57b12f729947c83515b96e45885b69d73027d79.tar.bz2
coreboot-b57b12f729947c83515b96e45885b69d73027d79.zip
acpi/acpigen: factor out acpigen_write_processor_namestring
This functionality is used in multiple places, so factor it out into a function. Compared to acpigen_write_processor_cnot, the buffer size is decreased from 40 to 16 bytes, but the format string specified by CONFIG_ACPI_CPU_STRING results in 9 chars and a NULL byte which will fit into the buffer without any issue. I've seen the CPU devices being put into another scope within \_SB, but even in that case that would be 14 chars and a NULL byte whist still fits into the 16 byte buffer. For acpigen_write_processor and acpigen_write_processor_package this doesn't change any edge case behavior. In the unrealistic case of the format string resulting in a longer CPU device string, this would have been a problem before this patch too. Also drop the curly braces of the for loop in acpigen_write_processor_package. This makes the code a bit harder to read and isn't a very good idea, but with the curly braces in place, the linter breaks the build :( Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I5d8291a2aaae2011cb185d72c7f7864b6e2220ec Reviewed-on: https://review.coreboot.org/c/coreboot/+/72452 Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'src/include/acpi/acpigen.h')
-rw-r--r--src/include/acpi/acpigen.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h
index bb36707f9c05..ac0cab2b6ec7 100644
--- a/src/include/acpi/acpigen.h
+++ b/src/include/acpi/acpigen.h
@@ -449,6 +449,7 @@ void acpigen_write_pct_package(const acpi_addr_t *perf_ctrl, const acpi_addr_t *
void acpigen_write_xpss_package(const struct acpi_xpss_sw_pstate *pstate_value);
void acpigen_write_xpss_object(const struct acpi_xpss_sw_pstate *pstate_values,
size_t nentries);
+void acpigen_write_processor_namestring(unsigned int cpu_index);
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len);
__always_inline void acpigen_write_processor_end(void)
{