Barrelfish
Functions
syscall.c File Reference

Arch-generic system calls implementation. More...

Functions

errval_t sys_print (const char *str, size_t length)
 Print a string through the kernel. More...
 
struct sysret sys_retype (struct capability *root, capaddr_t source_croot, capaddr_t source_cptr, gensize_t offset, enum objtype type, gensize_t objsize, size_t count, capaddr_t dest_cspace_cptr, capaddr_t dest_cnode_cptr, uint8_t dest_cnode_level, cslot_t dest_slot, bool from_monitor)
 
struct sysret sys_copy_or_mint (struct capability *root, capaddr_t dest_cspace_cptr, capaddr_t destcn_cptr, cslot_t dest_slot, capaddr_t source_croot_ptr, capaddr_t source_cptr, uint8_t destcn_level, uint8_t source_level, uintptr_t param1, uintptr_t param2, bool mint)
 
struct sysret sys_yield (capaddr_t target)
 Yield the CPU. More...
 
struct sysret sys_suspend (bool do_halt)
 
struct sysret sys_idcap_identify (struct capability *cap, idcap_id_t *id)
 
struct sysret sys_monitor_spawn_core (hwid_t target, enum cpu_type cpu_type, genvaddr_t entry, genpaddr_t context)
 
struct sysret sys_get_absolute_time (void)
 get time elapsed (in milliseconds) since system boot.
 

Detailed Description

Arch-generic system calls implementation.

Function Documentation

struct sysret sys_copy_or_mint ( struct capability *  root,
capaddr_t  dest_cspace_cptr,
capaddr_t  destcn_cptr,
cslot_t  dest_slot,
capaddr_t  source_croot_ptr,
capaddr_t  source_cptr,
uint8_t  destcn_level,
uint8_t  source_level,
uintptr_t  param1,
uintptr_t  param2,
bool  mint 
)

Common code for copying and minting except the mint flag and param passing

Parameters
rootSource cspace root cnode
dest_cspace_cptrDestination cspace root cnode cptr in source cspace destcn_cptr Destination cnode cptr relative to destination cspace
dest_slotDestination slot
source_cptrSource capability cptr relative to source cspace
destcn_levelLevel/depth of destination cnode
source_levelLevel/depth of source cap
param1First parameter for mint
param2Second parameter for mint
mintCall is a minting operation
struct sysret sys_idcap_identify ( struct capability *  cap,
idcap_id_t *  id 
)

The format of the returned ID is:


| 0 (unused) | coreid | core_local_id |

63 39 31 0 Bit

struct sysret sys_monitor_spawn_core ( hwid_t  target,
enum cpu_type cpu_type  ,
genvaddr_t  entry,
genpaddr_t  context 
)

Calls correct handler function to spawn an app core.

At the moment spawn_core_handlers is set-up per architecture inside text_init() usually found in init.c.

Note
Generally the x86 terms of BSP and APP core are used throughout Barrelfish to distinguish between bootstrap core (BSP) and application cores (APP).
Parameters
core_idIdentifier of the core which we want to boot
cpu_typeArchitecture of the core.
entryEntry point for code to start execution.
Return values
SYS_ERR_OKCore successfully booted.
SYS_ERR_ARCHITECTURE_NOT_SUPPORTEDNo handler registered for the specified cpu_type.
SYS_ERR_CORE_NOT_FOUNDCore failed to boot.
errval_t sys_print ( const char *  string,
size_t  length 
)

Print a string through the kernel.

This calls SYSCALL_PRINT to print 'string' of length 'length' through the kernel. Whether and where 'string' is printed is determined by the kernel.

Parameters
stringPointer to string to print.
lengthLength of string.
Returns
Syscall error code (#SYS_ERR_OK on success).
struct sysret sys_retype ( struct capability *  root,
capaddr_t  source_croot,
capaddr_t  source_cptr,
gensize_t  offset,
enum objtype  type,
gensize_t  objsize,
size_t  count,
capaddr_t  dest_cspace_cptr,
capaddr_t  dest_cnode_cptr,
uint8_t  dest_cnode_level,
cslot_t  dest_slot,
bool  from_monitor 
)
Parameters
rootSource CSpace root cnode to invoke
source_crootSource capability cspace root
source_cptrSource capability cptr
offsetOffset into source capability from which to retype
typeType to retype to
objsizeObject size for variable-sized types
countnumber of objects to create
dest_cspace_cptrDestination CSpace cnode cptr relative to source cspace root
dest_cnode_cptrDestination cnode cptr
dest_slotDestination slot number
dest_cnode_levelLevel/depth of destination cnode
struct sysret sys_suspend ( bool  halt)

Suspend the current cpu

struct sysret sys_yield ( capaddr_t  target)

Yield the CPU.

Yields the remainder of the time-slice for this dispatcher to the next runnable dispatcher.

Parameters
targetDispatcher to yield to, or CPTR_NULL for an undirected yield
Returns
Syscall error code (#SYS_ERR_OK on success).