summaryrefslogtreecommitdiffstats
path: root/src/include/elog.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2012-06-23 16:48:38 -0700
committerRonald G. Minnich <rminnich@gmail.com>2012-07-26 00:19:42 +0200
commit79bbbd9db36d93a8a8a1b9d27ef32a69991e6b30 (patch)
tree08470bc793baa5c007a0d8e6b845fa88055868b9 /src/include/elog.h
parent62f1ad98c42f18308cda9351a427bb7af8d7dbca (diff)
downloadcoreboot-staging-79bbbd9db36d93a8a8a1b9d27ef32a69991e6b30.zip
coreboot-staging-79bbbd9db36d93a8a8a1b9d27ef32a69991e6b30.tar.gz
ELOG: Add support for SMM and kernel GSMI driver
The linux kernel contains an SMI driver that was written by me (Duncan) and upstreamed a couple years ago called GSMI. This driver will format a parameter buffer and pass pointers to this parameter buffer to the SMI handler. It uses this to generate events for kernel shutdown reasons: Clean, Panic, Oops, etc. This function expects to be passed pointers into the SMM state save area that correspond to the prameter buffer and the return code, which are typically EAX and EBX. The format of the parameter buffer is defined in the kernel driver so we implement the same interface here in order to be compatible. GSMI_CMD_HANDSHAKE: this is an early call that it does to try and detect what kind of BIOS is running. GSMI_CMD_SET_EVENT_LOG: this contains a parameter buffer that has event type and data. The kernel-specific events are translated here and raw events are passed through as well which allows any run-time event to be added for testing. GSMI_CMD_CLEAR_EVENT_LOG: this command clears the event log. First the gsmi driver must be enabled in the kernel with CONFIG_GOOGLE_GSMI and then events can be added via sysfs and events are automatically generated for various kernel shutdown reasons. These can be seen in the event log as the 'Kernel Event' type: 169 | 2012-06-23 15:03:04 | Kernl Event | Clean Shutdown 181 | 2012-06-23 16:26:32 | Kernl Event | Oops 181 | 2012-06-23 16:26:32 | Kernl Event | Panic Change-Id: Ic0a3916401f0d9811e4aa8b2c560657dccc920c1 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/1316 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/include/elog.h')
-rw-r--r--src/include/elog.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/elog.h b/src/include/elog.h
index 0542f68..7d89f45 100644
--- a/src/include/elog.h
+++ b/src/include/elog.h
@@ -115,6 +115,10 @@ 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);
+#if CONFIG_ELOG_GSMI
+extern u32 gsmi_exec(u8 command, u32 *param);
+#endif
+
#if CONFIG_ELOG_BOOT_COUNT
u32 boot_count_read(void);
u32 boot_count_increment(void);
OpenPOWER on IntegriCloud