From bff3cb04a08f27e319f51caaff79722b9675a0e4 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 23 Mar 2023 20:46:19 +0200 Subject: [PATCH] Update Driver API header --- DAPI.hpp | 65 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/DAPI.hpp b/DAPI.hpp index 79b9ee8..270d5b1 100644 --- a/DAPI.hpp +++ b/DAPI.hpp @@ -127,11 +127,6 @@ enum CallbackReason */ ConfigurationReason, - /** - * @brief This will be called when the registered interrupt is triggered. - */ - InterruptReason, - /** * @brief This is used when the kernel wants to stop the driver. * @@ -262,7 +257,7 @@ union KernelCallback /** * @brief Adjust the encoding. - * + * * 0 - None, use default * * 1 - Signed PCM 8-bit @@ -293,10 +288,10 @@ union KernelCallback * * 21 - Float PCM 32-bit Big Endian * 22 - Float PCM 64-bit Big Endian - * + * * 23 - PCM A-law * 24 - PCM Mu-law - * + * * ... - More */ unsigned short Encoding; @@ -324,7 +319,7 @@ union KernelCallback */ unsigned char Channels; } Adjust; - + struct { unsigned char *Data; @@ -348,4 +343,56 @@ union KernelCallback unsigned long raw; } __attribute__((packed)); +union CPURegisters +{ + struct + { +#if defined(__x86_64__) || defined(__amd64__) + unsigned long r15; + unsigned long r14; + unsigned long r13; + unsigned long r12; + unsigned long r11; + unsigned long r10; + unsigned long r9; + unsigned long r8; + + unsigned long rbp; + unsigned long rdi; + unsigned long rsi; + unsigned long rdx; + unsigned long rcx; + unsigned long rbx; + unsigned long rax; + + unsigned long InterruptNumber; + unsigned long ErrorCode; + unsigned long rip; + unsigned long cs; + unsigned long rflags; + unsigned long rsp; + unsigned long ss; +#elif defined(__i386__) || defined(__i686__) + unsigned int ebp; + unsigned int edi; + unsigned int esi; + unsigned int edx; + unsigned int ecx; + unsigned int ebx; + unsigned int eax; + + unsigned int InterruptNumber; + unsigned int ErrorCode; + unsigned int eip; + unsigned int cs; + unsigned int eflags; + unsigned int esp; + unsigned int ss; +#else +#error "Unsupported architecture" +#endif + }; + unsigned long raw; +} __attribute__((packed)); + #endif // !__FENNIX_DRIVER_API_H__