mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Lots of polishing, organizational changes, bug fixes, error handling etc. are introduced. COPY and NEW space thread creation are allowed but not thoroughly tested yet. It seems they will work best if the lib supports utcb virtual range management through the mapping.
44 lines
883 B
C
44 lines
883 B
C
/*
|
|
* Thread control block.
|
|
*
|
|
* Copyright (C) 2009 B Labs Ltd.
|
|
*/
|
|
#ifndef __LIB_TCB_H__
|
|
#define __LIB_TCB_H__
|
|
|
|
#include <l4/lib/list.h>
|
|
|
|
/* Keeps all the struct utcb_descs belonging to a thread group together. */
|
|
struct utcb_head {
|
|
struct link list;
|
|
};
|
|
|
|
/* A simple thread control block for the thread library. */
|
|
struct tcb {
|
|
/* Task list */
|
|
struct link list;
|
|
|
|
/* Task id */
|
|
int tid;
|
|
|
|
/* Chain of utcb descriptors */
|
|
struct utcb_head *utcb_head;
|
|
|
|
/* Stack and utcb address */
|
|
unsigned long utcb_addr;
|
|
unsigned long stack_addr;
|
|
};
|
|
|
|
/* All the threads handled by the thread lib are kept in this list. */
|
|
struct global_list {
|
|
int total;
|
|
struct link list;
|
|
};
|
|
|
|
struct tcb *find_task(int tid);
|
|
struct tcb *tcb_alloc_init(struct tcb *parent, unsigned int flags);
|
|
void global_add_task(struct tcb *task);
|
|
void global_remove_task(struct tcb *task);
|
|
|
|
#endif /* __LIB_TCB_H__ */
|