summaryrefslogtreecommitdiffhomepage
path: root/src/libDDK/DriverKit
diff options
context:
space:
mode:
Diffstat (limited to 'src/libDDK/DriverKit')
-rw-r--r--src/libDDK/DriverKit/c++/checksum.h10
-rw-r--r--src/libDDK/DriverKit/c++/ddk.h13
-rw-r--r--src/libDDK/DriverKit/c++/driver_base.h (renamed from src/libDDK/DriverKit/c++/contract.h)6
-rw-r--r--src/libDDK/DriverKit/dev.h3
4 files changed, 29 insertions, 3 deletions
diff --git a/src/libDDK/DriverKit/c++/checksum.h b/src/libDDK/DriverKit/c++/checksum.h
new file mode 100644
index 00000000..0aa206be
--- /dev/null
+++ b/src/libDDK/DriverKit/c++/checksum.h
@@ -0,0 +1,10 @@
+/* ========================================
+
+ Copyright Amlal El Mahrouss 2025, licensed under the Apache 2.0 license.
+
+ FILE: checksum.h
+ PURPOSE: Object DDK checksums.
+
+ ======================================== */
+
+#pragma once \ No newline at end of file
diff --git a/src/libDDK/DriverKit/c++/ddk.h b/src/libDDK/DriverKit/c++/ddk.h
new file mode 100644
index 00000000..2c83f935
--- /dev/null
+++ b/src/libDDK/DriverKit/c++/ddk.h
@@ -0,0 +1,13 @@
+/* ========================================
+
+ Copyright Amlal El Mahrouss 2025, licensed under the Apache 2.0 license.
+
+ FILE: ddk.h
+ PURPOSE: Object DDK header.
+
+ ======================================== */
+
+#pragma once
+
+#include <DriverKit/c++/driver_base.h>
+#include <DriverKit/c++/checksum.h>
diff --git a/src/libDDK/DriverKit/c++/contract.h b/src/libDDK/DriverKit/c++/driver_base.h
index e341f1a0..89cc04d8 100644
--- a/src/libDDK/DriverKit/c++/contract.h
+++ b/src/libDDK/DriverKit/c++/driver_base.h
@@ -2,8 +2,8 @@
Copyright Amlal El Mahrouss 2025, licensed under the Apache 2.0 license.
- FILE: ddk.h
- PURPOSE: Driver Kernel Interface Model base header.
+ FILE: driver_base.h
+ PURPOSE: IDriverBase and friends.
======================================== */
@@ -41,8 +41,8 @@ concept IsValidDriver = requires(T a) {
{ a.IsActive() && a.Type() > 0 };
};
+/// @brief Consteval helper to detect whether a template is truly based on IDriverBase.
/// @note This helper is consteval only.
template<IsValidDriver T>
inline consteval void ce_ddk_is_valid(T) {}
-
} // namespace Kernel::DDK
diff --git a/src/libDDK/DriverKit/dev.h b/src/libDDK/DriverKit/dev.h
index a88a00dd..1dda544e 100644
--- a/src/libDDK/DriverKit/dev.h
+++ b/src/libDDK/DriverKit/dev.h
@@ -27,6 +27,9 @@ typedef struct _DDK_DEVICE DDK_FINAL {
size_t (*d_tell)(struct _DDK_DEVICE* dev);
} DDK_DEVICE, *DDK_DEVICE_PTR;
+#define kopen kopen_dev
+#define kclose kclose_dev
+
/// @brief Open a new device from path.
/// @param path the device's path.
DDK_EXTERN DDK_DEVICE_PTR kopen_dev(const char* path);