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

@@ -208,6 +208,16 @@ int read_pager_capabilities()
BUG();
}
/* Share all of them with paged children */
if ((err = l4_capability_control(CAP_CONTROL_SHARE,
CAP_SHARE_CHILD,
0)) < 0) {
printf("l4_capability_control() sharing of "
"capabilities failed.\n Could not "
"complete CAP_CONTROL_SHARE request.\n");
BUG();
}
/* Copy them to real allocated structures */
copy_boot_capabilities(ncaps);

View File

@@ -357,8 +357,10 @@ struct tcb *task_create(struct tcb *parent, struct task_ids *ids,
ids->tgid = parent->tgid;
}
/* Create the thread structures and address space */
if ((err = l4_thread_control(THREAD_CREATE | ctrl_flags, ids)) < 0) {
/* Create the thread structures and address space as the pager */
if ((err = l4_thread_control(THREAD_CREATE |
TC_AS_PAGER |
ctrl_flags, ids)) < 0) {
printf("l4_thread_control failed with %d.\n", err);
return PTR_ERR(err);
}

View File

@@ -232,7 +232,8 @@ int simple_pager_thread(void *arg)
}
/* Destroy thread we created */
if (err == 0 && res == 0)
if (err == 0 &&
res == 0)
l4_thread_control(THREAD_DESTROY, &ids);
result = testres;