mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Changed "struct KernelCallback" to be an union
This commit is contained in:
parent
a265cb59c8
commit
06aa2bb31b
109
DAPI.hpp
109
DAPI.hpp
@ -119,67 +119,72 @@ enum CallbackReason
|
|||||||
InputReason,
|
InputReason,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct KernelCallback
|
union KernelCallback
|
||||||
{
|
{
|
||||||
CallbackReason Reason;
|
|
||||||
void *RawPtr;
|
|
||||||
unsigned long RawData;
|
|
||||||
|
|
||||||
/** @brief When the kernel wants to send a packet. */
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct
|
CallbackReason Reason;
|
||||||
{
|
void *RawPtr;
|
||||||
unsigned char *Data;
|
unsigned long RawData;
|
||||||
unsigned long Length;
|
|
||||||
} Send;
|
|
||||||
|
|
||||||
|
/** @brief When the kernel wants to send a packet. */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
char Name[128];
|
|
||||||
unsigned long MAC;
|
|
||||||
} Fetch;
|
|
||||||
} NetworkCallback;
|
|
||||||
|
|
||||||
/** @brief When the kernel wants to write to disk. */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
unsigned long Sector;
|
|
||||||
unsigned long SectorCount;
|
|
||||||
unsigned char Port;
|
|
||||||
unsigned char *Buffer;
|
|
||||||
bool Write;
|
|
||||||
} RW;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
unsigned char Ports;
|
|
||||||
int BytesPerSector;
|
|
||||||
} Fetch;
|
|
||||||
} DiskCallback;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
unsigned long X;
|
|
||||||
unsigned long Y;
|
|
||||||
unsigned long Z;
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool Left;
|
unsigned char *Data;
|
||||||
bool Right;
|
unsigned long Length;
|
||||||
bool Middle;
|
} Send;
|
||||||
} Buttons;
|
|
||||||
} Mouse;
|
|
||||||
} InputCallback;
|
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned char Vector;
|
char Name[128];
|
||||||
} InterruptInfo;
|
unsigned long MAC;
|
||||||
|
} Fetch;
|
||||||
|
} NetworkCallback;
|
||||||
|
|
||||||
|
/** @brief When the kernel wants to write to disk. */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned long Sector;
|
||||||
|
unsigned long SectorCount;
|
||||||
|
unsigned char Port;
|
||||||
|
unsigned char *Buffer;
|
||||||
|
bool Write;
|
||||||
|
} RW;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned char Ports;
|
||||||
|
int BytesPerSector;
|
||||||
|
} Fetch;
|
||||||
|
} DiskCallback;
|
||||||
|
|
||||||
|
/** @brief When the kernel wants to get mouse position / keyboard key */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned long X;
|
||||||
|
unsigned long Y;
|
||||||
|
unsigned long Z;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool Left;
|
||||||
|
bool Right;
|
||||||
|
bool Middle;
|
||||||
|
} Buttons;
|
||||||
|
} Mouse;
|
||||||
|
} InputCallback;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned char Vector;
|
||||||
|
} InterruptInfo;
|
||||||
|
};
|
||||||
|
unsigned long raw;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
#endif // !__FENNIX_DRIVER_API_H__
|
#endif // !__FENNIX_DRIVER_API_H__
|
||||||
|
4
Fex.hpp
4
Fex.hpp
@ -58,7 +58,7 @@ struct Fex
|
|||||||
int (*EntryPoint)(void *);
|
int (*EntryPoint)(void *);
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct KernelCallback;
|
union KernelCallback;
|
||||||
|
|
||||||
struct FexExtended
|
struct FexExtended
|
||||||
{
|
{
|
||||||
@ -73,7 +73,7 @@ struct FexExtended
|
|||||||
enum FexDriverType Type : 4;
|
enum FexDriverType Type : 4;
|
||||||
enum FexDriverInputTypes TypeFlags : 4;
|
enum FexDriverInputTypes TypeFlags : 4;
|
||||||
bool OverrideOnConflict : 1;
|
bool OverrideOnConflict : 1;
|
||||||
int (*Callback)(struct KernelCallback *);
|
int (*Callback)(union KernelCallback *);
|
||||||
|
|
||||||
struct DriverBind
|
struct DriverBind
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user