[MODERN FEATURES] SSE

This commit is contained in:
2017-02-08 15:51:51 +01:00
parent 253cd84a1f
commit 0b27ddca2c
7 changed files with 69 additions and 2 deletions

View File

@@ -1,8 +1,16 @@
#pragma once
#ifndef __ASSEMBLER__
void load_idt(void *);
uint64_t read_cr0();
uint64_t read_cr2();
uint64_t read_cr3();
void write_cr3(uint64_t);
uint64_t read_cr4();
#endif
#define CR0_MP (1<<1)
#define CR0_EM (1<<2)
#define CR4_OSFXSR (1<<9)
#define CR4_OSXMMEXCPT (1<<10)

6
kernel/include/sse.h Normal file
View File

@@ -0,0 +1,6 @@
#pragma once
void sse_init();
void sse_save(uint8_t *addr);
void sse_restore(uint8_t *addr);

View File

@@ -11,6 +11,7 @@ typedef struct thread_st
uint64_t stack_pointer; // Top of the kernel stack for thread
uint64_t tid;
uint64_t state;
uint8_t sse_registers[512];
process_t *process;
LIST(struct thread_st, process_threads);
LIST(struct thread_st, ready_queue);