e48bd3adb4
The ERROR() and LOG() macros both used BIOS_ERR as the error level. The messages generated by the LOG() macro are informational items. Change to BIOS_INFO to reflect that. BUG=N/A TEST=tested on facebook monolith Change-Id: I3827a7d65a9d70045a36fb8db4b2c129e1045122 Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52019 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Frans Hendriks <fhendriks@eltan.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
41 lines
1.4 KiB
C
41 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#ifndef _CBFS_GLUE_H_
|
|
#define _CBFS_GLUE_H_
|
|
|
|
#include <commonlib/region.h>
|
|
#include <console/console.h>
|
|
#include <rules.h>
|
|
|
|
/*
|
|
* This flag prevents linking hashing functions into stages where they're not required. We don't
|
|
* need them at all if verification is disabled. If verification is enabled without TOCTOU
|
|
* safety, we only need to verify the metadata hash in the initial stage and can assume it stays
|
|
* valid in later stages. If TOCTOU safety is required, we may need them in every stage to
|
|
* reverify metadata that had to be reloaded from flash (e.g. because it didn't fit the mcache).
|
|
* Note that this only concerns metadata hashing -- file access functions may still link hashing
|
|
* routines independently for file data hashing.
|
|
*/
|
|
#define CBFS_ENABLE_HASHING (CONFIG(CBFS_VERIFICATION) && \
|
|
(CONFIG(TOCTOU_SAFETY) || ENV_INITIAL_STAGE))
|
|
|
|
#define ERROR(...) printk(BIOS_ERR, "CBFS ERROR: " __VA_ARGS__)
|
|
#define LOG(...) printk(BIOS_INFO, "CBFS: " __VA_ARGS__)
|
|
#define DEBUG(...) do { \
|
|
if (CONFIG(DEBUG_CBFS)) \
|
|
printk(BIOS_SPEW, "CBFS DEBUG: " __VA_ARGS__); \
|
|
} while (0)
|
|
|
|
typedef const struct region_device *cbfs_dev_t;
|
|
|
|
static inline ssize_t cbfs_dev_read(cbfs_dev_t dev, void *buffer, size_t offset, size_t size)
|
|
{
|
|
return rdev_readat(dev, buffer, offset, size);
|
|
}
|
|
|
|
static inline size_t cbfs_dev_size(cbfs_dev_t dev)
|
|
{
|
|
return region_device_sz(dev);
|
|
}
|
|
|
|
#endif /* _CBFS_GLUE_H_ */
|