From ff94ce367f7f23e3a78f157f9420c480a4d7f9aa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 26 Aug 2024 04:07:14 +0200 Subject: [IMP] DLLInterface class and also reworked SCI's API. [IMP] Handover now gives the kernel image, for the OS. Signed-off-by: Amlal El Mahrouss --- dev/ZKA/KernelKit/DLLInterface.hxx | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dev/ZKA/KernelKit/DLLInterface.hxx (limited to 'dev/ZKA/KernelKit/DLLInterface.hxx') diff --git a/dev/ZKA/KernelKit/DLLInterface.hxx b/dev/ZKA/KernelKit/DLLInterface.hxx new file mode 100644 index 00000000..370363b7 --- /dev/null +++ b/dev/ZKA/KernelKit/DLLInterface.hxx @@ -0,0 +1,44 @@ +/* + * ======================================================== + * + * Kernel + * Copyright ZKA Technologies., all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include + +namespace Kernel +{ + class DLLInterface + { + public: + explicit DLLInterface() = default; + virtual ~DLLInterface() = default; + + struct DLL_TRAITS final + { + VoidPtr fImageObject{nullptr}; + VoidPtr fImageEntrypointOffset{nullptr}; + + Bool IsValid() + { + return fImageObject && fImageEntrypointOffset; + } + }; + + ZKA_COPY_DEFAULT(DLLInterface); + + virtual DLL_TRAITS** GetAddressOf() = 0; + virtual DLL_TRAITS* Get() = 0; + + virtual void Mount(DLL_TRAITS* to_mount) = 0; + virtual void Unmount() = 0; + }; + + /// @brief Pure implementation, missing method/function handler. + EXTERN_C void __zka_pure_call(void); +} // namespace Kernel -- cgit v1.2.3