mirror of
https://github.com/drasko/codezero.git
synced 2026-02-06 06:53:18 +01:00
Capability replicate/split/destroy/grant working for test0 ipc.
Implemented a protocol between a client and its pager to request and get a capability to ipc to another client of the pager. Pager first ensures the request is valid from its client. It then tries to use a greater capability that it possesses, to produce a new capability that the client requested. Once the kernel validates the correct one and replicates/reduces it to client's need, it grants it to the client.
This commit is contained in:
@@ -99,6 +99,13 @@ static inline void cap_list_insert(struct capability *cap,
|
||||
clist->ncaps++;
|
||||
}
|
||||
|
||||
static inline void cap_list_remove(struct capability *cap,
|
||||
struct cap_list *clist)
|
||||
{
|
||||
list_remove(&cap->list);
|
||||
clist->ncaps--;
|
||||
}
|
||||
|
||||
/* Detach a whole list of capabilities from list head */
|
||||
static inline struct capability *
|
||||
cap_list_detach(struct cap_list *clist)
|
||||
@@ -141,6 +148,8 @@ struct capability *cap_list_find_by_rtype(struct cap_list *clist,
|
||||
unsigned int rtype);
|
||||
struct capability *cap_find_byid(l4id_t capid);
|
||||
|
||||
int cap_find_destroy(l4id_t capid);
|
||||
|
||||
/* Capability checking on system calls */
|
||||
int cap_map_check(struct ktcb *task, unsigned long phys, unsigned long virt,
|
||||
unsigned long npages, unsigned int flags);
|
||||
|
||||
Reference in New Issue
Block a user