Barrelfish
Functions | Variables
spawn.c File Reference

functionality to spawn domains More...

Functions

errval_t spawn_get_cmdline_args (struct mem_region *module, char **retargs)
 Retrive the commandline args of #name. More...
 
int spawn_tokenize_cmdargs (char *s, char *argv[], size_t argv_len)
 Returns tokenized cmdline args. More...
 
errval_t spawn_load_image (struct spawninfo *si, lvaddr_t binary, size_t binary_size, enum cpu_type type, const char *name, coreid_t coreid, char *const argv[], char *const envp[], struct capref inheritcn_cap, struct capref argcn_cap)
 Load an image. More...
 
errval_t spawn_load_with_args (struct spawninfo *si, struct mem_region *module, const char *name, coreid_t coreid, char *const argv[], char *const envp[])
 Spawn a domain with the given args.
 
errval_t spawn_load_with_bootinfo (struct spawninfo *si, struct bootinfo *bi, const char *name, coreid_t coreid)
 Spawn a domain and give it the bootinfo struct. Just monitor and memserv should be spawned using this.
 
errval_t spawn_span_domain (struct spawninfo *si, struct capref vroot, struct capref disp_frame)
 Span a domain with the given vroot and disp_frame. More...
 

Variables

char ** environ
 

Detailed Description

functionality to spawn domains

Function Documentation

errval_t spawn_get_cmdline_args ( struct mem_region module,
char **  retargs 
)

Retrive the commandline args of #name.

The arguments are malloced into a new space so need to be freed after use

errval_t spawn_load_image ( struct spawninfo si,
lvaddr_t  binary,
size_t  binary_size,
enum cpu_type  type,
const char *  name,
coreid_t  coreid,
char *const  argv[],
char *const  envp[],
struct capref  inheritcn_cap,
struct capref  argcn_cap 
)

Load an image.

Parameters
siStruct used by the library
binaryThe image to load
typeThe type of arch to load for
nameName of the image required only to place it in disp struct
coreidCoreid to load for, required only to place it in disp struct
argvCommand-line arguments, NULL-terminated
envpEnvironment, NULL-terminated
inheritcn_capCap to a CNode containing capabilities to be inherited
argcn_capCap to a CNode containing capabilities passed as arguments
errval_t spawn_span_domain ( struct spawninfo si,
struct capref  vroot,
struct capref  disp_frame 
)

Span a domain with the given vroot and disp_frame.

Operation similar to spawning a domain but the vroot and disp_frame are already provided

int spawn_tokenize_cmdargs ( char *  s,
char *  argv[],
size_t  argv_len 
)

Returns tokenized cmdline args.

Parameters
sArgument string, which is modified in place
argvArray to be filled-in with arguments
argv_lenLength of array available in argv, including terminator

The arguments are placed in #argv, which is NULL-terminated

Returns
Number of arguments, not including terminator

Variable Documentation

char** environ

Environment as a pointer to a pointer rather than a pointer to an array.