[coreboot-gerrit] New patch to review for coreboot: 1f8865e CAR_GLOBAL: don't use static, but hide variables instead

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Sat Jan 18 18:29:48 CET 2014


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4718

-gerrit

commit 1f8865e919917b9c4d718e23fbe31e34fd739a02
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Sat Jan 18 17:02:11 2014 +0100

    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>
---
 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/pc80/tpm.c                      | 2 +-
 src/lib/cbmem_console.c                     | 4 ++--
 src/lib/timestamp.c                         | 6 +++---
 src/lib/usbdebug.c                          | 2 +-
 src/vendorcode/google/chromeos/vbnv.c       | 4 ++--
 8 files changed, 13 insertions(+), 13 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 481153d..2eb3f79 100644
--- a/src/cpu/x86/car.c
+++ b/src/cpu/x86/car.c
@@ -40,7 +40,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/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/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 678f38e..a394d35 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/lib/usbdebug.c b/src/lib/usbdebug.c
index 885599b..dc0ffba 100644
--- a/src/lib/usbdebug.c
+++ b/src/lib/usbdebug.c
@@ -116,7 +116,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;
 #if !defined(__PRE_RAM__) && !defined(__SMM__)
 static struct device_operations *ehci_drv_ops;
 static struct device_operations ehci_dbg_ops;
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