From d45e70c124b9904c7a7d13aad32de99206714d7b Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 16 Jul 2021 16:42:59 -0700 Subject: Move elog_internal.h to commonlib/bsd/include Move elog_internal.h to commonlib/bsd/include/bsd/. And rename it from elog_internal.h to elog.h. Since this file will be included from util/ it also converts the "uNN" types into "uintNN_t" types. The two defines that are not used by util/ are moved to drivers/elog/elog.c, the only file that includes them. Move also the function elog_verify_header() from drivers/elog/, to commonlib/bsd/elog.c since this function will be called from util/ as well. The rationale behind moving elog's defines & structs to commonlib/bsd/include is to make them available to util/ tools and/or payloads (should it be needed in the future). The files that are being relicensed to BSD were coded by Duncan Laurie, and he is Ok with the relicense. BUG=b:172210863 Signed-off-by: Ricardo Quesada Change-Id: Ia1aefea705ddd417a1d9e978bb18ab6d9a60cad6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56404 Tested-by: build bot (Jenkins) Reviewed-by: Jack Rosenthal Reviewed-by: Tim Wawrzynczak --- src/commonlib/bsd/include/commonlib/bsd/elog.h | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/commonlib/bsd/include/commonlib/bsd/elog.h (limited to 'src/commonlib/bsd/include') diff --git a/src/commonlib/bsd/include/commonlib/bsd/elog.h b/src/commonlib/bsd/include/commonlib/bsd/elog.h new file mode 100644 index 0000000000..6c58557fbe --- /dev/null +++ b/src/commonlib/bsd/include/commonlib/bsd/elog.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +#ifndef _COMMONLIB_BSD_ELOG_H_ +#define _COMMONLIB_BSD_ELOG_H_ + +#include + +#include + +/* ELOG header */ +struct elog_header { + uint32_t magic; + uint8_t version; + uint8_t header_size; + uint8_t reserved[2]; +} __packed; + +/* ELOG related constants */ +#define ELOG_SIGNATURE 0x474f4c45 /* 'ELOG' */ +#define ELOG_VERSION 1 + +/* SMBIOS event log header */ +struct event_header { + uint8_t type; + uint8_t length; + uint8_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + uint8_t second; +} __packed; + +/* SMBIOS Type 15 related constants */ +#define ELOG_HEADER_TYPE_OEM 0x88 + +enum cb_err elog_verify_header(const struct elog_header *header); + +#endif /* _COMMONLIB_BSD_ELOG_H_ */ -- cgit v1.2.3