summaryrefslogtreecommitdiffhomepage
path: root/dev/ddk/dev.h
diff options
context:
space:
mode:
authorAmlal <amlal@el-mahrouss-logic.com>2024-09-28 19:13:46 +0200
committerAmlal <amlal@el-mahrouss-logic.com>2024-09-28 19:13:46 +0200
commit421db65331663304466577b7187780d9eba18077 (patch)
tree3c7c4dc68537935b8cf98313e6a5bfe51786b7d2 /dev/ddk/dev.h
parentb6e416c9986bb545956a642d626e6aafd54f3b76 (diff)
feat: Add common XPCOM controls directory, restructure project, and introduce API breaking changes
- Added a new directory for common XPCOM controls to organize reusable components. - Restructured project layout for better modularity and maintainability. - Introduced API breaking changes in the process, requiring adjustments for backward compatibility. Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/ddk/dev.h')
-rw-r--r--dev/ddk/dev.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/dev/ddk/dev.h b/dev/ddk/dev.h
new file mode 100644
index 00000000..2a3aeb18
--- /dev/null
+++ b/dev/ddk/dev.h
@@ -0,0 +1,32 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+ Purpose: DDK Devices.
+
+------------------------------------------- */
+
+#pragma once
+
+#include <ddk/ddk.h>
+
+struct _KERNEL_DEVICE;
+
+/// @brief Kernel Device driver.
+typedef struct _KERNEL_DEVICE DK_FINAL
+{
+ char d_name[255]; // the device name. Could be /./DEVICE_NAME/
+ void* (*d_read)(void* arg, int len); // read from device.
+ void (*d_write)(void* arg, int len);
+ void (*d_wait)(void); // write to device.
+ struct _KERNEL_DEVICE* (*d_open)(const char* path); // open device.
+ void (*d_close)(struct _KERNEL_DEVICE* dev); // close device.
+} KERNEL_DEVICE, *KERNEL_DEVICE_PTR;
+
+/// @brief Open a new device from path.
+/// @param devicePath the device's path.
+DK_EXTERN KERNEL_DEVICE_PTR KernelOpenDevice(const char* devicePath);
+
+/// @brief Close any device.
+/// @param device valid device.
+DK_EXTERN void KernelCloseDevice(KERNEL_DEVICE_PTR device);