diff options
author | David Hendricks <dhendrix@chromium.org> | 2014-05-08 20:04:02 -0700 |
---|---|---|
committer | Marc Jones <marc.jones@se-eng.com> | 2014-12-30 21:28:50 +0100 |
commit | d0d57a7460bf40f96818b064ca4cd9b687c58b4c (patch) | |
tree | 8efe327a84a0d1741bce6c1c9ae78ee36428c711 | |
parent | 7086ea920d4181f1d4927e9f150a3976c7a8f3a7 (diff) | |
download | coreboot-d0d57a7460bf40f96818b064ca4cd9b687c58b4c.tar.xz |
nyan*: Add an empty elog functions for the !CONFIG_ELOG case
Provide elog stub functions so eventlog support can be omitted
without littering code with "#if CONFIG_ELOG".
This makes it so coreboot can be built without eventlog support for
these platforms for debugging purposes.
BUG=none
BRANCH=none
TEST=compiled for Nyan and Rambi with CONFIG_ELOG unset
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Original-Change-Id: Ibf56d29a09234068773378f99ad9bffd5480dc9c
Original-Reviewed-on: https://chromium-review.googlesource.com/198647
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Tom Warren <twarren@nvidia.com>
Original-Commit-Queue: David Hendricks <dhendrix@chromium.org>
Original-Tested-by: David Hendricks <dhendrix@chromium.org>
(cherry picked from commit 8e83dd460647972c4f46c19f8dc3d3ad7baeb550)
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Change-Id: I3c0803ceb7a1c06da717416c42b6b7730c029ed0
Reviewed-on: http://review.coreboot.org/7901
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r-- | src/include/elog.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/include/elog.h b/src/include/elog.h index 77275456e1..5d360817da 100644 --- a/src/include/elog.h +++ b/src/include/elog.h @@ -20,8 +20,6 @@ #ifndef ELOG_H_ #define ELOG_H_ -#if CONFIG_ELOG - /* SMI command code for GSMI event logging */ #define ELOG_GSMI_APM_CNT 0xEF @@ -148,6 +146,7 @@ struct elog_event_data_me_extended { /* CPU Thermal Trip */ #define ELOG_TYPE_THERM_TRIP 0xa7 +#if CONFIG_ELOG /* Eventlog backing storage must be initialized before calling elog_init(). */ extern int elog_init(void); extern int elog_clear(void); @@ -158,6 +157,21 @@ extern void elog_add_event_word(u8 event_type, u16 data); extern void elog_add_event_dword(u8 event_type, u32 data); extern void elog_add_event_wake(u8 source, u32 instance); extern int elog_smbios_write_type15(unsigned long *current, int handle); +#else +/* Stubs to help avoid littering sources with #if CONFIG_ELOG */ +static inline int elog_init(void) { return -1; } +static inline int elog_clear(void) { return -1; } +static inline void elog_add_event_raw(void) { return; } +static inline void elog_add_event(u8 event_type) { return; } +static inline void elog_add_event_byte(u8 event_type, u8 data) { return; } +static inline void elog_add_event_word(u8 event_type, u16 data) { return; } +static inline void elog_add_event_dword(u8 event_type, u32 data) { return; } +static inline void elog_add_event_wake(u8 source, u32 instance) { return; } +static inline int elog_smbios_write_type15(unsigned long *current, + int handle) { + return 0; +} +#endif #if CONFIG_ELOG_GSMI extern u32 gsmi_exec(u8 command, u32 *param); @@ -170,6 +184,4 @@ u32 boot_count_increment(void); static inline u32 boot_count_read(void) { return 0; } #endif /* CONFIG_ELOG_BOOT_COUNT */ -#endif /* !CONFIG_ELOG */ - #endif /* ELOG_H_ */ |