summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-10 05:13:55 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-10 05:13:55 +0100
commit7855b98f7cbe83d77f1625f7b5017060b97e5b75 (patch)
tree4b77f69c677f76f86d15f1118e9590943b6d818e /dev
parentd9101d6a9658ac4ffcd5a4d747e0b95a5cc5cd30 (diff)
IMPL: I/O subsystem improvements and Dyld subsystem improvements.
- Add make_ports for IO.h - Include PCI.h in Express.h - Use this in DMA.inl - Refactor NE_DLL_OBJECT to NE_DYLIB_OBJECT in IDylibObject.h Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev')
-rw-r--r--dev/Kernel/KernelKit/IDylibObject.h2
-rw-r--r--dev/Kernel/KernelKit/IPEFDylibObject.h2
-rw-r--r--dev/Kernel/KernelKit/PCI/DMA.inl4
-rw-r--r--dev/Kernel/KernelKit/PCI/Express.h1
-rw-r--r--dev/Kernel/KernelKit/PCI/IO.h20
-rw-r--r--dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl (renamed from dev/Kernel/KernelKit/PCI/IO-Impl-AMD64.inl)2
6 files changed, 24 insertions, 7 deletions
diff --git a/dev/Kernel/KernelKit/IDylibObject.h b/dev/Kernel/KernelKit/IDylibObject.h
index 8e7c451a..c872b86f 100644
--- a/dev/Kernel/KernelKit/IDylibObject.h
+++ b/dev/Kernel/KernelKit/IDylibObject.h
@@ -12,7 +12,7 @@
#include <NewKit/Defines.h>
#include <CompilerKit/CompilerKit.h>
-#define NE_DLL_OBJECT : public IDylibObject
+#define NE_DYLIB_OBJECT : public IDylibObject
namespace NeOS
{
diff --git a/dev/Kernel/KernelKit/IPEFDylibObject.h b/dev/Kernel/KernelKit/IPEFDylibObject.h
index 67f36985..20f87410 100644
--- a/dev/Kernel/KernelKit/IPEFDylibObject.h
+++ b/dev/Kernel/KernelKit/IPEFDylibObject.h
@@ -22,7 +22,7 @@ namespace NeOS
* @brief Shared Library class
* Load library from this class
*/
- class IPEFDylibObject final NE_DLL_OBJECT
+ class IPEFDylibObject final NE_DYLIB_OBJECT
{
public:
explicit IPEFDylibObject() = default;
diff --git a/dev/Kernel/KernelKit/PCI/DMA.inl b/dev/Kernel/KernelKit/PCI/DMA.inl
index 0ea2c343..d9c6e551 100644
--- a/dev/Kernel/KernelKit/PCI/DMA.inl
+++ b/dev/Kernel/KernelKit/PCI/DMA.inl
@@ -9,12 +9,12 @@ namespace NeOS
template <class T>
T* DMAWrapper::operator->()
{
- return fAddress;
+ return this->fAddress;
}
template <class T>
T* DMAWrapper::Get(const UIntPtr offset)
{
- return reinterpret_cast<T*>((UIntPtr)fAddress + offset);
+ return reinterpret_cast<T*>((UIntPtr)this->fAddress + offset);
}
} // namespace NeOS
diff --git a/dev/Kernel/KernelKit/PCI/Express.h b/dev/Kernel/KernelKit/PCI/Express.h
index d949fde8..c437a1cb 100644
--- a/dev/Kernel/KernelKit/PCI/Express.h
+++ b/dev/Kernel/KernelKit/PCI/Express.h
@@ -7,5 +7,6 @@
#pragma once
#include <NewKit/Defines.h>
+#include <KernelKit/PCI/PCI.h>
#define PCI_EXPRESS_BUS_COUNT (4096)
diff --git a/dev/Kernel/KernelKit/PCI/IO.h b/dev/Kernel/KernelKit/PCI/IO.h
index b6d491ce..1d60df8e 100644
--- a/dev/Kernel/KernelKit/PCI/IO.h
+++ b/dev/Kernel/KernelKit/PCI/IO.h
@@ -25,6 +25,7 @@ namespace NeOS
: fPorts(ports)
{
}
+
~IOArray()
{
}
@@ -49,11 +50,26 @@ namespace NeOS
Array<UShort, Sz> fPorts;
};
- using IOArray16 = IOArray<16>;
+ inline constexpr UInt16 kMaxPorts = 16;
+
+ using IOArray16 = IOArray<kMaxPorts>;
+
+ template <SizeT Sz>
+ inline Array<UShort, Sz> make_ports(UShort base)
+ {
+ Array<UShort, Sz> ports;
+
+ for (UShort i = 0; i < Sz; ++i)
+ {
+ ports[i] = base + i;
+ }
+
+ return ports;
+ }
} // namespace NeOS
#ifdef __x86_64__
-#include <KernelKit/PCI/IO-Impl-AMD64.inl>
+#include <KernelKit/PCI/IOArray+AMD64.inl>
#else
#error Please provide platform specific code for the I/O
#endif // ifdef __x86_64__
diff --git a/dev/Kernel/KernelKit/PCI/IO-Impl-AMD64.inl b/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl
index 0bac35bc..2630fa98 100644
--- a/dev/Kernel/KernelKit/PCI/IO-Impl-AMD64.inl
+++ b/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl
@@ -51,4 +51,4 @@ namespace NeOS
break;
}
}
-} // namespace NeOS
+} // namespace NeOS \ No newline at end of file