2010-09-14 00:07:22 +04:00
|
|
|
|
2010-09-29 15:59:24 +04:00
|
|
|
|
2010-09-14 00:07:22 +04:00
|
|
|
#ifndef __DDK_H__
|
|
|
|
#define __DDK_H__
|
|
|
|
|
2014-12-27 18:42:08 +03:00
|
|
|
#include <linux/kernel.h>
|
2012-11-13 01:22:52 +04:00
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/spinlock.h>
|
2014-12-27 18:42:08 +03:00
|
|
|
#include <linux/mutex.h>
|
2015-01-04 18:48:58 +03:00
|
|
|
#include <linux/rwsem.h>
|
2012-11-13 01:22:52 +04:00
|
|
|
#include <linux/pci.h>
|
2010-09-29 15:59:24 +04:00
|
|
|
|
2010-09-14 00:07:22 +04:00
|
|
|
|
|
|
|
#define OS_BASE 0x80000000
|
|
|
|
|
|
|
|
#define PG_SW 0x003
|
2013-02-23 13:41:48 +04:00
|
|
|
#define PG_UW 0x007
|
2013-12-17 10:10:28 +04:00
|
|
|
#define PG_NOCACHE 0x018
|
2013-02-23 13:41:48 +04:00
|
|
|
#define PG_SHARED 0x200
|
|
|
|
|
2010-09-14 00:07:22 +04:00
|
|
|
#define MANUAL_DESTROY 0x80000000
|
|
|
|
|
2010-09-27 02:57:18 +04:00
|
|
|
#define ENTER() dbgprintf("enter %s\n",__FUNCTION__)
|
|
|
|
#define LEAVE() dbgprintf("leave %s\n",__FUNCTION__)
|
2012-12-16 23:05:06 +04:00
|
|
|
#define FAIL() dbgprintf("fail %s\n",__FUNCTION__)
|
2010-09-27 02:57:18 +04:00
|
|
|
|
2010-09-14 00:07:22 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2014-12-27 18:42:08 +03:00
|
|
|
u32 code;
|
|
|
|
u32 data[5];
|
2010-09-14 00:07:22 +04:00
|
|
|
}kevent_t;
|
|
|
|
|
|
|
|
typedef union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2014-12-27 18:42:08 +03:00
|
|
|
u32 handle;
|
|
|
|
u32 euid;
|
2010-09-14 00:07:22 +04:00
|
|
|
};
|
2014-12-27 18:42:08 +03:00
|
|
|
u64 raw;
|
2010-09-14 00:07:22 +04:00
|
|
|
}evhandle_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2014-12-27 18:42:08 +03:00
|
|
|
u32 handle;
|
|
|
|
u32 io_code;
|
2010-09-14 00:07:22 +04:00
|
|
|
void *input;
|
|
|
|
int inp_size;
|
|
|
|
void *output;
|
|
|
|
int out_size;
|
|
|
|
}ioctl_t;
|
|
|
|
|
2013-04-25 00:04:21 +04:00
|
|
|
typedef int ( __stdcall *srv_proc_t)(ioctl_t *);
|
2010-09-14 00:07:22 +04:00
|
|
|
|
|
|
|
#define ERR_OK 0
|
|
|
|
#define ERR_PARAM -1
|
|
|
|
|
|
|
|
|
|
|
|
struct ddk_params;
|
|
|
|
|
|
|
|
int ddk_init(struct ddk_params *params);
|
|
|
|
|
2014-12-27 18:42:08 +03:00
|
|
|
u32 drvEntry(int, char *)__asm__("_drvEntry");
|
2010-09-14 00:07:22 +04:00
|
|
|
|
|
|
|
|
2012-11-13 01:22:52 +04:00
|
|
|
|
2010-09-14 00:07:22 +04:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* DDK_H */
|