- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask.h
More file actions
Latest commit
17 lines (15 loc) · 538 Bytes
/
Copy pathtask.h
File metadata and controls
17 lines (15 loc) · 538 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include"types.h"
// Saved CPU state for thread context switching
typedefstruct {
uint64_trax, rbx, rcx, rdx, rsi, rdi, rbp, rsp;
uint64_tr8, r9, r10, r11, r12, r13, r14, r15;
uint64_trip; // Instruction Pointer
uint64_trflags; // CPU Flags
uint64_tcr3; // Page Table Pointer (Process Memory Isolation)
} __attribute__((packed)) cpu_context_t;
typedefstructtask {
uint32_tid;
uint32_tstate; // 0 = Ready, 1 = Running, 2 = Blocked
cpu_context_tcontext;
structtask*next;
} task_t;t