Barrelfish
Macros | Functions | Variables
startup.c File Reference

Architecture-independent bootstrap code. More...

Macros

#define CNODE(cte)   get_address(&(cte)->cap)
 Quick way to find the base address of a cnode capability.
 

Functions

errval_t create_caps_to_cnode (lpaddr_t base_addr, size_t size, enum region_type type, struct spawn_state *st, struct bootinfo *bootinfo)
 Create caps in 'cnode'. More...
 
lpaddr_t app_alloc_phys (size_t size)
 
lpaddr_t bsp_alloc_phys (size_t size)
 Linear physical memory allocator. More...
 

Variables

struct kcbkcb_current = NULL
 flag that indicates whether kcb scheduling should happen
 
lpaddr_t bsp_init_alloc_addr = 0
 

Detailed Description

Architecture-independent bootstrap code.

Function Documentation

lpaddr_t app_alloc_phys ( size_t  size)

Allocate physical memory during kernel startup for application cores. Allocations are always rounded up to multiple pages.

Parameters
sizeThe number of bytes to allocate.
Returns
An lpaddr to the newly allocated physical memory.
lpaddr_t bsp_alloc_phys ( size_t  size)

Linear physical memory allocator.

This function allocates a linear region of addresses of size 'size' from physical memory.

Parameters
sizeNumber of bytes to allocate.
Returns
Base physical address of memory region.
errval_t create_caps_to_cnode ( lpaddr_t  base_addr,
size_t  size,
enum region_type  type,
struct spawn_state *  st,
struct bootinfo bootinfo 
)

Create caps in 'cnode'.

This function creates untyped caps to the RAM at physical address 'base_addr' and size 'size' and adds them to a cnode for the init task. The bootinfo is updated accordingly.

Parameters
base_addrThe physical base address of the RAM for which caps have to be created
sizeThe size of the physical region
typeRegion type to create
stspawn_state structure to update
bootinfobootinfo structure to update

Variable Documentation

lpaddr_t bsp_init_alloc_addr = 0

The address from where bsp_alloc_phys will start allocating memory