2014-11-11 02:22:04 +01:00
|
|
|
#ifndef __LIB_CBFS_CORE
|
|
|
|
#define __LIB_CBFS_CORE
|
|
|
|
|
|
|
|
#include <cbfs.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#ifdef LIBPAYLOAD
|
|
|
|
# include <libpayload-config.h>
|
|
|
|
# ifdef CONFIG_LZMA
|
|
|
|
# include <lzma.h>
|
|
|
|
# define CBFS_CORE_WITH_LZMA
|
|
|
|
# endif
|
|
|
|
# define CBFS_MINI_BUILD
|
|
|
|
#elif defined(__SMM__)
|
|
|
|
# define CBFS_MINI_BUILD
|
2015-04-02 19:44:19 +02:00
|
|
|
#elif defined(__BOOTBLOCK__)
|
2014-11-11 02:22:04 +01:00
|
|
|
/* No LZMA in boot block. */
|
2015-05-01 23:48:54 +02:00
|
|
|
#elif defined(__VERSTAGE__)
|
|
|
|
/* No LZMA in verstage. */
|
2014-11-11 02:22:04 +01:00
|
|
|
#elif defined(__PRE_RAM__) && !CONFIG_COMPRESS_RAMSTAGE
|
|
|
|
/* No LZMA in romstage if ramstage is not compressed. */
|
|
|
|
#else
|
|
|
|
# define CBFS_CORE_WITH_LZMA
|
|
|
|
# include <lib.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <cbfs.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <cbmem.h>
|
|
|
|
|
|
|
|
#ifdef LIBPAYLOAD
|
|
|
|
# include <stdio.h>
|
|
|
|
# define DEBUG(x...)
|
|
|
|
# define LOG(x...) printf(x)
|
|
|
|
# define ERROR(x...) printf(x)
|
|
|
|
#else
|
|
|
|
# include <console/console.h>
|
|
|
|
# define ERROR(x...) printk(BIOS_ERR, "CBFS: " x)
|
|
|
|
# define LOG(x...) printk(BIOS_INFO, "CBFS: " x)
|
|
|
|
# if CONFIG_DEBUG_CBFS
|
|
|
|
# define DEBUG(x...) printk(BIOS_SPEW, "CBFS: " x)
|
|
|
|
# else
|
|
|
|
# define DEBUG(x...)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __LIB_CBFS_CORE */
|