summaryrefslogtreecommitdiff
path: root/src/drivers/elog/elog_internal.h
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-04-26 03:34:00 -0700
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2013-12-02 15:18:06 +0100
commit0bf1febed82c8433686978c74a0c851d85189f91 (patch)
tree902270b684356e6567b8a4b53bed348b8547e4d4 /src/drivers/elog/elog_internal.h
parent84a93d1bc34287f2208e40a704fa48c091182cd5 (diff)
downloadcoreboot-0bf1febed82c8433686978c74a0c851d85189f91.tar.xz
elog: Get rid of the descriptor type and some unnecessary wrappers
There was always exactly one elog descriptor declared and initialized, but its contents were being accessed through a pointer that was passed back and forth between functions instead of being accessed directly. This made the code more verbose than it needed to be and harder to follow. To address this the descriptor type was eliminated, its contents were turned into individual global variables, and various functions were adjusted to no longer take the descriptor as an argument. Similarly, the code was more verbose and complicated than it needed to be because of several wrapper functions which wrapped a single line of code which called an underlying function with particular arguments and were only used once. This makes it harder to tell what the code is doing because the call to the real function you may already be familiar with is obscured behind a new function you've never seen before. It also adds one more text to the file as a whole while providing at best a marginal benefit. Those functions were removed and their callers now call their contents directly. Built and booted on Link. Ran mosys eventlog list. Cleared the event log and ran mosys eventlog list again. Added 2000 events and ran mosys eventlog list. Cleared the log again and ran mosys eventlog list. Change-Id: I4f5f6b9f4f508548077b7f5a92f4322db99e01ca Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/49310 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/4245 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/drivers/elog/elog_internal.h')
-rw-r--r--src/drivers/elog/elog_internal.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/drivers/elog/elog_internal.h b/src/drivers/elog/elog_internal.h
index e83df5f089..dd282311a6 100644
--- a/src/drivers/elog/elog_internal.h
+++ b/src/drivers/elog/elog_internal.h
@@ -63,20 +63,9 @@ typedef enum elog_event_buffer_state {
ELOG_EVENT_BUFFER_CORRUPTED,
} elog_event_buffer_state;
-/*
- * Internal handler for event log buffers
- */
-struct elog_descriptor {
- elog_area_state area_state;
- elog_header_state header_state;
- elog_event_buffer_state event_buffer_state;
- void *backing_store;
- u8 *data;
- u32 flash_base;
- u16 total_size;
- u16 data_size;
- u16 next_event_offset;
- u16 event_count;
-};
+struct elog_area {
+ struct elog_header header;
+ u8 data[0];
+} __attribute__((packed));
#endif /* ELOG_INTERNAL_H_ */