From 051e2cfb8df4f2fc1ef711ca7351e7018b4c6e1c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 21 Mar 2024 13:39:23 +0100 Subject: unstable: secret: Start work on AHCI driver, getting it to initialize first. Signed-off-by: Amlal El Mahrouss --- Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s | 4 ++-- Public/Kits/System.Core/Defs.hxx | 10 +++++++--- Public/Kits/System.Core/Heap.hxx | 2 +- Public/Kits/System.Core/InitRuntime.cxx | 6 ++++-- 4 files changed, 14 insertions(+), 8 deletions(-) (limited to 'Public/Kits/System.Core') diff --git a/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s b/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s index 71984042..a61d6d1f 100644 --- a/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s +++ b/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s @@ -4,12 +4,12 @@ .section .text -.globl HcGetProcessObject +.globl HcGetInstanceObject .globl __assert_chk_fail /* @brief Process object getter */ /* @throws: ApptError: appartement error. */ -HcGetProcessObject: +HcGetInstanceObject: mov $0x10, %rcx /* sysGetProcessObject */ int $0x21 diff --git a/Public/Kits/System.Core/Defs.hxx b/Public/Kits/System.Core/Defs.hxx index e99abcc4..6d0fb99a 100644 --- a/Public/Kits/System.Core/Defs.hxx +++ b/Public/Kits/System.Core/Defs.hxx @@ -66,10 +66,10 @@ typedef CHAR BOOL; #define TRUE 1 #define FALSE 0 -#define PTR * +#define CA_PTR * -#define FAR __far -#define NEAR __near +#define CA_FAR __far +#define CA_NEAR __near #define CA_UNREFERENCED_PARAMETER(e) ((VOID)e) @@ -89,6 +89,10 @@ typedef CHAR BOOL; # define _M_64000 5 #endif +#ifdef __riscv__ +# define _M_RISCV 6 +#endif + #define CA_STATIC static #define CA_INLINE inline #define CA_CONST const diff --git a/Public/Kits/System.Core/Heap.hxx b/Public/Kits/System.Core/Heap.hxx index 6bad93e0..ff0fc75a 100644 --- a/Public/Kits/System.Core/Heap.hxx +++ b/Public/Kits/System.Core/Heap.hxx @@ -16,7 +16,7 @@ CA_EXTERN_C PVOID HcAllocateProcessHeap(ObjectPtr refObj, QWORD sz, CA_EXTERN_C BOOL HcProcessHeapExists(ObjectPtr refObj, PVOID ptr); CA_EXTERN_C QWORD HcProcessHeapSize(ObjectPtr refObj, PVOID ptr); CA_EXTERN_C VOID HcFreeProcessHeap(ObjectPtr refObj, PVOID ptr); -CA_EXTERN_C ObjectPtr HcGetProcessObject(void); +CA_EXTERN_C ObjectPtr HcGetInstanceObject(void); enum HcAllocationKind { kStandardAllocation = 0xC, diff --git a/Public/Kits/System.Core/InitRuntime.cxx b/Public/Kits/System.Core/InitRuntime.cxx index 01eb2c1f..8d5596ca 100644 --- a/Public/Kits/System.Core/InitRuntime.cxx +++ b/Public/Kits/System.Core/InitRuntime.cxx @@ -4,9 +4,11 @@ #include -/// @brief Inits the C runtime +/// @brief Inits the process runtime /// @return if it was succesful or not. DWORD HcInitRuntime(VOID) { - kInstanceObject = HcGetProcessObject(); + kInstanceObject = HcGetInstanceObject(); + CA_MUST_PASS(kInstanceObject); + return 0; } \ No newline at end of file -- cgit v1.2.3