diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-30 08:49:23 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-30 08:49:23 +0200 |
| commit | bf642edd6c77d405637f0695452460640b8e540d (patch) | |
| tree | e8e78f658e5eac62790a0fb8129a491183db92d5 /DDKit/KernelDev.h | |
| parent | 60902ec5fc462128d264f63f279c7fc362a72e1d (diff) | |
[Refactor] SCIKit and DDKit.
[IMP} Prevent DDK from being included when we aren't in kernel mode.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'DDKit/KernelDev.h')
| -rw-r--r-- | DDKit/KernelDev.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/DDKit/KernelDev.h b/DDKit/KernelDev.h new file mode 100644 index 00000000..4e640d9d --- /dev/null +++ b/DDKit/KernelDev.h @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies + + Purpose: DDK Devices. + +------------------------------------------- */ + +#pragma once + +#include <DDKit/KernelStd.h> + +struct _kernelDevice; + +/// @brief Kernel Device driver. +typedef struct _kernelDevice +{ + char name[255]; // the device name. Could be /./DEVICE_NAME/ + void* (*read)(void* arg, int len); // read from device. + void (*write)(void* arg, int len); + void (*wait)(void); // write to device. + struct _kernelDevice* (*open)(const char* path); // open device. + void (*close)(struct _kernelDevice* dev); // close device. +} kernelDevice, *kernelDeviceRef; + +/// @brief Open a new device from path. +/// @param devicePath the device's path. +DK_EXTERN kernelDeviceRef kernelOpenDevice(const char* devicePath); + +/// @brief Close any device. +/// @param device valid device. +DK_EXTERN void kernelCloseDevice(kernelDeviceRef device); |
