summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/64bit_div.c2
-rw-r--r--payloads/libpayload/libc/console.c12
-rw-r--r--payloads/libpayload/libc/coreboot.c14
-rw-r--r--payloads/libpayload/libc/exec.c4
-rw-r--r--payloads/libpayload/libc/malloc.c18
-rw-r--r--payloads/libpayload/libc/time.c4
6 files changed, 27 insertions, 27 deletions
diff --git a/payloads/libpayload/libc/64bit_div.c b/payloads/libpayload/libc/64bit_div.c
index 877cef26b6..5cd5bc5e95 100644
--- a/payloads/libpayload/libc/64bit_div.c
+++ b/payloads/libpayload/libc/64bit_div.c
@@ -30,7 +30,7 @@
#include <libpayload-config.h>
#include <stdlib.h>
-#if !IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
+#if !CONFIG(LP_LITTLE_ENDIAN)
#error this code is for little endian only
#endif
diff --git a/payloads/libpayload/libc/console.c b/payloads/libpayload/libc/console.c
index b57fc47bf6..8d7d62d572 100644
--- a/payloads/libpayload/libc/console.c
+++ b/payloads/libpayload/libc/console.c
@@ -102,16 +102,16 @@ int console_remove_output_driver(void *function)
void console_init(void)
{
-#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
+#if CONFIG(LP_VIDEO_CONSOLE)
video_console_init();
#endif
-#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
+#if CONFIG(LP_SERIAL_CONSOLE)
serial_console_init();
#endif
-#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
+#if CONFIG(LP_PC_KEYBOARD)
keyboard_init();
#endif
-#if IS_ENABLED(CONFIG_LP_CBMEM_CONSOLE)
+#if CONFIG(LP_CBMEM_CONSOLE)
cbmem_console_init();
#endif
}
@@ -147,7 +147,7 @@ int puts(const char *s)
int havekey(void)
{
-#if IS_ENABLED(CONFIG_LP_USB)
+#if CONFIG(LP_USB)
usb_poll();
#endif
struct console_input_driver *in;
@@ -164,7 +164,7 @@ int havekey(void)
int getchar(void)
{
while (1) {
-#if IS_ENABLED(CONFIG_LP_USB)
+#if CONFIG(LP_USB)
usb_poll();
#endif
struct console_input_driver *in;
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index 2189161f1b..ba5bb27294 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -56,7 +56,7 @@ static void cb_parse_memory(void *ptr, struct sysinfo_t *info)
for (i = 0; i < count; i++) {
struct cb_memory_range *range = MEM_RANGE_PTR(mem, i);
-#if IS_ENABLED(CONFIG_LP_MEMMAP_RAM_ONLY)
+#if CONFIG(LP_MEMMAP_RAM_ONLY)
if (range->type != CB_MEM_RAM)
continue;
#endif
@@ -155,7 +155,7 @@ static void cb_parse_sku_id(unsigned char *ptr, struct sysinfo_t *info)
info->sku_id = sku_id->id_code;
}
-#if IS_ENABLED(CONFIG_LP_NVRAM)
+#if CONFIG(LP_NVRAM)
static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info)
{
/* ptr points to a coreboot table entry and is already virtual */
@@ -171,7 +171,7 @@ static void cb_parse_checksum(void *ptr, struct sysinfo_t *info)
}
#endif
-#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
+#if CONFIG(LP_COREBOOT_VIDEO_CONSOLE)
static void cb_parse_framebuffer(void *ptr, struct sysinfo_t *info)
{
/* ptr points to a coreboot table entry and is already virtual */
@@ -232,7 +232,7 @@ static void cb_parse_vpd(void *ptr, struct sysinfo_t *info)
info->chromeos_vpd = phys_to_virt(cbmem->cbmem_tab);
}
-#if IS_ENABLED(CONFIG_LP_TIMER_RDTSC)
+#if CONFIG(LP_TIMER_RDTSC)
static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
{
const struct cb_tsc_info *tsc_info = ptr;
@@ -328,7 +328,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_ASSEMBLER:
cb_parse_string(ptr, &info->assembler);
break;
-#if IS_ENABLED(CONFIG_LP_NVRAM)
+#if CONFIG(LP_NVRAM)
case CB_TAG_CMOS_OPTION_TABLE:
cb_parse_optiontable(ptr, info);
break;
@@ -336,7 +336,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
cb_parse_checksum(ptr, info);
break;
#endif
-#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
+#if CONFIG(LP_COREBOOT_VIDEO_CONSOLE)
// FIXME we should warn on serial if coreboot set up a
// framebuffer buf the payload does not know about it.
case CB_TAG_FRAMEBUFFER:
@@ -394,7 +394,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_BOOT_MEDIA_PARAMS:
cb_parse_boot_media_params(ptr, info);
break;
-#if IS_ENABLED(CONFIG_LP_TIMER_RDTSC)
+#if CONFIG(LP_TIMER_RDTSC)
case CB_TAG_TSC_INFO:
cb_parse_tsc_info(ptr, info);
break;
diff --git a/payloads/libpayload/libc/exec.c b/payloads/libpayload/libc/exec.c
index d48d2132de..533600d710 100644
--- a/payloads/libpayload/libc/exec.c
+++ b/payloads/libpayload/libc/exec.c
@@ -30,7 +30,7 @@
#include <libpayload-config.h>
#include <libpayload.h>
-#if IS_ENABLED(CONFIG_LP_ARCH_X86)
+#if CONFIG(LP_ARCH_X86)
extern void i386_do_exec(long addr, int argc, char **argv, int *ret);
#endif
@@ -46,7 +46,7 @@ int exec(long addr, int argc, char **argv)
{
int val = -1;
-#if IS_ENABLED(CONFIG_LP_ARCH_X86)
+#if CONFIG(LP_ARCH_X86)
i386_do_exec(addr, argc, argv, &val);
#endif
return val;
diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c
index 595af63194..957f0e07b0 100644
--- a/payloads/libpayload/libc/malloc.c
+++ b/payloads/libpayload/libc/malloc.c
@@ -47,7 +47,7 @@ struct memory_type {
void *start;
void *end;
struct align_region_t* align_regions;
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
int magic_initialized;
size_t minimal_free;
const char *name;
@@ -58,7 +58,7 @@ extern char _heap, _eheap; /* Defined in the ldscript. */
static struct memory_type default_type =
{ (void *)&_heap, (void *)&_eheap, NULL
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
, 0, 0, "HEAP"
#endif
};
@@ -104,7 +104,7 @@ void init_dma_memory(void *start, u32 size)
dma->end = start + size;
dma->align_regions = NULL;
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
dma->minimal_free = 0;
dma->magic_initialized = 0;
dma->name = "DMA";
@@ -139,7 +139,7 @@ static void *alloc(int len, struct memory_type *type)
if (!HAS_MAGIC(*ptr)) {
size_t size = (type->end - type->start) - HDRSIZE;
*ptr = FREE_BLOCK(size);
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
type->magic_initialized = 1;
type->minimal_free = size;
#endif
@@ -356,7 +356,7 @@ static struct align_region_t *allocate_region(int alignment, int num_elements,
struct align_region_t *r;
size_t extra_space;
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
printf("%s(old align_regions=%p, alignment=%u, num_elements=%u, size=%zu)\n",
__func__, type->align_regions, alignment, num_elements, size);
#endif
@@ -479,7 +479,7 @@ look_further:
{
if ((reg->alignment == align) && (reg->free >= (size + align - 1)/align))
{
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
printf(" found memalign region. %x free, %x required\n", reg->free, (size + align - 1)/align);
#endif
break;
@@ -488,12 +488,12 @@ look_further:
}
if (reg == 0)
{
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
printf(" need to allocate a new memalign region\n");
#endif
/* get align regions */
reg = allocate_region(align, large_request/align, size, type);
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
printf(" ... returned %p\n", reg);
#endif
}
@@ -539,7 +539,7 @@ void *dma_memalign(size_t align, size_t size)
}
/* This is for debugging purposes. */
-#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
+#if CONFIG(LP_DEBUG_MALLOC)
void print_malloc_map(void)
{
struct memory_type *type = heap;
diff --git a/payloads/libpayload/libc/time.c b/payloads/libpayload/libc/time.c
index f8913466dc..75834486b5 100644
--- a/payloads/libpayload/libc/time.c
+++ b/payloads/libpayload/libc/time.c
@@ -34,7 +34,7 @@
#include <libpayload-config.h>
#include <libpayload.h>
-#if IS_ENABLED(CONFIG_LP_ARCH_X86) && IS_ENABLED(CONFIG_LP_NVRAM)
+#if CONFIG(LP_ARCH_X86) && CONFIG(LP_NVRAM)
#include <arch/rdtsc.h>
#endif
@@ -70,7 +70,7 @@ static void update_clock(void)
}
}
-#if IS_ENABLED(CONFIG_LP_NVRAM)
+#if CONFIG(LP_NVRAM)
static unsigned int day_of_year(int mon, int day, int year)
{