diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-18 09:04:13 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-18 09:04:13 +0100 |
| commit | ed6d2f6007b572b907e3cb11b4303c13d1572c9c (patch) | |
| tree | 47f177336db980a138a91a2fb109db8f1a65086c /src/libDDK | |
| parent | 3a5c7473910156051951f8ec98488a6c91a3eabd (diff) | |
chore: specification updates and patches on the DDK, new source `ddk_c++.cc`.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/libDDK')
| -rw-r--r-- | src/libDDK/DriverKit/c++/driver_base.h | 15 | ||||
| -rw-r--r-- | src/libDDK/src/ddk_c++.cc | 9 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/libDDK/DriverKit/c++/driver_base.h b/src/libDDK/DriverKit/c++/driver_base.h index f43ae0bf..683969f3 100644 --- a/src/libDDK/DriverKit/c++/driver_base.h +++ b/src/libDDK/DriverKit/c++/driver_base.h @@ -3,13 +3,12 @@ Copyright Amlal El Mahrouss 2025, licensed under the Apache 2.0 license. FILE: driver_base.h - PURPOSE: IDriverBase and friends. + PURPOSE: C++ Driver Wrapper. ======================================== */ #pragma once -#include <CompilerKit/CompilerKit.h> #include <libDDK/DriverKit/macros.h> #define DDK_DRIVER_IMPL \ @@ -30,12 +29,12 @@ class IDriverBase { NE_COPY_DELETE(IDriverBase); NE_MOVE_DEFAULT(IDriverBase); - using PtrType = VoidPtr; + using PtrType = void*; - virtual constexpr BOOL IsCastable() { return NO; } - virtual constexpr BOOL IsActive() { return NO; } + virtual constexpr bool IsCastable() { return false; } + virtual constexpr bool IsActive() { return false; } virtual PtrType Leak() { return nullptr; } - virtual constexpr Int32 Type() { return kInvalidType; } + virtual constexpr int32_t Type() { return kInvalidType; } }; /// @brief This concept requires the Driver to be IDriverBase compliant. @@ -46,6 +45,6 @@ concept IsValidDriver = requires(Driver driver_base) { /// @brief Consteval helper to detect whether a template is truly based on IDriverBase. /// @note This helper is consteval only. -template <IsValidDriver T> -consteval void ce_ddk_is_valid(T) {} +template <class Driver> +inline bool ce_ddk_is_valid(Driver drv) { return IsValidDriver<Driver>(drv); } } // namespace Kernel::DDK diff --git a/src/libDDK/src/ddk_c++.cc b/src/libDDK/src/ddk_c++.cc new file mode 100644 index 00000000..920697ac --- /dev/null +++ b/src/libDDK/src/ddk_c++.cc @@ -0,0 +1,9 @@ +/* ======================================== + + Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. + +======================================== */ + +#include <libDDK/DriverKit/c++/driver_base.h> + + |
