summaryrefslogtreecommitdiffhomepage
path: root/src/dalist_impl.h
blob: 97cef118b69a690bfb53bcb78d2af3a13c3d9667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <dalist/dalist.h>

/* internal synonyms and prototypes */
typedef dalist_memfn_custom	memfn_custom;
typedef dalist_memfn_mmap	memfn_mmap;
typedef dalist_memfn_malloc	memfn_malloc;
typedef dalist_memfn_nt_allocvm	memfn_allocvm;


/* memfn_allocvm */
#define NT_STATUS_SUCCESS		0
#define NT_CURRENT_PROCESS_HANDLE	(void *)(uintptr_t)-1
#define NT_PAGE_READWRITE		(0x0004u)
#define NT_MEM_COMMIT			(0x1000u)
#define NT_MEM_RESERVE			(0x2000u)
#define NT_MEM_DECOMMIT			(0x4000u)
#define NT_MEM_RELEASE			(0x8000u)

/* host environment */
#if defined (MIDIPIX_FREESTANDING)
#define dalist_errno(x) x
#define PROT_READ	1
#define PROT_WRITE	2
#define MAP_ANON	0x20
#define MAP_SHARED	0x01
#else
#define dalist_errno(x) errno
#endif

typedef struct _dalist_io_status_block {
	union {
		int32_t		status;
		void *		pointer;
	};
	intptr_t		info;
} dalist_io_status_block, dalist_iosb;


typedef int dalist_dbg_write(
	struct dalist_ex *	dlist,
	intptr_t		fildes_or_hfile,
	const void *		buf,
	size_t			nbyte);