mirror of
https://github.com/drasko/codezero.git
synced 2026-01-14 20:03:16 +01:00
Added support for faulty pagers and their threads to become zombies
Added support for pagers that fault to suspend and become zombies along with all the threads that they manage. Zombie killing is to be done at a later time, from this special zombie queue. The implementation works same as a suspension, with the added action that the thread is moved to a queue in kernel container.
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
#define __RESOURCES_H__
|
||||
|
||||
/* Number of containers defined at compile-time */
|
||||
#include <l4/config.h>
|
||||
|
||||
#include <l4/generic/capability.h>
|
||||
#include <l4/lib/idpool.h>
|
||||
#include INC_SUBARCH(mm.h)
|
||||
@@ -41,6 +39,13 @@ container_head_init(struct container_head *chead)
|
||||
link_init(&chead->list);
|
||||
}
|
||||
|
||||
/* Hash table for all existing tasks */
|
||||
struct ktcb_list {
|
||||
struct link list;
|
||||
struct spinlock list_lock;
|
||||
int count;
|
||||
};
|
||||
|
||||
/*
|
||||
* Everything on the platform is described and stored
|
||||
* in the structure below.
|
||||
@@ -81,6 +86,9 @@ struct kernel_container {
|
||||
struct mem_cache *mutex_cache;
|
||||
struct mem_cache *cap_cache;
|
||||
struct mem_cache *cont_cache;
|
||||
|
||||
/* Zombie thread list */
|
||||
struct ktcb_list zombie_list;
|
||||
};
|
||||
|
||||
extern struct kernel_container kernel_container;
|
||||
|
||||
@@ -133,13 +133,6 @@ union ktcb_union {
|
||||
char kstack[PAGE_SIZE];
|
||||
};
|
||||
|
||||
/* Hash table for all existing tasks */
|
||||
struct ktcb_list {
|
||||
struct link list;
|
||||
struct spinlock list_lock;
|
||||
int count;
|
||||
};
|
||||
|
||||
/*
|
||||
* Each task is allocated a unique global id. A thread group can only belong to
|
||||
* a single leader, and every thread can only belong to a single thread group.
|
||||
@@ -161,6 +154,8 @@ void tcb_init(struct ktcb *tcb);
|
||||
struct ktcb *tcb_alloc_init(void);
|
||||
void tcb_delete(struct ktcb *tcb);
|
||||
|
||||
|
||||
void ktcb_list_add(struct ktcb *new, struct ktcb_list *ktcb_list);
|
||||
void init_ktcb_list(struct ktcb_list *ktcb_list);
|
||||
void task_update_utcb(struct ktcb *task);
|
||||
int tcb_check_and_lazy_map_utcb(struct ktcb *task);
|
||||
|
||||
@@ -11,7 +11,8 @@ void thread_id_pool_init(void);
|
||||
int thread_id_new(void);
|
||||
int thread_id_del(int tid);
|
||||
|
||||
void thread_destroy_self(void);
|
||||
void thread_destroy_current(void);
|
||||
int thread_destroy(struct task_ids *ids);
|
||||
void thread_make_zombie(struct ktcb *task);
|
||||
|
||||
#endif /* __THREAD_H__ */
|
||||
|
||||
Reference in New Issue
Block a user