1 /* 2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _SYSTEM_THREAD_DEFS_H 6 #define _SYSTEM_THREAD_DEFS_H 7 8 #include <OS.h> 9 10 11 #define THREAD_RETURN_EXIT 0x1 12 #define THREAD_RETURN_INTERRUPTED 0x2 13 #define THREAD_STOPPED 0x3 14 #define THREAD_CONTINUED 0x4 15 16 /** Size of the stack given to teams in user space */ 17 #define USER_MAIN_THREAD_STACK_SIZE (16 * 1024 * 1024) // 16 MB 18 #define USER_STACK_SIZE (256 * 1024) // 256 kB 19 #define MIN_USER_STACK_SIZE (4 * 1024) // 4 KB 20 #define MAX_USER_STACK_SIZE (16 * 1024 * 1024) // 16 MB 21 #define USER_STACK_GUARD_PAGES 4 // 16 kB 22 23 24 struct thread_creation_attributes { 25 int32 (*entry)(thread_func, void *); 26 const char* name; 27 int32 priority; 28 void* args1; 29 void* args2; 30 void* stack_address; 31 size_t stack_size; 32 33 // when calling from kernel only 34 team_id team; 35 thread_id thread; 36 }; 37 38 #endif /* _SYSTEM_THREAD_DEFS_H */ 39