]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/include/arch-x64/thread.h
Initial checkin from Perforce.
[polintos/scott/priv.git] / kernel / include / arch-x64 / thread.h
1 #ifndef _ARCH_THREAD_H
2 #define _ARCH_THREAD_H
3
4 #include <kern/types.h>
5
6 namespace Threads {
7         class Thread;
8 }
9
10 namespace Arch {
11         struct ArchThread {
12                 void *rsp, *rbp;
13                 u8 jump_to_init;
14                 
15                 enum {
16                         size = 4096
17                 };
18                 
19                 void init(void *entry, void *arg);
20         };
21
22         void switch_thread(Threads::Thread *dest, Threads::Thread *src);
23         
24         namespace Priv {
25                 struct TSS {
26                         u32 padding;
27                         u32 reserved1;
28                         u64 rsp[3];
29                         u64 reserved2;
30                         u64 ist[7];
31                         u16 reserved3[5];
32                         u16 iomap_base;
33                 };
34                 
35                 extern TSS tss;
36         }
37 };
38
39 #endif