Commit fa7aec8c authored by Muktesh Khole's avatar Muktesh Khole Committed by Vikram Narayanan
Browse files

start implementing lcd_update_cdt

parent 8fa32a9b
......@@ -263,6 +263,8 @@ cap_id lcd_create_cap(void * ptcb, void * hobject, lcd_cap_rights crights)
cap->cap.crights = crights;
cap->cap.hobject = hobject;
cap->cap.cdt_list = NULL;
cap->cap.parent_cid = 0;
cap->cap.parent_tcb = NULL;
up(&(cspace->sem_cspace));
return cid;
}
......@@ -300,15 +302,16 @@ cap_id lcd_cap_grant(void *src_tcb, cap_id src_cid, void * dst_tcb, lcd_cap_righ
dst_cte->cap.crights = crights;
dst_cte->cap.hobject = src_cte->cap.hobject;
dst_cte->cap.cdt_list = NULL;
dst_cte->cap.parent_cid = src_cid;
dst_cte->cap.parent_tcb = src_tcb;
// update the CDT of source
cdt_node = kmalloc(sizeof(struct cap_derivation_list), GFP_KERNEL);
if (cdt_node != NULL)
{
cdt_node->next = src_cte->cap.cdt_list;
src_cte->cap.cdt_list = cdt_node;
cdt_node->remote_cid = cid;
cdt_node->remote_TCB = dst_tcb;
cdt_node->child_cid = cid;
cdt_node->child_TCB = dst_tcb;
}
else
{
......
......@@ -77,8 +77,8 @@ enum {
struct cap_derivation_list
{
void *remote_TCB; // reference to the thread which was granted this capability
cap_id remote_cid; // address in the remote threads capability space where this
void *child_TCB; // reference to the thread which was granted this capability
cap_id child_cid; // address in the remote threads capability space where this
// capability is stored.
struct cap_derivation_list *next;
};
......@@ -93,6 +93,8 @@ struct capability_internal
void *hobject; // a pointer to a kernel object
struct cap_derivation_list *cdt_list; // list of domain ids to whom this capability is granted
lcd_cap_rights crights; // specifies the rights the domain has over this capability
void *parent_tcb;
cap_id parent_cid;
};
struct cte;
......@@ -213,6 +215,11 @@ uint32_t lcd_cap_delete(void * ptcb, cap_id cid);
// a capability which is its child or was derieved from it.
uint32_t lcd_cap_revoke(void * ptcb, cap_id cid);
// should be called when the thread exits.
// this is extremely heavy function which updates the CDT for all capabilities present
// in the cspace of the exiting thread.
void lcd_update_cdt(void *ptcb);
// will be used to get the rights available with a capability.
uint32_t lcd_get_cap_rights(void * ptcb, cap_id cid, lcd_cap_rights *rights);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment