Barrelfish
Data Structures | Functions
capabilities.h File Reference

Kernel capability management. More...

Data Structures

struct  cte
 A CTE (Capability Table Entry). More...
 

Functions

errval_t caps_create_new (enum objtype type, lpaddr_t addr, size_t bits, size_t objbits, coreid_t owner, struct cte *caps)
 
errval_t caps_create_from_existing (struct capability *root, capaddr_t cnode_cptr, int cnode_vbits, cslot_t dest_slot, coreid_t owner, struct capability *src)
 Create a capability from an existing capability metadata. More...
 
errval_t caps_copy_to_cnode (struct cte *dest_cnode_cte, cslot_t dest_slot, struct cte *src_cte, bool mint, uintptr_t param1, uintptr_t param2)
 Create copies to a slot within a cnode.
 
errval_t caps_copy_to_vnode (struct cte *dest_vnode_cte, cslot_t dest_slot, struct cte *src_cte, uintptr_t flags, uintptr_t offset, uintptr_t pte_count, struct cte *mapping_cte)
 Create page mappings.
 
errval_t page_mappings_modify_flags (struct capability *mapping, size_t offset, size_t pages, size_t mflags, genvaddr_t va_hint)
 modify flags of mapping mapping. More...
 
errval_t caps_retype (enum objtype type, gensize_t objsize, size_t count, struct capability *dest_cnode, cslot_t dest_slot, struct cte *src_cte, gensize_t offset, bool from_monitor)
 
errval_t is_retypeable (struct cte *src_cte, enum objtype src_type, enum objtype dest_type, bool from_monitor)
 Check the validity of a retype operation.
 
errval_t caps_lookup_cap (struct capability *cnode_cap, capaddr_t cptr, uint8_t level, struct capability **ret, CapRights rights)
 
errval_t caps_lookup_slot (struct capability *rootcn, capaddr_t cptr, uint8_t level, struct cte **ret, CapRights rights)
 
errval_t caps_delete_last (struct cte *cte, struct cte *ret_ram_cap)
 Delete the last copy of a cap in the entire system. More...
 
errval_t caps_delete_foreigns (struct cte *cte)
 Delete all copies of a foreign cap.
 
errval_t caps_mark_revoke (struct capability *base, struct cte *revoked)
 Mark capabilities for a revoke operation. More...
 

Detailed Description

Kernel capability management.

Function Documentation

errval_t caps_create_from_existing ( struct capability *  root,
capaddr_t  cnode_cptr,
int  cnode_level,
cslot_t  dest_slot,
coreid_t  owner,
struct capability *  src 
)

Create a capability from an existing capability metadata.

Used when sending capabilities across cores. The metadata is sent across cores and the receiving monitor can create the new capability on its core.

errval_t caps_create_new ( enum objtype  type,
lpaddr_t  addr,
size_t  bytes,
size_t  objsize,
coreid_t  owner,
struct cte caps 
)

Create caps to new kernel objects. This takes the size of the memory region in bytes, and the size of individual objects in bytes. The following needs to hold: bytes % objbytes == 0

errval_t caps_delete_last ( struct cte cte,
struct cte ret_ram_cap 
)

Delete the last copy of a cap in the entire system.

errval_t caps_lookup_cap ( struct capability *  cnode_cap,
capaddr_t  cptr,
uint8_t  level,
struct capability **  ret,
CapRights  rights 
)

Wrapper for caps_lookup_slot returning capability instead of cte.

errval_t caps_lookup_slot ( struct capability *  rootcn,
capaddr_t  cptr,
uint8_t  level,
struct cte **  ret,
CapRights  rights 
)

Look up a capability in two-level cspace rooted at rootcn.

errval_t caps_mark_revoke ( struct capability *  base,
struct cte revoked 
)

Mark capabilities for a revoke operation.

Parameters
baseThe data for the capability being revoked
revokedThe revoke target if it is on this core. This specific capability copy will not be marked. If supplied, is_copy(base, &revoked->cap) must hold.
Returns
  • CAP_NOT_FOUND if no copies or desendants are present on this core.
  • SYS_ERR_OK otherwise.
errval_t caps_retype ( enum objtype  type,
gensize_t  objsize,
size_t  count,
struct capability *  dest_cnode,
cslot_t  dest_slot,
struct cte src_cte,
gensize_t  offset,
bool  from_monitor 
)

Retype caps Create count new caps of type from offset in src, and put them in dest_cnode starting at dest_slot.

errval_t page_mappings_modify_flags ( struct capability *  mapping,
size_t  offset,
size_t  pages,
size_t  mflags,
genvaddr_t  va_hint 
)

modify flags of mapping mapping.

  • mapping the mapping to modify
  • offset the offset from the first page table entry in entries
  • pages the number of pages to modify
  • mflags the new flags
  • va_hint a user-supplied virtual address for hinting selective TLB flushing