diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-31 16:40:11 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-31 16:42:42 +0200 |
| commit | 63dc1384bcbf8caf4ca53c715628db2c36b0b096 (patch) | |
| tree | 2937e78fc2f0e729052660bdd1c74fdacf57d0ec /SCIKit | |
| parent | 59e0caa55e97f1a998904f404e5fedac3b2b0ec6 (diff) | |
[IMP] SEE BELOW.
- Support for shared libraries inside a process.
- SMP improvements, add the PROCESS_CONTROL_BLOCK, to handle task
switching.
- Add MUST_PASS in HardwareTimer class.
- Add rtl.internal.inl for SCM internal implementation.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'SCIKit')
| -rw-r--r-- | SCIKit/SharedInterface1.hxx | 12 | ||||
| -rw-r--r-- | SCIKit/Types.hxx | 47 | ||||
| -rw-r--r-- | SCIKit/makefile | 7 | ||||
| -rw-r--r-- | SCIKit/rtl.internal.inl | 32 | ||||
| -rw-r--r-- | SCIKit/source_deploy.xml | 1 |
5 files changed, 76 insertions, 23 deletions
diff --git a/SCIKit/SharedInterface1.hxx b/SCIKit/SharedInterface1.hxx index 5edb5e51..46c6e220 100644 --- a/SCIKit/SharedInterface1.hxx +++ b/SCIKit/SharedInterface1.hxx @@ -7,12 +7,18 @@ Purpose: System Call Interface Version 1. ------------------------------------------- */
-#ifndef __SCI_STD_HXX__
-#define __SCI_STD_HXX__
+#ifndef __SHARED_INTERFACE_HXX__
+#define __SHARED_INTERFACE_HXX__
+
+#define cRestrictR 1
+#define cRestrictRB 2
+#define cRestrictW 4
+#define cRestrictRW 6
#include <SCIKit/Types.hxx>
typedef UInt32 PowerID;
+typedef long long int FD;
/**
@brief System call class.
@@ -86,4 +92,4 @@ public: virtual UInt0* WriteStorage(const UTFChar* cmdNameOrData, SizeT cmdSize, FD descriptorType) = 0;
};
-#endif // ifndef __SCI_STD_HXX__
+#endif // ifndef __SHARED_INTERFACE_HXX__
diff --git a/SCIKit/Types.hxx b/SCIKit/Types.hxx index c42b7718..2c7e204e 100644 --- a/SCIKit/Types.hxx +++ b/SCIKit/Types.hxx @@ -7,20 +7,13 @@ Purpose: System Call types. ------------------------------------------- */
-
#pragma once
#define IMPORT_CXX extern "C++"
#define IMPORT_C extern "C"
-#define cRestrictR 1
-#define cRestrictRB 2
-#define cRestrictW 4
-#define cRestrictRW 6
-
-typedef long long int FD;
-typedef bool Bool;
-typedef void UInt0;
+typedef bool Bool;
+typedef void UInt0;
typedef __UINT64_TYPE__ UInt64;
typedef __UINT32_TYPE__ UInt32;
@@ -40,7 +33,7 @@ typedef char UTFChar; // So that they aren't too big.
class UnknownInterface; // Refrenced from an IDB entry.
-class UnknownUCLSID; // From IDB, the constructor of the object.
+class UnknownUCLSID; // From the IDB, the constructor of the object, e.g: WordUCLSID.
class __attribute__((uuid("d7c144b6-0792-44b8-b06b-02b227b547df"))) UnknownInterface
{
@@ -51,14 +44,30 @@ public: UnknownInterface& operator=(const UnknownInterface&) = default;
UnknownInterface(const UnknownInterface&) = default;
- SInt32 Release() { delete this; }
-
- template <typename TCLS>
- SInt32 Release(TCLS* cls) { delete cls; return 0; }
-
- template <typename TCLS, typename UCLSID, typename... Args>
- TCLS* QueryInterface(UCLSID uclsidOfCls, Args... args) { return uclsidOfCls->QueryObject<TCLS>(args...); }
+ SInt32 Release()
+ {
+ delete this;
+ return 0;
+ }
};
-template <typename TCLS, typename UCLSID>
-TCLS* RtlGetClassFromCLSID(UCLSID uclsidOfCls);
\ No newline at end of file +#ifdef __NEWOS_SYMS__
+#include <SCIKit/rtl.internal.inl>
+#else
+
+/// @brief Allocate new SCM class.
+/// @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
+template <typename TCLS>
+inline SInt32 RtlReleaseClass(TCLS* cls);
+
+#endif
\ No newline at end of file diff --git a/SCIKit/makefile b/SCIKit/makefile index ae08cce2..9a2b836e 100644 --- a/SCIKit/makefile +++ b/SCIKit/makefile @@ -1,7 +1,12 @@ ######################
# (C) ZKA
+# SCM/SCI kit makefile.
######################
+CC=g++
+FLAGS=-I../ -shared -fPIC -D__NEWOS_SYMS__
+OUTPUT=libSCI.lib
+
.PHONY: build-sci
build-sci:
- g++ *.cxx -I../ -shared -fPIC -o libSCI.lib
\ No newline at end of file + $(CC) $(wildcard *.cxx) $(FLAGS) -o $(OUTPUT)
\ No newline at end of file diff --git a/SCIKit/rtl.internal.inl b/SCIKit/rtl.internal.inl new file mode 100644 index 00000000..b0b011cc --- /dev/null +++ b/SCIKit/rtl.internal.inl @@ -0,0 +1,32 @@ +/* -------------------------------------------
+
+Copyright ZKA Technologies.
+
+File: rt.internal.inl.
+Purpose: Internal file for SCM.
+
+------------------------------------------- */
+
+/// @brief Allocate new SCM class.
+/// @tparam TCLS
+/// @tparam UCLSID
+/// @param uclsidOfCls
+/// @return
+template <typename TCLS, typename UCLSID, typename... Args>
+inline TCLS* RtlGetClassFromCLSID(UCLSID* uclsidOfCls, Args&&... args)
+{
+ return uclsidOfCls->QueryObjectWithArgs(args...);
+}
+
+/// @brief Release SCM class.
+/// @tparam TCLS
+/// @param cls
+/// @return
+template <typename TCLS>
+inline SInt32 RtlReleaseClass(TCLS* cls)
+{
+ cls->DecrementRef();
+ cls->Release();
+
+ return 0;
+}
diff --git a/SCIKit/source_deploy.xml b/SCIKit/source_deploy.xml index 5f653982..7873c49f 100644 --- a/SCIKit/source_deploy.xml +++ b/SCIKit/source_deploy.xml @@ -2,5 +2,6 @@ <HiddenFiles>
<SourceFile>*.cxx</SourceFile>
<SourceFile>*.drawio</SourceFile>
+ <SourceFile>*.internal.inl</SourceFile>
</HiddenFiles>
</SourceDeploy>
|
