summaryrefslogtreecommitdiff
path: root/src/commonlib/bsd/include
diff options
context:
space:
mode:
authorRicardo Quesada <ricardoq@google.com>2021-08-16 10:45:42 -0700
committerFelix Held <felix-coreboot@felixheld.de>2021-08-26 18:50:29 +0000
commite929a75fbe51eb7bcc48d18f6bfbda11b39a8373 (patch)
tree87d5754dbea37779523a6e00c16f5f1829673dc3 /src/commonlib/bsd/include
parent778380ac749b21f1551bfb9076ba6404160269c5 (diff)
elog: move functionality to commonlib/bsd
This commit moves some drivers/elog/ functionality to commonlib/bsd since they will be called from util/cbfstool/. In particular: * elog_fill_timestamp(), elog_update_checksum(), elog_checksum_event() were moved to commonlib/bsd/elog * elog_fill_timestamp() receives the time parameters and updates the event based on the "time" arguments. The original elog_*() functions were written by Duncan Laurie (see CB:1311) and he gave permission to re-license the code to BSD. BUG=b:172210863 Change-Id: I67d5ad6e7c4d486b3d4ebb25be77998173cee5a9 Signed-off-by: Ricardo Quesada <ricardoq@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/56985 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/commonlib/bsd/include')
-rw-r--r--src/commonlib/bsd/include/commonlib/bsd/elog.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/commonlib/bsd/include/commonlib/bsd/elog.h b/src/commonlib/bsd/include/commonlib/bsd/elog.h
index 0d41157758..2ac15f0a4f 100644
--- a/src/commonlib/bsd/include/commonlib/bsd/elog.h
+++ b/src/commonlib/bsd/include/commonlib/bsd/elog.h
@@ -313,5 +313,11 @@ struct elog_event_extended_event {
enum cb_err elog_verify_header(const struct elog_header *header);
const struct event_header *elog_get_next_event(const struct event_header *event);
const void *event_get_data(const struct event_header *event);
+void elog_fill_timestamp(struct event_header *event, uint8_t sec, uint8_t min,
+ uint8_t hour, uint8_t mday, uint8_t mon, uint8_t year);
+/* Update the checksum at the last byte. */
+void elog_update_checksum(struct event_header *event, uint8_t checksum);
+/* Simple byte checksum for events. */
+uint8_t elog_checksum_event(const struct event_header *event);
#endif /* _COMMONLIB_BSD_ELOG_H_ */