mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-13 08:19:18 +00:00
Fix compiler issues in 32-bit
This commit is contained in:
@ -298,23 +298,25 @@ typedef struct
|
||||
uint64_t value;
|
||||
} atomic_uint64_t;
|
||||
|
||||
uint64_t __atomic_load_8(const atomic_uint64_t *p)
|
||||
{
|
||||
uint64_t value;
|
||||
__asm__ volatile("lock cmpxchg8b %1"
|
||||
: "=A"(value)
|
||||
: "m"(*p)
|
||||
: "memory");
|
||||
return value;
|
||||
}
|
||||
/* No longer needed? */
|
||||
|
||||
void __atomic_store_8(atomic_uint64_t *p, uint64_t value)
|
||||
{
|
||||
__asm__ volatile("lock cmpxchg8b %0"
|
||||
: "=m"(p->value)
|
||||
: "a"((uint32_t)value), "d"((uint32_t)(value >> 32)), "m"(*p)
|
||||
: "memory");
|
||||
}
|
||||
// uint64_t __atomic_load_8(const atomic_uint64_t *p)
|
||||
// {
|
||||
// uint64_t value;
|
||||
// __asm__ volatile("lock cmpxchg8b %1"
|
||||
// : "=A"(value)
|
||||
// : "m"(*p)
|
||||
// : "memory");
|
||||
// return value;
|
||||
// }
|
||||
|
||||
// void __atomic_store_8(atomic_uint64_t *p, uint64_t value)
|
||||
// {
|
||||
// __asm__ volatile("lock cmpxchg8b %0"
|
||||
// : "=m"(p->value)
|
||||
// : "a"((uint32_t)value), "d"((uint32_t)(value >> 32)), "m"(*p)
|
||||
// : "memory");
|
||||
// }
|
||||
|
||||
int __fixsfsi(float a)
|
||||
{
|
||||
|
@ -41,7 +41,6 @@ EXTERNC void multiboot_main(uintptr_t Magic, uintptr_t Info)
|
||||
BootInfo mb2binfo{};
|
||||
|
||||
{
|
||||
int pos = 0;
|
||||
auto InfoAddress = Info;
|
||||
for (auto Tag = (struct multiboot_tag *)((uint8_t *)InfoAddress + 8);
|
||||
;
|
||||
|
@ -229,13 +229,9 @@ namespace GlobalDescriptorTable
|
||||
gdt[Core].Entries->TaskStateSegment.BaseMiddle = uint8_t((Base >> 16) & 0xFF);
|
||||
gdt[Core].Entries->TaskStateSegment.BaseHigh = uint8_t((Base >> 24) & 0xFF);
|
||||
|
||||
#pragma diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wshift-count-overflow"
|
||||
|
||||
gdt[Core].Entries->TaskStateSegment.BaseUpper = s_cst(uint32_t, (Base >> 32) & 0xFFFFFFFF);
|
||||
|
||||
#pragma diagnostic pop
|
||||
|
||||
gdt[Core].Entries->TaskStateSegment.Access = {.A = 1, .RW = 0, .DC = 0, .E = 1, .S = 0, .DPL = 0, .P = 1};
|
||||
gdt[Core].Entries->TaskStateSegment.Granularity = (0 << 4) | ((Limit >> 16) & 0xF);
|
||||
|
||||
@ -259,7 +255,7 @@ namespace GlobalDescriptorTable
|
||||
|
||||
SafeFunction void SetKernelStack(void *Stack)
|
||||
{
|
||||
long CPUID = GetCurrentCPU()->ID;
|
||||
stub;
|
||||
}
|
||||
|
||||
void *GetKernelStack() { return (void *)nullptr; }
|
||||
|
Reference in New Issue
Block a user