Edward O'Callaghan | cdabc88 | 2014-11-11 12:22:04 +1100 | [diff] [blame] | 1 | #ifndef __LIB_CBFS_CORE |
| 2 | #define __LIB_CBFS_CORE |
| 3 | |
| 4 | #include <cbfs.h> |
| 5 | #include <string.h> |
| 6 | |
| 7 | #ifdef LIBPAYLOAD |
| 8 | # include <libpayload-config.h> |
| 9 | # ifdef CONFIG_LZMA |
| 10 | # include <lzma.h> |
| 11 | # define CBFS_CORE_WITH_LZMA |
| 12 | # endif |
| 13 | # define CBFS_MINI_BUILD |
| 14 | #elif defined(__SMM__) |
| 15 | # define CBFS_MINI_BUILD |
Patrick Georgi | 56b8309 | 2015-04-02 19:44:19 +0200 | [diff] [blame] | 16 | #elif defined(__BOOTBLOCK__) |
Edward O'Callaghan | cdabc88 | 2014-11-11 12:22:04 +1100 | [diff] [blame] | 17 | /* No LZMA in boot block. */ |
Aaron Durbin | ae1fcc3 | 2015-05-01 16:48:54 -0500 | [diff] [blame^] | 18 | #elif defined(__VERSTAGE__) |
| 19 | /* No LZMA in verstage. */ |
Edward O'Callaghan | cdabc88 | 2014-11-11 12:22:04 +1100 | [diff] [blame] | 20 | #elif defined(__PRE_RAM__) && !CONFIG_COMPRESS_RAMSTAGE |
| 21 | /* No LZMA in romstage if ramstage is not compressed. */ |
| 22 | #else |
| 23 | # define CBFS_CORE_WITH_LZMA |
| 24 | # include <lib.h> |
| 25 | #endif |
| 26 | |
| 27 | #include <cbfs.h> |
| 28 | #include <string.h> |
| 29 | #include <cbmem.h> |
| 30 | |
| 31 | #ifdef LIBPAYLOAD |
| 32 | # include <stdio.h> |
| 33 | # define DEBUG(x...) |
| 34 | # define LOG(x...) printf(x) |
| 35 | # define ERROR(x...) printf(x) |
| 36 | #else |
| 37 | # include <console/console.h> |
| 38 | # define ERROR(x...) printk(BIOS_ERR, "CBFS: " x) |
| 39 | # define LOG(x...) printk(BIOS_INFO, "CBFS: " x) |
| 40 | # if CONFIG_DEBUG_CBFS |
| 41 | # define DEBUG(x...) printk(BIOS_SPEW, "CBFS: " x) |
| 42 | # else |
| 43 | # define DEBUG(x...) |
| 44 | # endif |
| 45 | #endif |
| 46 | |
Edward O'Callaghan | cdabc88 | 2014-11-11 12:22:04 +1100 | [diff] [blame] | 47 | #endif /* __LIB_CBFS_CORE */ |