summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc/malloc.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-03-05 16:55:15 -0800
committerPatrick Georgi <pgeorgi@google.com>2019-03-07 17:15:30 +0000
commiteab2a29c8bb0fafebd398cf60425dee37df27820 (patch)
tree419dab747e0148442c1a7ac7082fcfe37784ea27 /payloads/libpayload/libc/malloc.c
parentb431833c129e0d6402c6f7be8e6028e4b54e94fb (diff)
downloadcoreboot-eab2a29c8bb0fafebd398cf60425dee37df27820.tar.xz
payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX)
This patch is a raw application of find payloads/ -type f | \ xargs sed -i -e 's/IS_ENABLED\s*(CONFIG_/CONFIG(/g' Change-Id: I883b03b189f59b5d998a09a2596b0391a2d5cf33 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31775 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads/libpayload/libc/malloc.c')
-rw-r--r--payloads/libpayload/libc/malloc.c18
1 files changed, 9 insertions, 9 deletions
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;