diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 18:17:47 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 18:18:59 +0100 |
| commit | 65254486efff0fd1bb78a48ff90b7713a5ce539f (patch) | |
| tree | 20ce02c12a74ba9e6cd382bf9c1f09a0c611cb4d /Private/HALKit/PowerPC | |
| parent | f03986937db0b927da4b10554801e18e4dc7c43f (diff) | |
Kernel: Update TODO.
Src: Refactorings according to clang-format.
Meta: Update specification.
Public: Remove useless UIKit.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit/PowerPC')
| -rw-r--r-- | Private/HALKit/PowerPC/CoreSyscallHandlerPowerPC.cpp | 13 | ||||
| -rw-r--r-- | Private/HALKit/PowerPC/PCI/Device.cxx | 1 | ||||
| -rw-r--r-- | Private/HALKit/PowerPC/Processor.cpp | 70 | ||||
| -rw-r--r-- | Private/HALKit/PowerPC/Processor.hpp | 54 | ||||
| -rw-r--r-- | Private/HALKit/PowerPC/StartSequence.s (renamed from Private/HALKit/PowerPC/CorePowerPCStart.s) | 2 |
5 files changed, 57 insertions, 83 deletions
diff --git a/Private/HALKit/PowerPC/CoreSyscallHandlerPowerPC.cpp b/Private/HALKit/PowerPC/CoreSyscallHandlerPowerPC.cpp index 6a723cba..ee300501 100644 --- a/Private/HALKit/PowerPC/CoreSyscallHandlerPowerPC.cpp +++ b/Private/HALKit/PowerPC/CoreSyscallHandlerPowerPC.cpp @@ -10,12 +10,11 @@ #include <ArchKit/Arch.hpp> #include <NewKit/Array.hpp> -hCore::Array<void (*)(hCore::Int32 id, hCore::HAL::StackFrame *), kMaxSyscalls> kSyscalls; +hCore::Array<void (*)(hCore::Int32 id, hCore::HAL::StackFrame *), kMaxSyscalls> + kSyscalls; -extern "C" void rt_syscall_handle(hCore::HAL::StackFrame *stack) -{ - for (hCore::SizeT index = 0UL; index < kMaxSyscalls; ++index) - { - (kSyscalls[index].Leak().Leak())(stack->ID, stack); - } +extern "C" void rt_syscall_handle(hCore::HAL::StackFrame *stack) { + for (hCore::SizeT index = 0UL; index < kMaxSyscalls; ++index) { + (kSyscalls[index].Leak().Leak())(stack->ID, stack); + } } diff --git a/Private/HALKit/PowerPC/PCI/Device.cxx b/Private/HALKit/PowerPC/PCI/Device.cxx index e69de29b..8b137891 100644 --- a/Private/HALKit/PowerPC/PCI/Device.cxx +++ b/Private/HALKit/PowerPC/PCI/Device.cxx @@ -0,0 +1 @@ + diff --git a/Private/HALKit/PowerPC/Processor.cpp b/Private/HALKit/PowerPC/Processor.cpp index dc614fa9..e3b207c6 100644 --- a/Private/HALKit/PowerPC/Processor.cpp +++ b/Private/HALKit/PowerPC/Processor.cpp @@ -1,68 +1,48 @@ /* -* ======================================================== -* -* hCore -* Copyright 2024 Mahrouss Logic, all rights reserved. -* -* ======================================================== -*/ + * ======================================================== + * + * hCore + * Copyright 2024 Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ #include <HALKit/PowerPC/Processor.hpp> #include <KernelKit/DebugOutput.hpp> extern "C" void flush_tlb() {} extern "C" void rt_wait_for_io() {} -extern "C" hCore::HAL::StackFrame* rt_get_current_context() { } +extern "C" hCore::HAL::StackFrame* rt_get_current_context() {} -namespace hCore -{ -namespace HAL -{ - UIntPtr hal_create_page(bool rw, bool user) - { - return 0; - } +namespace hCore { +namespace HAL { +UIntPtr hal_create_page(bool rw, bool user) { return 0; } - UIntPtr hal_alloc_page(UIntPtr offset, bool rw, bool user) - { - return 0; - } -} +UIntPtr hal_alloc_page(UIntPtr offset, bool rw, bool user) { return 0; } +} // namespace HAL // @brief wakes up thread. // wakes up thread from hang. -void rt_wakeup_thread(HAL::StackFrame* stack) -{ - -} +void rt_wakeup_thread(HAL::StackFrame* stack) {} // @brief makes thread sleep. // hooks and hangs thread to prevent code from executing. -void rt_hang_thread(HAL::StackFrame* stack) -{ - -} +void rt_hang_thread(HAL::StackFrame* stack) {} // @brief main HAL entrypoint -void init_hal() -{ - -} +void init_hal() {} -void system_io_print(const char *bytes) -{ - if (!bytes) - return; +void system_io_print(const char* bytes) { + if (!bytes) return; - SizeT index = 0; - SizeT len = string_length(bytes, 256); + SizeT index = 0; + SizeT len = string_length(bytes, 256); - while (index < len) - { - // TODO - ++index; - } + while (index < len) { + // TODO + ++index; + } } TerminalDevice kcout(hCore::system_io_print, nullptr); -}
\ No newline at end of file +} // namespace hCore diff --git a/Private/HALKit/PowerPC/Processor.hpp b/Private/HALKit/PowerPC/Processor.hpp index 58de1aa6..5fc0dcb2 100644 --- a/Private/HALKit/PowerPC/Processor.hpp +++ b/Private/HALKit/PowerPC/Processor.hpp @@ -14,37 +14,31 @@ #define __aligned __attribute__((aligned(4))) -namespace hCore::HAL -{ - typedef UIntPtr Reg; - - struct __aligned StackFrame - { - Reg R0; - Reg R1; - Reg R2; - Reg R3; - Reg R4; - Reg R5; - Reg R6; - Reg R7; - Reg ID; // R8 - }; - - typedef StackFrame* StackFramePtr; - - inline void rt_halt() - { - while (1) - {} - } - - inline void rt_cli() - { - - } +namespace hCore::HAL { +typedef UIntPtr Reg; + +struct __aligned StackFrame { + Reg R0; + Reg R1; + Reg R2; + Reg R3; + Reg R4; + Reg R5; + Reg R6; + Reg R7; + Reg ID; // R8 +}; + +typedef StackFrame* StackFramePtr; + +inline void rt_halt() { + while (1) { + } } +inline void rt_cli() {} +} // namespace hCore::HAL + extern "C" void int_handle_math(hCore::UIntPtr sp); extern "C" void int_handle_pf(hCore::UIntPtr sp); -extern "C" void* __ppc_alloca(size_t sz);
\ No newline at end of file +extern "C" void* __ppc_alloca(size_t sz); diff --git a/Private/HALKit/PowerPC/CorePowerPCStart.s b/Private/HALKit/PowerPC/StartSequence.s index f0c5ae2b..0b9807d0 100644 --- a/Private/HALKit/PowerPC/CorePowerPCStart.s +++ b/Private/HALKit/PowerPC/StartSequence.s @@ -3,4 +3,4 @@ .text __AssemblerStart: - b __AssemblerStart
\ No newline at end of file + b __AssemblerStart |
