coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
malloc.c File Reference
#include <console/console.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for malloc.c:

Go to the source code of this file.

Macros

#define MALLOCDBG(x...)
 

Functions

voidmemalign (size_t boundary, size_t size)
 
voidmalloc (size_t size)
 
voidcalloc (size_t nitems, size_t size)
 
void free (void *ptr)
 

Variables

unsigned char _heap
 
unsigned char _eheap
 
static voidfree_mem_ptr = &_heap
 
static voidfree_mem_end_ptr = &_eheap
 
static voidfree_last_alloc_ptr = &_heap
 

Macro Definition Documentation

◆ MALLOCDBG

#define MALLOCDBG (   x...)

Definition at line 8 of file malloc.c.

Function Documentation

◆ calloc()

void* calloc ( size_t  nitems,
size_t  size 
)

Definition at line 58 of file malloc.c.

References malloc(), and memset().

Referenced by dt_find_node(), generate_pin_irq_map(), intel_acpi_gen_def_acpi_pirq(), pci_irq_to_fsp(), populate_pirq_data(), and read_pmc_lpm_requirements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

◆ malloc()

◆ memalign()

void* memalign ( size_t  boundary,
size_t  size 
)

Definition at line 20 of file malloc.c.

References ALIGN, BIOS_ERR, die(), free_last_alloc_ptr, free_mem_end_ptr, free_mem_ptr, MALLOCDBG, and printk.

Referenced by bounce_buffer_start(), and malloc().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _eheap

unsigned char _eheap

Definition at line 11 of file malloc.c.

Referenced by asan_init(), and check_memory_region_inline().

◆ _heap

unsigned char _heap
extern

Referenced by free().

◆ free_last_alloc_ptr

void* free_last_alloc_ptr = &_heap
static

Definition at line 14 of file malloc.c.

Referenced by free(), and memalign().

◆ free_mem_end_ptr

void* free_mem_end_ptr = &_eheap
static

Definition at line 13 of file malloc.c.

Referenced by free(), and memalign().

◆ free_mem_ptr

void* free_mem_ptr = &_heap
static

Definition at line 12 of file malloc.c.

Referenced by free(), and memalign().