mirror of
https://github.com/drasko/codezero.git
synced 2026-04-02 01:59:05 +02:00
Kernel updates since December 2009
This commit is contained in:
@@ -28,15 +28,20 @@
|
||||
#define TASK_INTERRUPTED (1 << 0)
|
||||
#define TASK_SUSPENDING (1 << 1)
|
||||
#define TASK_RESUMING (1 << 2)
|
||||
#define TASK_EXITING (1 << 3)
|
||||
#define TASK_PENDING_SIGNAL (TASK_SUSPENDING | TASK_EXITING)
|
||||
#define TASK_PENDING_SIGNAL (TASK_SUSPENDING)
|
||||
|
||||
/*
|
||||
* This is to indicate a task (either current or one of
|
||||
* its children) exit has occured and cleanup needs to be
|
||||
* called
|
||||
*/
|
||||
#define TASK_EXITED (1 << 3)
|
||||
|
||||
/* Task states */
|
||||
enum task_state {
|
||||
TASK_INACTIVE = 0,
|
||||
TASK_SLEEPING = 1,
|
||||
TASK_RUNNABLE = 2,
|
||||
TASK_DEAD = 3,
|
||||
};
|
||||
|
||||
#define TASK_CID_MASK 0xFF000000
|
||||
@@ -82,6 +87,9 @@ struct ktcb {
|
||||
l4id_t tid; /* Global thread id */
|
||||
l4id_t tgid; /* Global thread group id */
|
||||
|
||||
/* CPU affinity */
|
||||
int affinity;
|
||||
|
||||
/* Other related threads */
|
||||
l4id_t pagerid;
|
||||
|
||||
@@ -94,6 +102,9 @@ struct ktcb {
|
||||
/* Lock for blocking thread state modifications via a syscall */
|
||||
struct mutex thread_control_lock;
|
||||
|
||||
/* To protect against thread deletion/modification */
|
||||
struct spinlock thread_lock;
|
||||
|
||||
u32 ts_need_resched; /* Scheduling flag */
|
||||
enum task_state state;
|
||||
|
||||
@@ -171,13 +182,14 @@ static inline void set_task_ids(struct ktcb *task, struct task_ids *ids)
|
||||
}
|
||||
|
||||
struct ktcb *tcb_find(l4id_t tid);
|
||||
struct ktcb *tcb_find_lock(l4id_t tid);
|
||||
void tcb_add(struct ktcb *tcb);
|
||||
void tcb_remove(struct ktcb *tcb);
|
||||
|
||||
void tcb_init(struct ktcb *tcb);
|
||||
struct ktcb *tcb_alloc_init(l4id_t cid);
|
||||
void tcb_delete(struct ktcb *tcb);
|
||||
|
||||
void tcb_delete_zombies(void);
|
||||
|
||||
void ktcb_list_remove(struct ktcb *task, struct ktcb_list *ktcb_list);
|
||||
void ktcb_list_add(struct ktcb *new, struct ktcb_list *ktcb_list);
|
||||
|
||||
Reference in New Issue
Block a user