coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lib.h File Reference
#include <types.h>
Include dependency graph for lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t ulzman (const void *src, size_t srcn, void *dst, size_t dstn)
 
void ram_check (uintptr_t start)
 
int ram_check_nodie (uintptr_t start)
 
int ram_check_noprint_nodie (uintptr_t start)
 
void quick_ram_check_or_die (uintptr_t dst)
 
int primitive_memtest (uintptr_t base, uintptr_t size)
 
int checkstack (void *top_of_stack, int core)
 
void hexdump (const void *memory, size_t length)
 
size_t hexstrtobin (const char *str, uint8_t *buf, size_t len)
 
static int popcnt (u32 x)
 
static int clz (u32 x)
 
static int log2 (u32 x)
 
static int __ffs (u32 x)
 
static int __fls (u32 x)
 
static int log2_ceil (u32 x)
 
static int popcnt64 (u64 x)
 
static int clz64 (u64 x)
 
static int log2_64 (u64 x)
 
static int __ffs64 (u64 x)
 
static int __fls64 (u64 x)
 

Function Documentation

◆ __ffs()

static int __ffs ( u32  x)
inlinestatic

Definition at line 55 of file lib.h.

References log2(), and x.

Referenced by msdc_set_field().

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

◆ __ffs64()

static int __ffs64 ( u64  x)
inlinestatic

Definition at line 65 of file lib.h.

References log2_64(), and x.

Here is the call graph for this function:

◆ __fls()

static int __fls ( u32  x)
inlinestatic

Definition at line 57 of file lib.h.

References log2(), and x.

Referenced by mtk_pcie_set_trans_window(), and sdhci_init().

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

◆ __fls64()

static int __fls64 ( u64  x)
inlinestatic

Definition at line 66 of file lib.h.

References log2_64(), and x.

Referenced by configure_adjustable_base(), and pci_store_rebar_size().

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

◆ checkstack()

int checkstack ( void top_of_stack,
int  core 
)

Definition at line 30 of file stack.c.

References BIOS_ERR, BIOS_SPEW, BUG, printk, and REGION_SIZE.

Referenced by platform_prog_run(), and wait_other_cpus_stop().

Here is the caller graph for this function:

◆ clz()

static int clz ( u32  x)
inlinestatic

Definition at line 51 of file lib.h.

References x.

Referenced by log2().

Here is the caller graph for this function:

◆ clz64()

static int clz64 ( u64  x)
inlinestatic

Definition at line 63 of file lib.h.

References x.

Referenced by log2_64().

Here is the caller graph for this function:

◆ hexdump()

◆ hexstrtobin()

size_t hexstrtobin ( const char *  str,
uint8_t buf,
size_t  len 
)

Definition at line 6 of file hexstrtobin.c.

References buf, c, count, isdigit(), isxdigit(), and tolower().

Referenced by acpigen_write_uuid(), parse_uuid(), and transfer_memory_info().

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

◆ log2()

static int log2 ( u32  x)
inlinestatic

Definition at line 53 of file lib.h.

References clz(), and x.

Referenced by __ffs(), __fls(), amdfam14_link_read_bases(), amdfam15_link_read_bases(), amdfam16_link_read_bases(), configure_e7501_cas_latency(), dsi_phy_pll_calcandcommit(), i2c_init(), iommu_read_resources(), log2_ceil(), program_memory_map(), rkclk_init(), setup_fifo_params(), and spd_get_msbs().

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

◆ log2_64()

static int log2_64 ( u64  x)
inlinestatic

Definition at line 64 of file lib.h.

References clz64(), and x.

Referenced by __ffs64(), and __fls64().

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

◆ log2_ceil()

static int log2_ceil ( u32  x)
inlinestatic

Definition at line 60 of file lib.h.

References log2(), and x.

Referenced by fast_spi_cache_bios_region(), fast_spi_ext_bios_cache_range(), intel_txt_prepare_bios_acm(), lpc_open_pmio_window(), and validate_acm().

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

◆ popcnt()

static int popcnt ( u32  x)
inlinestatic

Definition at line 49 of file lib.h.

References x.

Referenced by detect_num_cpus_via_mch(), and intel_txt_prepare_bios_acm().

Here is the caller graph for this function:

◆ popcnt64()

static int popcnt64 ( u64  x)
inlinestatic

Definition at line 62 of file lib.h.

References x.

◆ primitive_memtest()

int primitive_memtest ( uintptr_t  base,
uintptr_t  size 
)

Definition at line 7 of file primitive_memtest.c.

References base, BIOS_SPEW, and printk.

◆ quick_ram_check_or_die()

void quick_ram_check_or_die ( uintptr_t  dst)

Definition at line 177 of file ramtest.c.

References die(), phys_memory_barrier(), post_code, read_phys(), and write_phys().

Referenced by cbmem_top_init_once().

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

◆ ram_check()

void ram_check ( uintptr_t  start)

Definition at line 120 of file ramtest.c.

References BIOS_DEBUG, die(), printk, and ram_bitset_nodie().

Here is the call graph for this function:

◆ ram_check_nodie()

int ram_check_nodie ( uintptr_t  start)

Definition at line 134 of file ramtest.c.

References BIOS_DEBUG, printk, and ram_bitset_nodie().

Referenced by raminit().

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

◆ ram_check_noprint_nodie()

int ram_check_noprint_nodie ( uintptr_t  start)

Definition at line 149 of file ramtest.c.

References addr, phys_memory_barrier(), read_phys(), test_pattern(), value, and write_phys().

Here is the call graph for this function:

◆ ulzman()

size_t ulzman ( const void src,
size_t  srcn,
void dst,
size_t  dstn 
)

Definition at line 19 of file lzma.c.

References BIOS_WARNING, CProb, LZMA_PROPERTIES_SIZE, LZMA_RESULT_OK, LzmaDecode(), LzmaDecodeProperties(), LzmaGetNumProbs, memcpy(), and printk.

Referenced by cbfs_load_and_decompress(), decompress_kernel_header(), extract(), and load_one_segment().

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