diff options
| author | Amlal <amlalelmahrouss@icloud.com> | 2024-07-28 16:11:46 +0000 |
|---|---|---|
| committer | Amlal <amlalelmahrouss@icloud.com> | 2024-07-28 16:11:46 +0000 |
| commit | c4023005e029ae092dad2689564c490580dd5c28 (patch) | |
| tree | 3080ba07a6b552bf3d7591574cf69b2a3c8fd0fd /Kernel/ArchKit | |
| parent | 8c8822fff78f9ff9cd640271da9b3634c4c2f97f (diff) | |
| parent | 4db57a2d646b1538783a0675b38bada7a0f903ae (diff) | |
Merged in MHR-36 (pull request #17)
MHR-36
Diffstat (limited to 'Kernel/ArchKit')
| -rw-r--r-- | Kernel/ArchKit/ArchKit.hpp | 31 | ||||
| -rw-r--r-- | Kernel/ArchKit/compile_flags.txt | 1 |
2 files changed, 17 insertions, 15 deletions
diff --git a/Kernel/ArchKit/ArchKit.hpp b/Kernel/ArchKit/ArchKit.hpp index 622d7219..a4d272ec 100644 --- a/Kernel/ArchKit/ArchKit.hpp +++ b/Kernel/ArchKit/ArchKit.hpp @@ -1,6 +1,6 @@ /* ------------------------------------------- - Copyright Zeta Electronics Corporation + Copyright ZKA Technologies ------------------------------------------- */ @@ -10,12 +10,14 @@ #include <NewKit/Defines.hpp> #include <NewKit/Function.hpp> +#include <FirmwareKit/Handover.hxx> + #ifdef __NEWOS_AMD64__ -#include <HALKit/AMD64/HalPageAlloc.hpp> +#include <HALKit/AMD64/HalPageAlloc.hxx> #include <HALKit/AMD64/Hypervisor.hpp> -#include <HALKit/AMD64/Processor.hpp> -#elif defined(__NEWOS_PPC__) -#include <HALKit/POWER/Processor.hpp> +#include <HALKit/AMD64/Processor.hxx> +#elif defined(__NEWOS_POWER64__) +#include <HALKit/POWER/Processor.hxx> #elif defined(__NEWOS_ARM64__) #include <HALKit/ARM64/Processor.hxx> #else @@ -24,7 +26,7 @@ namespace Kernel { - constexpr static inline SSizeT rt_hash_seed(const char* seed, int mul) + inline SSizeT rt_hash_seed(const char* seed, int mul) { SSizeT hash = 0; @@ -41,7 +43,7 @@ namespace Kernel /// @param base the base address. /// @param reg the register. /// @param value the write to write on it. - inline void ke_dma_write(UInt32 base, UInt32 reg, UInt32 value) noexcept + inline Void ke_dma_write(UInt32 base, UInt32 reg, UInt32 value) noexcept { *(volatile UInt32*)((UInt64)base + reg) = value; } @@ -58,18 +60,19 @@ namespace Kernel /// @brief Print a region of memory. /// @param start /// @param length - inline void ke_print_raw_memory(const void* start, Size length) + inline Void ke_print_raw_memory(const void* start, Size length) { const UInt8* ptr = (const UInt8*)start; + for (Size i = 0; i < length; i++) { if (i % 16 == 0) { - kcout << hex_number((UIntPtr)ptr + i); + kcout.HexNumber((UIntPtr)ptr + i); } else { - kcout << hex_number(ptr[i]); + kcout.HexNumber(ptr[i]); } kcout << " "; @@ -86,19 +89,17 @@ typedef Kernel::Void (*rt_syscall_proc)(Kernel::VoidPtr); struct RTSyscallInfoHdr final { Kernel::Int64 fHash; - Kernel::Bool fHooked; + Kernel::Bool fHooked; rt_syscall_proc fProc; }; inline Kernel::Array<RTSyscallInfoHdr, - kKernelMaxSystemCalls> + kKernelMaxSystemCalls> kSyscalls; inline Kernel::Array<RTSyscallInfoHdr, - kKernelMaxSystemCalls> + kKernelMaxSystemCalls> kKerncalls; EXTERN_C Kernel::HAL::StackFramePtr rt_get_current_context(); EXTERN_C Kernel::Void rt_do_context_switch(Kernel::HAL::StackFramePtr stackFrame); - -#include <FirmwareKit/Handover.hxx> diff --git a/Kernel/ArchKit/compile_flags.txt b/Kernel/ArchKit/compile_flags.txt index a3cab89d..c15efc77 100644 --- a/Kernel/ArchKit/compile_flags.txt +++ b/Kernel/ArchKit/compile_flags.txt @@ -5,3 +5,4 @@ -I../ -I$(HOME)/ -D__NEWOS_AMD64__ +-D__ED__ |
