mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Fixed minor issues on capability list sharing.
This commit is contained in:
@@ -19,8 +19,10 @@
|
||||
#define CAP_CONTROL_DEDUCE 0x00000006
|
||||
#define CAP_CONTROL_DESTROY 0x00000007
|
||||
|
||||
#define CAP_SHARE_MASK 0x00000003
|
||||
#define CAP_SHARE_MASK 0x0000000F
|
||||
#define CAP_SHARE_SINGLE 0x00000001
|
||||
#define CAP_SHARE_ALL_CONTAINER 0x00000002
|
||||
#define CAP_SHARE_ALL_SPACE 0x00000003
|
||||
|
||||
#define CAP_GRANT_MASK 0x0000000F
|
||||
#define CAP_GRANT_SINGLE 0x00000001
|
||||
|
||||
@@ -104,12 +104,17 @@
|
||||
|
||||
/*
|
||||
* IRQ Control capability
|
||||
*
|
||||
*/
|
||||
#define CAP_IRQCTRL_WAIT (1 << 8)
|
||||
|
||||
/*
|
||||
* This is a common one and it applies to both
|
||||
* CAP_TYPE_IRQCTRL and CAP_TYPE_MAP_PHYSMEM
|
||||
*/
|
||||
#define CAP_IRQCTRL_REGISTER (1 << 7)
|
||||
|
||||
|
||||
|
||||
/* Ipc capability */
|
||||
#define CAP_IPC_SEND (1 << 0)
|
||||
#define CAP_IPC_RECV (1 << 1)
|
||||
|
||||
@@ -55,7 +55,12 @@ static inline void cap_list_remove(struct capability *cap,
|
||||
static inline struct capability *
|
||||
cap_list_detach(struct cap_list *clist)
|
||||
{
|
||||
struct link *list = list_detach(&clist->caps);
|
||||
struct link *list;
|
||||
|
||||
if (!clist->ncaps)
|
||||
return 0;
|
||||
|
||||
list = list_detach(&clist->caps);
|
||||
clist->ncaps = 0;
|
||||
return link_to_struct(list, struct capability, list);
|
||||
}
|
||||
@@ -75,6 +80,9 @@ static inline void cap_list_attach(struct capability *cap,
|
||||
static inline void cap_list_move(struct cap_list *to,
|
||||
struct cap_list *from)
|
||||
{
|
||||
if (!from->ncaps)
|
||||
return;
|
||||
|
||||
struct capability *cap_head = cap_list_detach(from);
|
||||
cap_list_attach(cap_head, to);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ do { \
|
||||
(wqh)->sleepers++; \
|
||||
list_insert_tail(&wq.task_list, \
|
||||
&(wqh)->task_list); \
|
||||
/* printk("(%d) waiting...\n", current->tid); */\
|
||||
printk("(%d) waiting...\n", current->tid); \
|
||||
sched_prepare_sleep(); \
|
||||
spin_unlock_irq(&(wqh)->slock, irqsave); \
|
||||
schedule(); \
|
||||
|
||||
Reference in New Issue
Block a user