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>
This commit is contained in:
David Hendricks 2014-05-08 20:04:02 -07:00 committed by Marc Jones
parent 7086ea920d
commit d0d57a7460
1 changed files with 16 additions and 4 deletions

View File

@ -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_ */