From d0d57a7460bf40f96818b064ca4cd9b687c58b4c Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Thu, 8 May 2014 20:04:02 -0700 Subject: 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 Original-Change-Id: Ibf56d29a09234068773378f99ad9bffd5480dc9c Original-Reviewed-on: https://chromium-review.googlesource.com/198647 Original-Reviewed-by: Julius Werner Original-Reviewed-by: Tom Warren Original-Commit-Queue: David Hendricks Original-Tested-by: David Hendricks (cherry picked from commit 8e83dd460647972c4f46c19f8dc3d3ad7baeb550) Signed-off-by: Marc Jones Change-Id: I3c0803ceb7a1c06da717416c42b6b7730c029ed0 Reviewed-on: http://review.coreboot.org/7901 Reviewed-by: Edward O'Callaghan Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks --- src/include/elog.h | 20 ++++++++++++++++---- 1 file 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_ */ -- cgit v1.2.3