cpu/intel/speedstep: Constify get_cst_entries()

Make the `get_cst_entries()` function provide a read-only pointer. Also,
constify the actual data where applicable.

Change-Id: Ib22b3e37b086a95af770465a45222e9b84202e54
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58393
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Angel Pons 2021-10-17 13:35:23 +02:00 committed by Felix Held
parent e9f10ff38b
commit afd268a0cb
28 changed files with 36 additions and 36 deletions

View File

@ -88,7 +88,7 @@ void generate_cpu_entries(const struct device *device)
CPUs share the same CPUs share the same
layout. */ layout. */
int num_cstates; int num_cstates;
acpi_cstate_t *cstates; const acpi_cstate_t *cstates;
sst_table_t pstates; sst_table_t pstates;
uint8_t coordination; uint8_t coordination;

View File

@ -499,7 +499,7 @@ void acpigen_write_field(const char *name, const struct fieldlist *l, size_t cou
void acpigen_write_indexfield(const char *idx, const char *data, void acpigen_write_indexfield(const char *idx, const char *data,
struct fieldlist *l, size_t count, uint8_t flags); struct fieldlist *l, size_t count, uint8_t flags);
int get_cst_entries(acpi_cstate_t **); int get_cst_entries(const acpi_cstate_t **);
/* /*
* Get element from package into specified destination op: * Get element from package into specified destination op:

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ {
.ctype = 1, .ctype = 1,
.latency = 1, .latency = 1,
@ -31,7 +31,7 @@ static acpi_cstate_t cst_entries[] = {
}, },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -3,7 +3,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
/* TODO: Could work... */ /* TODO: Could work... */
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -3,7 +3,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <southbridge/intel/i82801gx/i82801gx.h> #include <southbridge/intel/i82801gx/i82801gx.h>
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ {
/* ACPI C1 / CPU C1 */ /* ACPI C1 / CPU C1 */
1, 0x01, 1000, 1, 0x01, 1000,
@ -21,7 +21,7 @@ static acpi_cstate_t cst_entries[] = {
}, },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,9 +2,9 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
static acpi_cstate_t cst_entries[] = {}; static const acpi_cstate_t cst_entries[] = {};
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ {
/* ACPI C1 / CPU C1 */ /* ACPI C1 / CPU C1 */
1, 0x01, 1000, 1, 0x01, 1000,
@ -20,7 +20,7 @@ static acpi_cstate_t cst_entries[] = {
}, },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -3,13 +3,13 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
#include <southbridge/intel/i82801gx/i82801gx.h> #include <southbridge/intel/i82801gx/i82801gx.h>
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ 1, 1, 1000, { 0x7f, 1, 2, 0, 1, 0 } }, { 1, 1, 1000, { 0x7f, 1, 2, 0, 1, 0 } },
{ 2, 1, 500, { 0x01, 8, 0, 0, DEFAULT_PMBASE + LV2, 0 } }, { 2, 1, 500, { 0x01, 8, 0, 0, DEFAULT_PMBASE + LV2, 0 } },
{ 3, 17, 250, { 0x01, 8, 0, 0, DEFAULT_PMBASE + LV3, 0 } }, { 3, 17, 250, { 0x01, 8, 0, 0, DEFAULT_PMBASE + LV3, 0 } },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ {
/* ACPI C1 / CPU C1 */ /* ACPI C1 / CPU C1 */
1, 0x01, 1000, 1, 0x01, 1000,
@ -20,7 +20,7 @@ static acpi_cstate_t cst_entries[] = {
}, },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -13,7 +13,7 @@
.addrh = 0, \ .addrh = 0, \
} }
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ {
.ctype = 1, .ctype = 1,
.latency = 1, .latency = 1,
@ -34,7 +34,7 @@ static acpi_cstate_t cst_entries[] = {
}, },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
#include <acpi/acpigen.h> #include <acpi/acpigen.h>
static acpi_cstate_t cst_entries[] = { static const acpi_cstate_t cst_entries[] = {
{ {
/* ACPI C1 / CPU C1 */ /* ACPI C1 / CPU C1 */
1, 0x01, 1000, 1, 0x01, 1000,
@ -15,7 +15,7 @@ static acpi_cstate_t cst_entries[] = {
}, },
}; };
int get_cst_entries(acpi_cstate_t **entries) int get_cst_entries(const acpi_cstate_t **entries)
{ {
*entries = cst_entries; *entries = cst_entries;
return ARRAY_SIZE(cst_entries); return ARRAY_SIZE(cst_entries);