mirror of
https://github.com/drasko/codezero.git
synced 2026-02-07 15:33:16 +01:00
Added means to search for threads in other containers
Thread ids now contain their container ids in the top 2 nibbles. Threads on other containers can be addressed by changing those two nibbles. The addressing of inter-container threads are subject to capabilities.
This commit is contained in:
@@ -107,6 +107,7 @@ int container_init_pagers(struct kernel_resources *kres,
|
||||
pgd_table_t *current_pgd);
|
||||
|
||||
int init_containers(struct kernel_resources *kres);
|
||||
struct container *container_find(struct kernel_resources *kres, l4id_t cid);
|
||||
|
||||
#endif /* __CONTAINER_H__ */
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ struct boot_resources {
|
||||
struct container_head {
|
||||
int ncont;
|
||||
struct link list;
|
||||
struct spinlock lock;
|
||||
};
|
||||
|
||||
static inline void
|
||||
@@ -39,6 +40,7 @@ container_head_init(struct container_head *chead)
|
||||
{
|
||||
chead->ncont = 0;
|
||||
link_init(&chead->list);
|
||||
spin_lock_init(&chead->lock);
|
||||
}
|
||||
|
||||
/* Hash table for all existing tasks */
|
||||
|
||||
@@ -41,6 +41,12 @@ enum task_state {
|
||||
|
||||
#define TASK_CID_MASK 0xFF000000
|
||||
#define TASK_ID_MASK 0x00FFFFFF
|
||||
#define TASK_CID_SHIFT 24
|
||||
|
||||
static inline l4id_t tid_to_cid(l4id_t tid)
|
||||
{
|
||||
return (tid & TASK_CID_MASK) >> TASK_CID_SHIFT;
|
||||
}
|
||||
|
||||
static inline int task_id_special(l4id_t id)
|
||||
{
|
||||
@@ -53,7 +59,6 @@ struct task_ids {
|
||||
l4id_t tid;
|
||||
l4id_t spid;
|
||||
l4id_t tgid;
|
||||
l4id_t cid;
|
||||
};
|
||||
|
||||
struct container;
|
||||
@@ -166,7 +171,7 @@ void tcb_add(struct ktcb *tcb);
|
||||
void tcb_remove(struct ktcb *tcb);
|
||||
|
||||
void tcb_init(struct ktcb *tcb);
|
||||
struct ktcb *tcb_alloc_init(void);
|
||||
struct ktcb *tcb_alloc_init(l4id_t cid);
|
||||
void tcb_delete(struct ktcb *tcb);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user