00001 /* header file for src/arch/x86/context.cpp */ 00002 00003 #ifndef _CORE_ARCH_X86_CONTEXT_HPP 00004 #define _CORE_ARCH_X86_CONTEXT_HPP 00005 00006 //necessary includes 00007 #include "src/arch/x86/gdt.hpp" 00008 00009 namespace Thread { 00010 const uint32 TSP_SIZE = 0x100; 00011 } /*namespace Thread*/ 00012 00013 namespace Arch { 00014 namespace x86 { 00016 namespace Thread { 00017 00018 void init(uint32 freq) __attribute__ ((noreturn)); //init multitasking in the arch 00019 00020 //ATTENTION when changing, change in sched.s as well 00021 const uint32 REG_STACK_SIZE = 0x200; 00022 00023 //a thread's context 00024 struct context_t 00025 { 00026 uint32 *ksp; /* kernel stack pointer */ 00027 uint32 *tsp; /* thread stack pointer */ 00028 uint32 *isp; /* interruption stack pointer */ 00029 bool supervisor; 00030 }; 00031 00032 00033 }; /*namespace Thread*/ 00034 }; /*namespace x86*/ 00035 }; /*namespace Arch*/ 00036 00037 00038 //typedefs 00039 typedef Arch::x86::Thread::context_t context_t; 00040 00041 #endif