Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34881 )
Change subject: arch/x86: Replace some cases of MAYBE_STATIC ......................................................................
arch/x86: Replace some cases of MAYBE_STATIC
For platform code that builds with CAR_GLOBAL_MIGRATION=n or when source file is for ramstage only, we can directly declare these static.
Change-Id: Id42e698cf7048936e102862ccf3799f0fc4bfd33 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/ec/google/chromeec/ec_boardid.c M src/ec/google/wilco/boardid.c M src/mainboard/intel/glkrvp/boardid.c M src/mainboard/intel/glkrvp/variants/baseboard/boardid.c M src/mainboard/intel/icelake_rvp/board_id.c M src/mainboard/intel/kblrvp/board_id.c M src/soc/intel/baytrail/northcluster.c M src/soc/intel/braswell/northcluster.c 8 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/34881/1
diff --git a/src/ec/google/chromeec/ec_boardid.c b/src/ec/google/chromeec/ec_boardid.c index 01e3c90..97aba00 100644 --- a/src/ec/google/chromeec/ec_boardid.c +++ b/src/ec/google/chromeec/ec_boardid.c @@ -18,7 +18,7 @@
uint32_t board_id(void) { - MAYBE_STATIC uint32_t id = BOARD_ID_INIT; + static uint32_t id = BOARD_ID_INIT;
if (id == BOARD_ID_INIT) { if (google_chromeec_get_board_version(&id)) diff --git a/src/ec/google/wilco/boardid.c b/src/ec/google/wilco/boardid.c index e602e6e..c840a58 100644 --- a/src/ec/google/wilco/boardid.c +++ b/src/ec/google/wilco/boardid.c @@ -18,7 +18,7 @@
uint32_t board_id(void) { - MAYBE_STATIC uint32_t id = BOARD_ID_INIT; + static uint32_t id = BOARD_ID_INIT;
if (id == BOARD_ID_INIT) { uint8_t ec_id; diff --git a/src/mainboard/intel/glkrvp/boardid.c b/src/mainboard/intel/glkrvp/boardid.c index 0676eac..d98914a 100644 --- a/src/mainboard/intel/glkrvp/boardid.c +++ b/src/mainboard/intel/glkrvp/boardid.c @@ -25,7 +25,7 @@
uint32_t board_id(void) { - MAYBE_STATIC int id = -1; + static int id = -1; if (id < 0) { if (CONFIG(EC_GOOGLE_CHROMEEC)) id = variant_board_id(); diff --git a/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c b/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c index 69a0a91..f987070 100644 --- a/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c +++ b/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c @@ -19,7 +19,7 @@
int variant_board_id(void) { - MAYBE_STATIC uint32_t id = BOARD_ID_INIT; + static uint32_t id = BOARD_ID_INIT;
if (CONFIG(EC_GOOGLE_CHROMEEC)) { if (id == BOARD_ID_INIT) { diff --git a/src/mainboard/intel/icelake_rvp/board_id.c b/src/mainboard/intel/icelake_rvp/board_id.c index b56f047..3214577 100644 --- a/src/mainboard/intel/icelake_rvp/board_id.c +++ b/src/mainboard/intel/icelake_rvp/board_id.c @@ -31,7 +31,7 @@ /* Get Board ID via EC I/O port write/read */ int get_board_id(void) { - MAYBE_STATIC int id = -1; + static int id = -1;
if (id < 0) { if (CONFIG(EC_GOOGLE_CHROMEEC)) diff --git a/src/mainboard/intel/kblrvp/board_id.c b/src/mainboard/intel/kblrvp/board_id.c index a978e0f..6cead14 100644 --- a/src/mainboard/intel/kblrvp/board_id.c +++ b/src/mainboard/intel/kblrvp/board_id.c @@ -22,7 +22,7 @@ */ int get_ec_boardinfo(void) { - MAYBE_STATIC int ec_info = -1; + static int ec_info = -1; if (ec_info < 0) { uint8_t buffer[2]; uint8_t index; diff --git a/src/soc/intel/baytrail/northcluster.c b/src/soc/intel/baytrail/northcluster.c index 5f33c86..42cae64 100644 --- a/src/soc/intel/baytrail/northcluster.c +++ b/src/soc/intel/baytrail/northcluster.c @@ -64,7 +64,7 @@
uint32_t nc_read_top_of_low_memory(void) { - MAYBE_STATIC uint32_t tolm = 0; + static uint32_t tolm;
if (tolm) return tolm; diff --git a/src/soc/intel/braswell/northcluster.c b/src/soc/intel/braswell/northcluster.c index 8a5f02e..afdf86e 100644 --- a/src/soc/intel/braswell/northcluster.c +++ b/src/soc/intel/braswell/northcluster.c @@ -71,7 +71,7 @@
uint32_t nc_read_top_of_low_memory(void) { - MAYBE_STATIC uint32_t tolm = 0; + static uint32_t tolm;
if (tolm) return tolm;
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34881 )
Change subject: arch/x86: Replace some cases of MAYBE_STATIC ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34881/1/src/ec/google/chromeec/ec_b... File src/ec/google/chromeec/ec_boardid.c:
https://review.coreboot.org/c/coreboot/+/34881/1/src/ec/google/chromeec/ec_b... PS1, Line 21: static uint32_t id = BOARD_ID_INIT; We don't have a .data section in early stages.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34881 )
Change subject: arch/x86: Replace some cases of MAYBE_STATIC ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34881/1/src/ec/google/chromeec/ec_b... File src/ec/google/chromeec/ec_boardid.c:
https://review.coreboot.org/c/coreboot/+/34881/1/src/ec/google/chromeec/ec_b... PS1, Line 21: static uint32_t id = BOARD_ID_INIT;
We don't have a .data section in early stages.
Yes. I figured it out. Also -fno-zero-initialized-in-bss in AGESA is leaking to coreboot proper.
Kyösti Mälkki has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34881 )
Change subject: arch/x86: Replace some cases of MAYBE_STATIC ......................................................................
Abandoned
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34881 )
Change subject: arch/x86: Replace some cases of MAYBE_STATIC ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34881/1/src/ec/google/chromeec/ec_b... File src/ec/google/chromeec/ec_boardid.c:
https://review.coreboot.org/c/coreboot/+/34881/1/src/ec/google/chromeec/ec_b... PS1, Line 21: static uint32_t id = BOARD_ID_INIT;
Yes. I figured it out. Also -fno-zero-initialized-in-bss in AGESA is leaking to coreboot proper.
Well that's not good...