diff options
author | Tyler Murphy <=> | 2023-07-17 19:34:52 -0400 |
---|---|---|
committer | Tyler Murphy <=> | 2023-07-17 19:34:52 -0400 |
commit | 7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5 (patch) | |
tree | 4e86ff20e73171285156631db043e12aaf63bf04 /kernel/src/cpu | |
parent | paging (diff) | |
download | finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.tar.gz finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.tar.bz2 finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.zip |
refactoring
Diffstat (limited to 'kernel/src/cpu')
-rw-r--r-- | kernel/src/cpu/cpu.c | 18 | ||||
-rw-r--r-- | kernel/src/cpu/cpu.h | 8 | ||||
-rw-r--r-- | kernel/src/cpu/fpu.asm | 19 | ||||
-rw-r--r-- | kernel/src/cpu/sse.asm | 22 |
4 files changed, 0 insertions, 67 deletions
diff --git a/kernel/src/cpu/cpu.c b/kernel/src/cpu/cpu.c deleted file mode 100644 index 416a1ad..0000000 --- a/kernel/src/cpu/cpu.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "cpu.h" - -#include "print.h" - -extern uint8_t sse_init (void); -extern uint8_t fpu_init (void); - -uint8_t init_registers (uint8_t reg) { - uint8_t res = 0; - - if (reg & SSE_REG) - res |= ~sse_init() & SSE_REG; - - if (reg & FPU_REG) - res |= ~fpu_init() & FPU_REG; - - return res; -} diff --git a/kernel/src/cpu/cpu.h b/kernel/src/cpu/cpu.h deleted file mode 100644 index b6221aa..0000000 --- a/kernel/src/cpu/cpu.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include <stdint.h> - -#define SSE_REG 0x01 -#define FPU_REG 0x02 - -uint8_t init_registers (uint8_t reg); diff --git a/kernel/src/cpu/fpu.asm b/kernel/src/cpu/fpu.asm deleted file mode 100644 index d03feba..0000000 --- a/kernel/src/cpu/fpu.asm +++ /dev/null @@ -1,19 +0,0 @@ -global fpu_init - -fpu_init: - mov edx, cr0 - and edx, (-1) - ((1 << 3) + (1 << 4)) - mov cr0, edx - fninit - fnstsw [test] - cmp word [test], 0 - jne no_fpu - - mov eax, 0 - ret - -no_fpu: - mov eax, 1 - ret - -test: dw 0x55AA diff --git a/kernel/src/cpu/sse.asm b/kernel/src/cpu/sse.asm deleted file mode 100644 index e7b5a99..0000000 --- a/kernel/src/cpu/sse.asm +++ /dev/null @@ -1,22 +0,0 @@ -global sse_init - -sse_init: - mov eax, 0x1 - cpuid - test edx, 1<<25 - jmp no_sse - - mov eax, cr0 - and ax, 0xFFFB - or ax, 0x2 - mov cr0, eax - mov eax, cr4 - or ax, 3 << 9 - mov cr4, eax - - mov eax, 0 - ret - -no_sse: - mov eax, 1 - ret |