Barrelfish
Functions
cap_predicates.h File Reference

Kernel capability predicates (to be generated by Hamlet). More...

Functions

bool is_ancestor (struct capability *, struct capability *)
 Returns true if parent is an ancestor of child or maybe a copy of child. More...
 
bool is_copy (struct capability *, struct capability *)
 Check if the capabilities are copies of each other. More...
 

Detailed Description

Kernel capability predicates (to be generated by Hamlet).

Function Documentation

bool is_ancestor ( struct capability *  ,
struct capability *   
)

Returns true if parent is an ancestor of child or maybe a copy of child.

The functionality is strange because Hamlet doesn't have enough knowledge. A ram cap can be an ancestor of a frame cap and refer to exactly the same range of memory. This is not true for two ram caps, they are copies and not ancestors. Hamlet fails this when checking for caps of same types that can be retyped into each other. For such caps, it will return true even though they are copies and do not have a parent-child relationship.

bool is_copy ( struct capability *  ,
struct capability *   
)

Check if the capabilities are copies of each other.

The type of the cap determines how to check for copies. Under certain instances of retype, this code may report parent/child as copies.