Attention is currently required from: Lance Zhao, Jason Glenesk, Raul Rangel, Marshall Dawson, Tim Wawrzynczak, Patrick Rudolph, Felix Held. Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58391 )
Change subject: acpi/acpigen: Constify CST functions' pointers ......................................................................
acpi/acpigen: Constify CST functions' pointers
The `acpigen_write_CST_package` and `acpigen_write_CST_package_entry` functions don't modify the provided C-state information. So, make the pointer parameters read-only to enforce this. Also constify arguments where possible.
Change-Id: I9e18d82ee6c16e4435b8fad6d467e58c33194cf4 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h M src/soc/amd/cezanne/acpi.c M src/soc/amd/picasso/acpi.c M src/soc/intel/baytrail/acpi.c M src/soc/intel/braswell/acpi.c 6 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/58391/1
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index c8f1437..e0892e6 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -994,7 +994,7 @@ acpigen_pop_len(); }
-void acpigen_write_CST_package_entry(acpi_cstate_t *cstate) +void acpigen_write_CST_package_entry(const acpi_cstate_t *cstate) { acpigen_write_package(4); acpigen_write_register_resource(&cstate->resource); @@ -1004,7 +1004,7 @@ acpigen_pop_len(); }
-void acpigen_write_CST_package(acpi_cstate_t *cstate, int nentries) +void acpigen_write_CST_package(const acpi_cstate_t *cstate, int nentries) { int i; acpigen_write_name("_CST"); diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index c019130..cf14c7f 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -357,8 +357,8 @@ void acpigen_write_pss_object(const struct acpi_sw_pstate *pstate_values, size_t nentries); typedef enum { SW_ALL = 0xfc, SW_ANY = 0xfd, HW_ALL = 0xfe } PSD_coord; void acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype); -void acpigen_write_CST_package_entry(acpi_cstate_t *cstate); -void acpigen_write_CST_package(acpi_cstate_t *entry, int nentries); +void acpigen_write_CST_package_entry(const acpi_cstate_t *cstate); +void acpigen_write_CST_package(const acpi_cstate_t *entry, int nentries); typedef enum { CSD_HW_ALL = 0xfe } CSD_coord; void acpigen_write_CSD_package(u32 domain, u32 numprocs, CSD_coord coordtype, u32 index); diff --git a/src/soc/amd/cezanne/acpi.c b/src/soc/amd/cezanne/acpi.c index 3b3a88b..d390ca4 100644 --- a/src/soc/amd/cezanne/acpi.c +++ b/src/soc/amd/cezanne/acpi.c @@ -279,7 +279,7 @@ .addrl = PS_STS_REG, };
- acpi_cstate_t cstate_info[] = { + const acpi_cstate_t cstate_info[] = { [0] = { .ctype = 1, .latency = 1, diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index 99c1648..c0808d9 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -289,7 +289,7 @@ .addrl = PS_STS_REG, };
- acpi_cstate_t cstate_info[] = { + const acpi_cstate_t cstate_info[] = { [0] = { .ctype = 1, .latency = 1, diff --git a/src/soc/intel/baytrail/acpi.c b/src/soc/intel/baytrail/acpi.c index b91134f..029d07f 100644 --- a/src/soc/intel/baytrail/acpi.c +++ b/src/soc/intel/baytrail/acpi.c @@ -28,7 +28,7 @@ }
/* C-state map without S0ix */ -static acpi_cstate_t cstate_map[] = { +static const acpi_cstate_t cstate_map[] = { { /* C1 */ .ctype = 1, /* ACPI C1 */ diff --git a/src/soc/intel/braswell/acpi.c b/src/soc/intel/braswell/acpi.c index 757358d..37b9152 100644 --- a/src/soc/intel/braswell/acpi.c +++ b/src/soc/intel/braswell/acpi.c @@ -36,7 +36,7 @@ }
/* C-state map without S0ix */ -static acpi_cstate_t cstate_map[] = { +static const acpi_cstate_t cstate_map[] = { { /* C1 */ .ctype = 1, /* ACPI C1 */