diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-17 16:40:56 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-17 16:40:56 +0200 |
commit | 9520a1a101b264abe700c3f7753f5f55bba4c681 (patch) | |
tree | 2d73552c689c4de39b28c0e9930bc135b199a273 /Source/Kernel/TaskManager/Thread.class.h | |
parent | 45fcf4cc7ddacd93df2dd4d88ad31f6061e8d4a8 (diff) | |
download | Melon-9520a1a101b264abe700c3f7753f5f55bba4c681.tar.gz Melon-9520a1a101b264abe700c3f7753f5f55bba4c681.zip |
Each thread now has a kernel stack and an user stack
Diffstat (limited to 'Source/Kernel/TaskManager/Thread.class.h')
-rw-r--r-- | Source/Kernel/TaskManager/Thread.class.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Kernel/TaskManager/Thread.class.h b/Source/Kernel/TaskManager/Thread.class.h index 369f62f..9c8fa26 100644 --- a/Source/Kernel/TaskManager/Thread.class.h +++ b/Source/Kernel/TaskManager/Thread.class.h @@ -13,6 +13,7 @@ typedef u32int(*thread_entry_t)(void*); class Thread { friend class Process; //This might be useful + friend void runThread(Thread*, void*, thread_entry_t); private: Thread(); //Creates a thread without initializing anything. Used by Process::createKernel(); @@ -27,9 +28,12 @@ class Thread { } waitfor; bool m_isKernel; //Says if stack is in kernel pagedir, and if thread should run in ring 0 - u32int m_kernelStackFrame; //Used for allocating and freeing a frame used as a stack + struct { + void* addr; + u32int size; + } m_userStack, m_kernelStack; - void setup(thread_entry_t entry_point, void* data, u32int esp); //Sets up stack, called by both constructors + void setup(Process* process, thread_entry_t entry_point, void* data, bool isKernel); public: Thread(thread_entry_t entry_point, void* data, bool iskernel = false); //Assumes process is current process, or is kprocess if isk |