mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 23:14:38 +00:00
Fix aarch64
This commit is contained in:
parent
28ec505b78
commit
c7046fe06f
40
Architecture/aarch64/Memory/VirtualMemoryManager.cpp
Normal file
40
Architecture/aarch64/Memory/VirtualMemoryManager.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Fennix Kernel.
|
||||||
|
|
||||||
|
Fennix Kernel is free software: you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of
|
||||||
|
the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
Fennix Kernel is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <memory.hpp>
|
||||||
|
|
||||||
|
#include <convert.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
namespace Memory
|
||||||
|
{
|
||||||
|
bool Virtual::Check(void *VirtualAddress, PTFlag Flag, MapType Type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void *Virtual::GetPhysical(void *VirtualAddress)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Virtual::Map(void *VirtualAddress, void *PhysicalAddress, uint64_t Flags, MapType Type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Virtual::Unmap(void *VirtualAddress, MapType Type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,7 @@ ENTRY(_start)
|
|||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
|
_bootstrap_start = .;
|
||||||
.text.boot :
|
.text.boot :
|
||||||
{
|
{
|
||||||
*(.text.boot)
|
*(.text.boot)
|
||||||
@ -27,8 +28,10 @@ SECTIONS
|
|||||||
*(.text.bss)
|
*(.text.bss)
|
||||||
_bss_end = .;
|
_bss_end = .;
|
||||||
}
|
}
|
||||||
|
_bootstrap_end = .;
|
||||||
|
|
||||||
_kernel_start = .;
|
_kernel_start = .;
|
||||||
|
_kernel_text_start = .;
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
KEEP(*(.text.boot))
|
KEEP(*(.text.boot))
|
||||||
@ -37,6 +40,7 @@ SECTIONS
|
|||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
_kernel_text_end = .;
|
_kernel_text_end = .;
|
||||||
|
|
||||||
|
_kernel_data_start = .;
|
||||||
.data :
|
.data :
|
||||||
{
|
{
|
||||||
*(.data .data.*)
|
*(.data .data.*)
|
||||||
@ -44,12 +48,12 @@ SECTIONS
|
|||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
_kernel_data_end = .;
|
_kernel_data_end = .;
|
||||||
|
|
||||||
|
_kernel_rodata_start = .;
|
||||||
.rodata :
|
.rodata :
|
||||||
{
|
{
|
||||||
*(.rodata .rodata.*)
|
*(.rodata .rodata.*)
|
||||||
}
|
}
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
_kernel_rodata_end = .;
|
|
||||||
|
|
||||||
.init_array :
|
.init_array :
|
||||||
{
|
{
|
||||||
@ -66,12 +70,15 @@ SECTIONS
|
|||||||
KEEP(*(.fini_array .dtors))
|
KEEP(*(.fini_array .dtors))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
}
|
}
|
||||||
|
_kernel_rodata_end = .;
|
||||||
|
|
||||||
|
_kernel_bss_start = .;
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
*(.bss .bss.*)
|
*(.bss .bss.*)
|
||||||
}
|
}
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
|
_kernel_bss_end = .;
|
||||||
_kernel_end = .;
|
_kernel_end = .;
|
||||||
_bss_size = _kernel_end - _kernel_rodata_end;
|
_bss_size = _kernel_end - _kernel_rodata_end;
|
||||||
|
|
||||||
|
@ -525,11 +525,7 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info)
|
|||||||
: "memory");
|
: "memory");
|
||||||
asmv("mov $0, %ebp");
|
asmv("mov $0, %ebp");
|
||||||
#elif defined(aa64)
|
#elif defined(aa64)
|
||||||
asmv("mov %0, %%sp"
|
#warning "Kernel stack is not set!"
|
||||||
:
|
|
||||||
: "r"(KernelStack)
|
|
||||||
: "memory");
|
|
||||||
asmv("mov $0, %fp");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -390,9 +390,11 @@ static int sys_fork(SyscallsFrame *Frame)
|
|||||||
|
|
||||||
strncpy(NewThread->Name, Thread->Name, sizeof(Thread->Name));
|
strncpy(NewThread->Name, Thread->Name, sizeof(Thread->Name));
|
||||||
NewThread->Info = Thread->Info;
|
NewThread->Info = Thread->Info;
|
||||||
|
#ifdef a86
|
||||||
NewThread->ShadowGSBase = Thread->ShadowGSBase;
|
NewThread->ShadowGSBase = Thread->ShadowGSBase;
|
||||||
NewThread->GSBase = Thread->GSBase;
|
NewThread->GSBase = Thread->GSBase;
|
||||||
NewThread->FSBase = Thread->FSBase;
|
NewThread->FSBase = Thread->FSBase;
|
||||||
|
#endif
|
||||||
|
|
||||||
CPU::Interrupts(CPU::Disable);
|
CPU::Interrupts(CPU::Disable);
|
||||||
static int RetChild = 0;
|
static int RetChild = 0;
|
||||||
|
@ -59,6 +59,8 @@ typedef struct SyscallsFrame
|
|||||||
uint32_t StackPointer;
|
uint32_t StackPointer;
|
||||||
uint32_t StackSegment;
|
uint32_t StackSegment;
|
||||||
#elif defined(aa64)
|
#elif defined(aa64)
|
||||||
|
uint32_t ReturnAddress;
|
||||||
|
uint32_t StackPointer;
|
||||||
#endif
|
#endif
|
||||||
} SyscallsFrame;
|
} SyscallsFrame;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user