[MULTITASKING] Preemptive multitasking

This commit is contained in:
thomas committed 2017-03-27 23:09:08 +02:00
1 parent d3d065b2e2
commit 664379b35c
7 files changed
+26 -8

No files matched your search

+3
View File
@@ -14,3 +14,6 @@ uint64_t read_cr4();
#define CR4_OSFXSR (1<<9)
#define CR4_OSXMMEXCPT (1<<10)
#define RFLAGS_IF (1<<9)
+3
View File
@@ -3,11 +3,13 @@ typedef struct thread_st thread_t;
#include <stdint.h>
#include <list.h>
#include <process.h>
#include <int.h>
#define THREAD_STACK_SIZE 0x1000-sizeof(thread_t)
typedef struct thread_st
{
registers_t r;
uint64_t stack_pointer; // Top of the kernel stack for thread
uint64_t tid;
uint64_t state;
@@ -32,6 +34,7 @@ typedef struct thread_stack_st
uint64_t R13;
uint64_t R14;
uint64_t R15;
uint64_t thread;
uint64_t zero_frame;
uint64_t function_address;
thread_t tcb;