Attention is currently required from: Mariusz Szafrański, Jonathan Zhang, Arthur Heymans, Andrey Petrov, Patrick Rudolph, Anjaneya "Reddy" Chagam, Johnny Lin, Christian Walter, Suresh Bellampalli, Tim Wawrzynczak, Vanessa Eusebio, Michal Motyl, Tim Chu. Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58392 )
Change subject: soc/intel: Constify `soc_get_cstate_map()` ......................................................................
soc/intel: Constify `soc_get_cstate_map()`
Return a read-only pointer from the `soc_get_cstate_map()` function. Also, constify the actual data where applicable.
Change-Id: I7d46f1e373971c789eaf1eb582e9aa2d3f661785 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/soc/intel/alderlake/acpi.c M src/soc/intel/apollolake/acpi.c M src/soc/intel/cannonlake/acpi.c M src/soc/intel/common/block/acpi/acpi.c M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/denverton_ns/acpi.c M src/soc/intel/elkhartlake/acpi.c M src/soc/intel/icelake/acpi.c M src/soc/intel/jasperlake/acpi.c M src/soc/intel/tigerlake/acpi.c M src/soc/intel/xeon_sp/acpi.c 11 files changed, 13 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/58392/1
diff --git a/src/soc/intel/alderlake/acpi.c b/src/soc/intel/alderlake/acpi.c index 9b117f9..b658a51 100644 --- a/src/soc/intel/alderlake/acpi.c +++ b/src/soc/intel/alderlake/acpi.c @@ -111,7 +111,7 @@ C_STATE_C10 };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; diff --git a/src/soc/intel/apollolake/acpi.c b/src/soc/intel/apollolake/acpi.c index b6d61b1..0dfcabb 100644 --- a/src/soc/intel/apollolake/acpi.c +++ b/src/soc/intel/apollolake/acpi.c @@ -30,7 +30,7 @@ .addrl = address, \ }
-static acpi_cstate_t cstate_map[] = { +static const acpi_cstate_t cstate_map[] = { { /* C1 */ .ctype = 1, /* ACPI C1 */ @@ -62,7 +62,7 @@ write32p(soc_read_pmc_base() + IRQ_REG, scis); }
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { *entries = ARRAY_SIZE(cstate_map); return cstate_map; diff --git a/src/soc/intel/cannonlake/acpi.c b/src/soc/intel/cannonlake/acpi.c index 10543e9..5df3e96 100644 --- a/src/soc/intel/cannonlake/acpi.c +++ b/src/soc/intel/cannonlake/acpi.c @@ -111,7 +111,7 @@ C_STATE_C10 };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index c21a861..ff2910e 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -254,7 +254,7 @@
static void generate_c_state_entries(void) { - acpi_cstate_t *c_state_map; + const acpi_cstate_t *c_state_map; size_t entries;
c_state_map = soc_get_cstate_map(&entries); diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index 59fd244..bc6c517 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -37,7 +37,7 @@ * get_cstate_map returns a table of processor specific acpi_cstate_t entries * and number of entries in the table */ -acpi_cstate_t *soc_get_cstate_map(size_t *num_entries); +const acpi_cstate_t *soc_get_cstate_map(size_t *num_entries);
/* * get_tstate_map returns a table of processor specific acpi_tstate_t entries diff --git a/src/soc/intel/denverton_ns/acpi.c b/src/soc/intel/denverton_ns/acpi.c index a28da48..c4e3b2c 100644 --- a/src/soc/intel/denverton_ns/acpi.c +++ b/src/soc/intel/denverton_ns/acpi.c @@ -27,7 +27,7 @@ .addrl = address, \ }
-static acpi_cstate_t cstate_map[] = { +static const acpi_cstate_t cstate_map[] = { { /* C1 */ .ctype = 1, /* ACPI C1 */ @@ -75,7 +75,7 @@ return pci_read_config32(dev, PMC_ACPI_CNT); }
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { *entries = ARRAY_SIZE(cstate_map); return cstate_map; diff --git a/src/soc/intel/elkhartlake/acpi.c b/src/soc/intel/elkhartlake/acpi.c index be3e16d..ae2a273 100644 --- a/src/soc/intel/elkhartlake/acpi.c +++ b/src/soc/intel/elkhartlake/acpi.c @@ -110,7 +110,7 @@ C_STATE_C10 };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; diff --git a/src/soc/intel/icelake/acpi.c b/src/soc/intel/icelake/acpi.c index a01ae87..0072eb3 100644 --- a/src/soc/intel/icelake/acpi.c +++ b/src/soc/intel/icelake/acpi.c @@ -107,7 +107,7 @@ C_STATE_C10 };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; diff --git a/src/soc/intel/jasperlake/acpi.c b/src/soc/intel/jasperlake/acpi.c index cf04c4c..155ef0d 100644 --- a/src/soc/intel/jasperlake/acpi.c +++ b/src/soc/intel/jasperlake/acpi.c @@ -110,7 +110,7 @@ C_STATE_C10 };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; diff --git a/src/soc/intel/tigerlake/acpi.c b/src/soc/intel/tigerlake/acpi.c index 96ef364..86327ee 100644 --- a/src/soc/intel/tigerlake/acpi.c +++ b/src/soc/intel/tigerlake/acpi.c @@ -110,7 +110,7 @@ C_STATE_C10 };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/acpi.c index 9da1b14..de9db88 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/acpi.c @@ -58,7 +58,7 @@ C_STATE_C6, };
-acpi_cstate_t *soc_get_cstate_map(size_t *entries) +const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[ARRAY_SIZE(cstate_set_all)]; int *cstate_set;