3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 /* jmp_buf (E)IP and (E)SP register names for various environments:
31 Tinylib TurboC DJGPP Linux (glibc5) */
32 #define JMPBUF_IP eip /* j_ip __eip __pc */
33 #define JMPBUF_SP esp /* j_sp __esp __sp */
34 #define JMPBUF_FLAGS eflags /* j_flag __eflags ? */
37 #define USER_STACK_SIZE 10240
41 #define USER_STACK_SIZE 8192
45 typedef struct task_context
{
46 struct task_context
*next
, *prev
;
49 unsigned char stacks
[USER_STACK_SIZE
];
57 unsigned char priority
;
63 page_ent_t
*page_cover
;
66 TS_NULL
= 0, TS_RUNNABLE
= 1, TS_BLOCKED
= 2, TS_ZOMBIE
= 3
71 extern task_t
*_curr_task
;
72 extern task_t
*task_create (char *name
, unsigned entry
, unsigned priority
);
73 extern bool task_done (task_t
*task
);
74 extern task_t
*task_find (unsigned short id
);