Kernel: Replace i386 with i686

I don't really want to be working with i386 since it doesn't support
compare exchange instruction
This commit is contained in:
2024-03-26 02:48:26 +02:00
parent 93975fdc45
commit 99e30a4d7d
25 changed files with 31 additions and 26 deletions

View File

@@ -1,11 +1,11 @@
#pragma once
#define x86_64 1
#define i386 2
#define i686 2
#define ARCH(arch) (__arch == arch)
#if !defined(__arch) || (__arch != x86_64 && __arch != i386)
#if !defined(__arch) || (__arch != x86_64 && __arch != i686)
#error "Unsupported architecture"
#endif
@@ -13,10 +13,12 @@
#define read_rsp(rsp) asm volatile("movq %%rsp, %0" : "=r"(rsp))
#define push_callee_saved() asm volatile("pushq %rbx; pushq %rbp; pushq %r12; pushq %r13; pushq %r14; pushq %r15")
#define pop_callee_saved() asm volatile("popq %r15; popq %r14; popq %r13; popq %r12; popq %rbp; popq %rbx")
#else
#elif ARCH(i686)
#define read_rsp(rsp) asm volatile("movl %%esp, %0" : "=r"(rsp))
#define push_callee_saved() asm volatile("pushal")
#define pop_callee_saved() asm volatile("popal")
#else
#error
#endif
#include <stdint.h>

View File

@@ -28,7 +28,7 @@ namespace Kernel
// 1x triply indirect
BAN::Array<paddr_t, 5> block;
static constexpr size_t direct_block_count = 2;
#elif ARCH(i386)
#elif ARCH(i686)
// 14x direct blocks
// 1x singly indirect
// 1x doubly indirect

View File

@@ -4,7 +4,7 @@
#if ARCH(x86_64)
#define KERNEL_OFFSET 0xFFFFFFFF80000000
#elif ARCH(i386)
#elif ARCH(i686)
#define KERNEL_OFFSET 0xC0000000
#else
#error

View File

@@ -19,7 +19,7 @@ namespace Kernel
using ProcessorID = uint32_t;
constexpr ProcessorID PROCESSOR_NONE = 0xFFFFFFFF;
#if ARCH(x86_64) || ARCH(i386)
#if ARCH(x86_64) || ARCH(i686)
class Processor
{
BAN_NON_COPYABLE(Processor);