summaryrefslogtreecommitdiffhomepage
path: root/dev/LibSCI
diff options
context:
space:
mode:
authorAmlal <amlal.elmahrouss@icloud.com>2025-02-15 09:33:35 +0100
committerAmlal <amlal.elmahrouss@icloud.com>2025-02-15 09:34:51 +0100
commitfd27d5f1e4176926d613005f30feb209375d97ea (patch)
treea18b18718b77ca9248f56936a3cef0112c24ce51 /dev/LibSCI
parent0db25895168df6ebb9bd8781e3ffd83d3323b398 (diff)
Impl and Patches:
- Private tools directory. - SCI gets new API. - Window Manager library. - Steps version 2. - Patch 'open' command. - ATA.h fixes. Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/LibSCI')
-rw-r--r--dev/LibSCI/GPU.h29
-rw-r--r--dev/LibSCI/Macros.h25
-rw-r--r--dev/LibSCI/SCI.h42
-rw-r--r--dev/LibSCI/src/GPU.cc2
4 files changed, 67 insertions, 31 deletions
diff --git a/dev/LibSCI/GPU.h b/dev/LibSCI/GPU.h
index fee621e6..52ae6b1d 100644
--- a/dev/LibSCI/GPU.h
+++ b/dev/LibSCI/GPU.h
@@ -7,45 +7,50 @@ Purpose: GFX System Calls.
------------------------------------------- */
-#ifndef SCIKIT_GPU_H
-#define SCIKIT_GPU_H
+#ifndef SCI_GPU_H
+#define SCI_GPU_H
#include <LibSCI/SCI.h>
-struct GPUCmdBuffer;
-
/// ------------------------------------------------------------------------------------------ //
/// @brief GPU API.
/// ------------------------------------------------------------------------------------------ //
+struct GPUCmdBuffer;
+
+typedef VoidPtr GPUObject;
+
/// ------------------------------------------------------------------------------------------ //
/// @brief Command buffer structure type.
/// ------------------------------------------------------------------------------------------ //
struct GPUCmdBuffer final
{
- VoidPtr Data;
- SizeT DataSz;
- SizeT BufferLayer;
- Bool IsGPGPUData;
- Bool BufferFirst;
+ VoidPtr Data{nullptr};
+ SizeT DataSz{0};
+ SizeT BufferLayer{0};
+ Bool IsGPGPUData{false};
+ Bool BufferFirst{false};
Bool isGPGPUData()
{
return this->isValid() && !this->BufferFirst && this->IsGPGPUData;
}
+ Bool isBackBuffer()
+ {
+ return !this->BufferFirst;
+ }
+
Bool isValid()
{
return this->Data && (this->DataSz > 0) && (MmGetHeapFlags(this->Data) != -1);
}
};
-typedef VoidPtr GPUObject;
-
IMPORT_C GPUObject GPUNewFromDeviceName(_Input const Char* device_name);
IMPORT_C SInt32 GPUDisposeDevice(GPUObject gpu_handle, Bool cancel_all, Bool flush_all);
IMPORT_C SInt32 GPUSendCmdBufferListWithCnt(GPUCmdBuffer** cmd_list, SizeT cmd_list_cnt);
-#endif // ifndef SCIKIT_GPU_H
+#endif // ifndef SCI_GPU_H
diff --git a/dev/LibSCI/Macros.h b/dev/LibSCI/Macros.h
index e57df6ee..3236176c 100644
--- a/dev/LibSCI/Macros.h
+++ b/dev/LibSCI/Macros.h
@@ -49,17 +49,26 @@ typedef void* VoidPtr;
typedef __UINTPTR_TYPE__ UIntPtr;
typedef char Char;
-typedef VoidPtr SCIObject;
-
-typedef SCIObject IOObject;
-typedef IOObject FSObject;
-typedef SCIObject DLLObject;
-typedef SCIObject ThreadObject;
-typedef SCIObject SocketObject;
-
#ifdef __cplusplus
typedef decltype(nullptr) nullPtr;
typedef nullPtr NullPtr;
+
+#define SCI_COPY_DELETE(KLASS) \
+ KLASS& operator=(const KLASS&) = delete; \
+ KLASS(const KLASS&) = delete;
+
+#define SCI_COPY_DEFAULT(KLASS) \
+ KLASS& operator=(const KLASS&) = default; \
+ KLASS(const KLASS&) = default;
+
+#define SCI_MOVE_DELETE(KLASS) \
+ KLASS& operator=(KLASS&&) = delete; \
+ KLASS(KLASS&&) = delete;
+
+#define SCI_MOVE_DEFAULT(KLASS) \
+ KLASS& operator=(KLASS&&) = default; \
+ KLASS(KLASS&&) = default;
+
#endif
IMPORT_C void _rtl_assert(Bool expr, const Char* origin);
diff --git a/dev/LibSCI/SCI.h b/dev/LibSCI/SCI.h
index 865a2c21..1e17ebd3 100644
--- a/dev/LibSCI/SCI.h
+++ b/dev/LibSCI/SCI.h
@@ -3,16 +3,28 @@
Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
File: SCI.h
-Purpose: System Calls.
+Purpose: System Call Interface.
------------------------------------------- */
-#ifndef SCIKIT_FOUNDATION_H
-#define SCIKIT_FOUNDATION_H
+#ifndef SCI_SCI_H
+#define SCI_SCI_H
#include <LibSCI/Macros.h>
// ------------------------------------------------------------------------------------------ //
+/// @brief Types API.
+// ------------------------------------------------------------------------------------------ //
+
+typedef VoidPtr SCIObject;
+
+typedef SCIObject IOObject;
+typedef IOObject FSObject;
+typedef SCIObject DLLObject;
+typedef SCIObject ThreadObject;
+typedef SCIObject SocketObject;
+
+// ------------------------------------------------------------------------------------------ //
/// @brief Dynamic Loader API.
// ------------------------------------------------------------------------------------------ //
@@ -79,9 +91,9 @@ IMPORT_C UInt64 IoSeekFile(_Input SCIObject file_desc, UInt64 file_offset);
// ------------------------------------------------------------------------
/// @brief Spawns a Thread Information Block and Global Information Block inside the current process.
-/// @param void.
+/// @param process_id Target Process ID, must be valid.
/// @return > 0 error ocurred or already present, = 0 success.
-IMPORT_C UInt32 RtlSpawnIB(Void);
+IMPORT_C UInt32 RtlSpawnIB(UIntPtr process_id);
/// @brief Spawns a process with a unique pid (stored as UIntPtr).
/// @param process_path process filesystem path.
@@ -136,13 +148,13 @@ IMPORT_C SInt64 MmStrCmp(_Input const Char* dest, _Input const Char* src);
IMPORT_C SInt64 MmStrLen(const Char* str);
// ------------------------------------------------------------------------
-// Error API.
+// @brief Error API.
// ------------------------------------------------------------------------
IMPORT_C SInt32 ErrGetLastError(Void);
// ------------------------------------------------------------------------
-// Threading API.
+// @brief Threading API.
// ------------------------------------------------------------------------
/// @brief Exit the current thread.
@@ -181,7 +193,7 @@ IMPORT_C Void ThrJoinThread(ThreadObject thrd);
IMPORT_C Void ThrDetachThread(ThreadObject thrd);
// ------------------------------------------------------------------------
-// Drive Management API.
+// @brief Drive Management API.
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------ //
@@ -291,7 +303,7 @@ IMPORT_C SInt32 ConRelease(IOObject);
IMPORT_C IOObject ConGet(const Char* path);
// ------------------------------------------------------------------------------------------ //
-// Scheduler Interrupts API.
+// @brief Scheduler/Debug API.
// ------------------------------------------------------------------------------------------ //
typedef SInt32 AffinityKind;
@@ -305,4 +317,14 @@ IMPORT_C SInt32 SchedKill(PID, SInt32 req);
IMPORT_C SInt32 SchedBreakPoint(Void);
-#endif // ifndef SCIKIT_FOUNDATION_H
+// ------------------------------------------------------------------------------------------ //
+// @brief Video API.
+// ------------------------------------------------------------------------------------------ //
+
+IMPORT_C SInt32 VideoGetBuffer(VoidPtr* out);
+
+IMPORT_C Void VideoDisposeBuffer(VoidPtr* in);
+
+IMPORT_C SInt32 VideoGetProfile(VoidPtr* in);
+
+#endif // ifndef SCI_SCI_H
diff --git a/dev/LibSCI/src/GPU.cc b/dev/LibSCI/src/GPU.cc
index d9594191..b3442db8 100644
--- a/dev/LibSCI/src/GPU.cc
+++ b/dev/LibSCI/src/GPU.cc
@@ -7,4 +7,4 @@ Purpose: GPU Interface.
------------------------------------------- */
-#include <LPC.h>
+#include <GPU.h>