summaryrefslogtreecommitdiff
path: root/src/kernel/task/task.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/task/task.h')
-rw-r--r--src/kernel/task/task.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/kernel/task/task.h b/src/kernel/task/task.h
index fdffa11..63cb35a 100644
--- a/src/kernel/task/task.h
+++ b/src/kernel/task/task.h
@@ -8,17 +8,15 @@
#define TS_RUNNING 0
#define TS_WAKEWAIT 2 //Waiting to be waked up by something precise (thread currently blocked)
-#define PL_UNKNOWN 4
-#define PL_USER 3
-#define PL_SERVICE 2
-#define PL_DRIVER 1
+#define PL_UNKNOWN 2
+#define PL_USER 1
#define PL_KERNEL 0
#define EX_TH_NORMAL 0x10000 //ERROR code : just one thread exits, because it has to
#define EX_TH_EXCEPTION 0x10001 //ERROR code : just one thread exits, because of an unhandled exception
#define EX_PR_EXCEPTION 0x10002 //ERROR code : all process finishes, because of an unhandled exception
-#define USER_STACK_SIZE 0x8000 //32k, but pages will be mapped one by one as used
+#define USER_STACK_SIZE 0x10000 //64k, but pages will be mapped one by one as they are used
typedef void (*thread_entry)(void*);
@@ -26,9 +24,9 @@ struct process {
uint32_t pid, uid, privilege, thread_count;
struct process *parent;
struct page_directory *pagedir;
- size_t stack;
+ size_t stack, data;
- struct segment_map *heapseg;
+ struct segment_map *dataseg;
struct process *next; //Forms a linked list
struct thread *threads;
@@ -48,7 +46,7 @@ struct thread {
extern struct thread *current_thread;
void tasking_init();
-void tasking_switch();
+void schedule();
void tasking_updateKernelPagetable(uint32_t idx, struct page_table *table, uint32_t tablePhysical);
uint32_t tasking_handleException(struct registers *regs);
@@ -59,7 +57,8 @@ struct thread * thread_new(struct process *proc, thread_entry entry_point, void
struct process* process_new(struct process *parent, uint32_t uid, uint32_t privilege);
void thread_exit(); //syscall
-void process_exit(uint32_t retval); //syscall
-int process_setheapseg(size_t start, size_t end); //syscall
+void process_exit(size_t retval); //syscall
+size_t process_sbrk(size_t size);
+void process_brk(size_t ptr);
#endif