Added sharing of pager capabilities with children or siblings

Pagers can now share their own private capabilities with their
paged children, or their siblings with whom they have a common pager
ancestor.

Added flags CAP_SHARE_CHILD and CAP_SHARE_SIBLINGS for that.
This commit is contained in:
Bahadir Balban
2009-10-23 13:50:32 +03:00
parent f4c9ea50bc
commit 6093214981
10 changed files with 73 additions and 23 deletions

View File

@@ -81,7 +81,7 @@ struct capability *capability_find_by_rtype(struct ktcb *task,
unsigned int rtype)
{
struct capability *cap;
struct ktcb *tgleader;
struct ktcb *tgleader, *pager;
/* Search task's own list */
list_foreach_struct(cap, &task->cap_list.caps, list)
@@ -97,7 +97,15 @@ struct capability *capability_find_by_rtype(struct ktcb *task,
BUG_ON(!(tgleader = tcb_find(task->tgid)));
/* Search thread group list */
list_foreach_struct(cap, &tgleader->tgr_cap_list.caps, list)
list_foreach_struct(cap, &tgleader->tgroup_cap_list.caps, list)
if (cap_rtype(cap) == rtype)
return cap;
/* Find pager */
BUG_ON(!(pager = tcb_find(task->pagerid)));
/* Search pager's paged-children capability list */
list_foreach_struct(cap, &pager->pager_cap_list.caps, list)
if (cap_rtype(cap) == rtype)
return cap;

View File

@@ -31,7 +31,7 @@ void tcb_init(struct ktcb *new)
mutex_init(&new->thread_control_lock);
cap_list_init(&new->cap_list);
cap_list_init(&new->tgr_cap_list);
cap_list_init(&new->tgroup_cap_list);
cap_list_init(&new->pager_cap_list);
/* Initialise task's scheduling state and parameters. */