[coreboot-gerrit] Patch set updated for coreboot: 992171a CAR_GLOBAL: don't use static, but hide variables instead
Edward O'Callaghan (eocallaghan@alterapraxis.com)
gerrit at coreboot.org
Thu Feb 20 10:40:26 CET 2014
Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4718
-gerrit
commit 992171a54dbf6d2d412fdfd6e34641c06823ede4
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date: Thu Feb 20 20:29:26 2014 +1100
CAR_GLOBAL: don't use static, but hide variables instead
attribute(section) isn't to be used on local variables and clang
enforces that.
Change-Id: Ie0d40946cd087e40f60f9d04e2eda56df75f26da
Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
src/arch/x86/include/arch/early_variables.h | 4 ++--
src/cpu/x86/car.c | 2 +-
src/cpu/x86/lapic/apic_timer.c | 2 +-
src/drivers/emulation/qemu/qemu_debugcon.c | 2 +-
src/drivers/pc80/tpm.c | 2 +-
src/drivers/usb/ehci_debug.c | 2 +-
src/lib/cbmem_console.c | 4 ++--
src/lib/timestamp.c | 6 +++---
src/vendorcode/google/chromeos/vbnv.c | 4 ++--
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h
index ea1a133..34f89df 100644
--- a/src/arch/x86/include/arch/early_variables.h
+++ b/src/arch/x86/include/arch/early_variables.h
@@ -25,8 +25,8 @@ asm(".section .car.global_data,\"w\", at nobits");
asm(".previous");
asm(".section .car.cbmem_console,\"w\", at nobits");
asm(".previous");
-#define CAR_GLOBAL __attribute__((section(".car.global_data")))
-#define CAR_CBMEM __attribute__((section(".car.cbmem_console")))
+#define CAR_GLOBAL __attribute__((section(".car.global_data"))) __attribute__((visibility ("hidden")))
+#define CAR_CBMEM __attribute__((section(".car.cbmem_console"))) __attribute__((visibility ("hidden")))
#else
#define CAR_GLOBAL
#define CAR_CBMEM
diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c
index a7e3842..35e4704 100644
--- a/src/cpu/x86/car.c
+++ b/src/cpu/x86/car.c
@@ -39,7 +39,7 @@ extern char _car_data_end[];
* Based on these 2 attributes there is the ability to tell when the
* cache-as-ram region has been migrated.
*/
-static int car_migrated CAR_GLOBAL;
+int car_migrated CAR_GLOBAL;
void *car_get_var_ptr(void *var)
diff --git a/src/cpu/x86/lapic/apic_timer.c b/src/cpu/x86/lapic/apic_timer.c
index 868fb92..5308567 100644
--- a/src/cpu/x86/lapic/apic_timer.c
+++ b/src/cpu/x86/lapic/apic_timer.c
@@ -41,7 +41,7 @@ static int set_timer_fsb(void)
return 0;
}
#else
-static u32 timer_fsb CAR_GLOBAL = 0;
+u32 timer_fsb CAR_GLOBAL = 0;
static int set_timer_fsb(void)
{
diff --git a/src/drivers/emulation/qemu/qemu_debugcon.c b/src/drivers/emulation/qemu/qemu_debugcon.c
index 9c00585..a7def46 100644
--- a/src/drivers/emulation/qemu/qemu_debugcon.c
+++ b/src/drivers/emulation/qemu/qemu_debugcon.c
@@ -23,7 +23,7 @@
#include <arch/io.h>
#include <arch/early_variables.h>
-static int qemu_debugcon_detected CAR_GLOBAL;
+int qemu_debugcon_detected CAR_GLOBAL;
void qemu_debugcon_init(void)
{
diff --git a/src/drivers/pc80/tpm.c b/src/drivers/pc80/tpm.c
index f581ab4..1955c2c 100644
--- a/src/drivers/pc80/tpm.c
+++ b/src/drivers/pc80/tpm.c
@@ -156,7 +156,7 @@ static const struct vendor_name vendor_names[] = {
* Cached vendor/device ID pair to indicate that the device has been already
* discovered
*/
-static u32 vendor_dev_id CAR_GLOBAL;
+u32 vendor_dev_id CAR_GLOBAL;
static inline u8 tpm_read_status(int locality)
{
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c
index c60fbaa..e2f8b83 100644
--- a/src/drivers/usb/ehci_debug.c
+++ b/src/drivers/usb/ehci_debug.c
@@ -95,7 +95,7 @@ static int dbgp_enabled(void);
#define DBGP_MICROFRAME_RETRIES 10
#define DBGP_MAX_PACKET 8
-static struct ehci_debug_info glob_dbg_info CAR_GLOBAL;
+struct ehci_debug_info glob_dbg_info CAR_GLOBAL;
static inline struct ehci_debug_info *dbgp_ehci_info(void)
{
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c
index 83d44e3..e517fd7 100644
--- a/src/lib/cbmem_console.c
+++ b/src/lib/cbmem_console.c
@@ -34,7 +34,7 @@ struct cbmem_console {
u8 buffer_body[0];
} __attribute__ ((__packed__));
-static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
+struct cbmem_console *cbmem_console_p CAR_GLOBAL;
#ifdef __PRE_RAM__
/*
@@ -43,7 +43,7 @@ static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
* the area are defined in the config.
*/
-static struct cbmem_console car_cbmem_console CAR_CBMEM;
+struct cbmem_console car_cbmem_console CAR_CBMEM;
#else
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index f0ee48d..477d5fe 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -27,8 +27,8 @@
#define MAX_TIMESTAMPS 30
-static struct timestamp_table* ts_table_p CAR_GLOBAL = NULL;
-static tsc_t ts_basetime CAR_GLOBAL = { .lo = 0, .hi =0 };
+struct timestamp_table* ts_table_p CAR_GLOBAL = NULL;
+tsc_t ts_basetime CAR_GLOBAL = { .lo = 0, .hi =0 };
static void timestamp_stash(enum timestamp_id id, tsc_t ts_time);
@@ -89,7 +89,7 @@ struct timestamp_cache {
tsc_t time;
} timestamp_cache[MAX_TIMESTAMP_CACHE] CAR_GLOBAL;
-static int timestamp_entries CAR_GLOBAL = 0;
+int timestamp_entries CAR_GLOBAL = 0;
/**
* timestamp_stash() allows to temporarily cache timestamps.
diff --git a/src/vendorcode/google/chromeos/vbnv.c b/src/vendorcode/google/chromeos/vbnv.c
index a13726d..8f04f1e 100644
--- a/src/vendorcode/google/chromeos/vbnv.c
+++ b/src/vendorcode/google/chromeos/vbnv.c
@@ -52,8 +52,8 @@
#define KERNEL_FIELD_OFFSET 11
#define CRC_OFFSET 15
-static int vbnv_initialized CAR_GLOBAL;
-static uint8_t vbnv[CONFIG_VBNV_SIZE] CAR_GLOBAL;
+int vbnv_initialized CAR_GLOBAL;
+uint8_t vbnv[CONFIG_VBNV_SIZE] CAR_GLOBAL;
/* Wrappers for accessing the variables marked as CAR_GLOBAL. */
static inline int is_vbnv_initialized(void)
More information about the coreboot-gerrit
mailing list