mirror of
https://github.com/drasko/codezero.git
synced 2026-01-17 13:23:16 +01:00
Capabilities for quantitative resources working.
Status: - Capability initialization is a bit hacky with dummy current etc. - All container caps belong to the pager - Tasks refer to their pager's capabilities for mutex allocation - Hacky. - Kernel container keeps quantitative caps and memory caps in separate lists - Hacky. These will all evolve and get fixed.
This commit is contained in:
@@ -256,17 +256,6 @@ int init_first_pager(struct pager *pager,
|
||||
{
|
||||
struct ktcb *task;
|
||||
struct address_space *space;
|
||||
struct capability *ktcb_cap;
|
||||
|
||||
/*
|
||||
* Find capability from pager's list, since
|
||||
* there is no ktcb, no standard path to check
|
||||
* per-task capability list yet.
|
||||
*/
|
||||
ktcb_cap = capability_find_by_rtype(&pager->cap_list,
|
||||
CAP_RTYPE_THREADPOOL);
|
||||
/* Use it to allocate ktcb */
|
||||
task = tcb_alloc_init_use_capability(ktcb_cap);
|
||||
|
||||
/*
|
||||
* Initialize dummy current capability list pointer
|
||||
@@ -274,6 +263,14 @@ int init_first_pager(struct pager *pager,
|
||||
*/
|
||||
current->cap_list_ptr = &pager->cap_list;
|
||||
|
||||
/*
|
||||
* Find capability from pager's list, since
|
||||
* there is no ktcb, no standard path to check
|
||||
* per-task capability list yet.
|
||||
*/
|
||||
/* Use it to allocate ktcb */
|
||||
task = tcb_alloc_init();
|
||||
|
||||
/* Initialize ktcb */
|
||||
task_init_registers(task, pager->start_vma);
|
||||
task_setup_utcb(task, pager);
|
||||
@@ -331,18 +328,6 @@ int init_first_pager(struct pager *pager,
|
||||
int init_pager(struct pager *pager, struct container *cont)
|
||||
{
|
||||
struct ktcb *task;
|
||||
struct capability *ktcb_cap;
|
||||
|
||||
/*
|
||||
* Find capability from pager's list, since
|
||||
* there is no ktcb, no standard path to check
|
||||
* per-task capability list yet.
|
||||
*/
|
||||
ktcb_cap = capability_find_by_rtype(&pager->cap_list,
|
||||
CAP_RTYPE_THREADPOOL);
|
||||
|
||||
/* Use it to allocate ktcb */
|
||||
task = tcb_alloc_init_use_capability(ktcb_cap);
|
||||
|
||||
/*
|
||||
* Initialize dummy current capability list pointer
|
||||
@@ -350,6 +335,9 @@ int init_pager(struct pager *pager, struct container *cont)
|
||||
*/
|
||||
current->cap_list_ptr = &pager->cap_list;
|
||||
|
||||
/* Use it to allocate ktcb */
|
||||
task = tcb_alloc_init();
|
||||
|
||||
task_init_registers(task, pager->start_vma);
|
||||
|
||||
task_setup_utcb(task, pager);
|
||||
|
||||
Reference in New Issue
Block a user