mirror of
https://github.com/drasko/codezero.git
synced 2026-02-06 23:13:15 +01:00
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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user