diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-08 12:32:41 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-08 12:32:41 +0200 |
| commit | 09dd11ddf800898c00ecb04a65fb5cd10fb481fa (patch) | |
| tree | eda0b4e23d6a71da7de3a78f0bb76ec3201dd2f9 /NewKernel/ArchKit | |
| parent | ca83108fd138cc0398f900e6a6c0a53ad51aee31 (diff) | |
MHR-23: :boom: changes, reworked project tree.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'NewKernel/ArchKit')
| -rw-r--r-- | NewKernel/ArchKit/ArchKit.hpp | 50 | ||||
| -rw-r--r-- | NewKernel/ArchKit/compile_flags.txt | 7 |
2 files changed, 57 insertions, 0 deletions
diff --git a/NewKernel/ArchKit/ArchKit.hpp b/NewKernel/ArchKit/ArchKit.hpp new file mode 100644 index 00000000..be155385 --- /dev/null +++ b/NewKernel/ArchKit/ArchKit.hpp @@ -0,0 +1,50 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <NewKit/Array.hpp> +#include <NewKit/Defines.hpp> +#include <NewKit/Function.hpp> + +#ifdef __NEWOS_AMD64__ +#include <HALKit/AMD64/HalPageAlloc.hpp> +#include <HALKit/AMD64/Hypervisor.hpp> +#include <HALKit/AMD64/Processor.hpp> +#elif defined(__NEWOS_PPC__) +#include <HALKit/POWER/Processor.hpp> +#else +#error Unknown architecture +#endif + +namespace NewOS +{ + constexpr static inline SSizeT rt_hash_seed(const char* seed, int mul) + { + SSizeT hash = 0; + + for (SSizeT idx = 0; seed[idx] != 0; ++idx) + { + hash += seed[idx]; + hash ^= mul; + } + + return hash; + } +} // namespace NewOS + +#define kKernelMaxSystemCalls (256) + +typedef NewOS::Void (*rt_syscall_proc)(NewOS::HAL::StackFramePtr); + +extern NewOS::Array<rt_syscall_proc, + kKernelMaxSystemCalls> + kSyscalls; + +EXTERN_C NewOS::HAL::StackFramePtr rt_get_current_context(); +EXTERN_C NewOS::Void rt_do_context_switch(NewOS::HAL::StackFramePtr stackFrame); + +#include <FirmwareKit/Handover.hxx> diff --git a/NewKernel/ArchKit/compile_flags.txt b/NewKernel/ArchKit/compile_flags.txt new file mode 100644 index 00000000..a3cab89d --- /dev/null +++ b/NewKernel/ArchKit/compile_flags.txt @@ -0,0 +1,7 @@ +-nostdlib +-ffreestanding +-std=c++20 +-I./ +-I../ +-I$(HOME)/ +-D__NEWOS_AMD64__ |
