diff options
Diffstat (limited to 'SCIKit')
| -rw-r--r-- | SCIKit/ErrorTypes.hxx | 2 | ||||
| -rw-r--r-- | SCIKit/SCI.hxx (renamed from SCIKit/Types.hxx) | 66 |
2 files changed, 56 insertions, 12 deletions
diff --git a/SCIKit/ErrorTypes.hxx b/SCIKit/ErrorTypes.hxx index 4473722a..35af4d64 100644 --- a/SCIKit/ErrorTypes.hxx +++ b/SCIKit/ErrorTypes.hxx @@ -6,7 +6,7 @@ #pragma once -#include <SCIKit/Types.hxx> +#include <SCIKit/SCI.hxx> #define ErrLocalIsOk() (kLastError == kErrorSuccess) #define ErrLocalFailed() (kLastError != kErrorSuccess) diff --git a/SCIKit/Types.hxx b/SCIKit/SCI.hxx index 2c7e204e..5f819ba1 100644 --- a/SCIKit/Types.hxx +++ b/SCIKit/SCI.hxx @@ -12,8 +12,8 @@ Purpose: System Call types. #define IMPORT_CXX extern "C++"
#define IMPORT_C extern "C"
-typedef bool Bool;
-typedef void UInt0;
+typedef bool Bool;
+typedef void UInt0;
typedef __UINT64_TYPE__ UInt64;
typedef __UINT32_TYPE__ UInt32;
@@ -27,7 +27,11 @@ typedef __INT32_TYPE__ SInt32; typedef __INT16_TYPE__ SInt16;
typedef __INT8_TYPE__ SInt8;
-typedef char UTFChar;
+typedef void* VoidPtr;
+typedef __UINTPTR_TYPE__ UIntPtr;
+typedef char Char;
+
+typedef Char UTFChar;
// Interfaces are divided between classes.
// So that they aren't too big.
@@ -56,18 +60,58 @@ public: #else
/// @brief Allocate new SCM class.
-/// @tparam TCLS
-/// @tparam UCLSID
-/// @param uclsidOfCls
-/// @return
+/// @tparam TCLS
+/// @tparam UCLSID
+/// @param uclsidOfCls
+/// @return
template <typename TCLS, typename UCLSID, typename... Args>
inline TCLS* RtlGetClassFromCLSID(UCLSID uclsidOfCls, Args... args);
/// @brief Release SCM class.
-/// @tparam TCLS
-/// @param cls
-/// @return
+/// @tparam TCLS
+/// @param cls
+/// @return
template <typename TCLS>
inline SInt32 RtlReleaseClass(TCLS* cls);
-#endif
\ No newline at end of file +#endif
+
+/* ================================================ */
+/* SCI structures */
+/* ================================================ */
+
+struct HEAP_ALLOC_INFO final
+{
+ VoidPtr fThe;
+ SizeT fTheSz;
+};
+
+struct THREAD_INFORMATION_BLOCK final
+{
+ Char f_Cookie[3]; // Process cookie.
+ UIntPtr f_Code; // Start Address
+ UIntPtr f_Data; // Allocation Heap
+ UIntPtr f_BSS; // Stack Pointer.
+ SInt32 f_ID; // Thread execution ID.
+};
+
+struct PROCESS_BLOCK_INFO final
+{
+ THREAD_INFORMATION_BLOCK* fTIB;
+ THREAD_INFORMATION_BLOCK* fGIB;
+};
+
+struct PROCESS_EXIT_INFO final
+{
+ static constexpr auto cReasonLen = 512;
+
+ SInt64 fCode;
+ Char fReason[cReasonLen];
+};
+
+/// @brief Raise system call.
+/// @param id the system call id could be 0x10 for example.
+/// @param data the data associated with it.
+/// @param data_sz the size of the data associated with it.
+/// @return status code.
+IMPORT_C SInt32 RtlRaiseSystemCall(const SInt32 id, VoidPtr data, SizeT data_sz);
\ No newline at end of file |
