1
1
#ifndef _PCILIB_KMEM_H
2
2
#define _PCILIB_KMEM_H
4
typedef struct pcilib_s pcilib_t;
6
5
typedef struct pcilib_kmem_list_s pcilib_kmem_list_t;
11
PCILIB_KMEM_FLAG_REUSE = KMEM_FLAG_REUSE,
12
PCILIB_KMEM_FLAG_EXCLUSIVE = KMEM_FLAG_EXCLUSIVE,
13
PCILIB_KMEM_FLAG_PERSISTENT = KMEM_FLAG_PERSISTENT,
14
PCILIB_KMEM_FLAG_HARDWARE = KMEM_FLAG_HW,
15
PCILIB_KMEM_FLAG_FORCE = KMEM_FLAG_FORCE,
16
PCILIB_KMEM_FLAG_TRY = KMEM_FLAG_TRY
8
PCILIB_TRISTATE_NO = 0,
9
PCILIB_TRISTATE_PARTIAL = 1,
10
PCILIB_TRISTATE_YES = 2
13
#define PCILIB_KMEM_TYPE_MASK 0xFFFF0000
14
#define PCILIB_KMEM_USE(type, subtype) (((type) << 16)|(subtype))
17
PCILIB_KMEM_TYPE_CONSISTENT = 0x00000,
18
PCILIB_KMEM_TYPE_PAGE = 0x10000,
19
PCILIB_KMEM_TYPE_DMA_S2C_PAGE = 0x10001,
20
PCILIB_KMEM_TYPE_DMA_C2S_PAGE = 0x10002,
21
PCILIB_KMEM_TYPE_REGION = 0x20000,
22
PCILIB_KMEM_TYPE_REGION_S2C = 0x20001,
23
PCILIB_KMEM_TYPE_REGION_C2S = 0x20002
27
PCILIB_KMEM_USE_STANDARD = 0,
28
PCILIB_KMEM_USE_DMA_RING = 1,
29
PCILIB_KMEM_USE_DMA_PAGES = 2,
30
PCILIB_KMEM_USE_USER = 0x10
34
PCILIB_KMEM_SYNC_BIDIRECTIONAL = 0,
35
PCILIB_KMEM_SYNC_TODEVICE = 1,
36
PCILIB_KMEM_SYNC_FROMDEVICE = 2
37
} pcilib_kmem_sync_direction_t;
40
PCILIB_KMEM_FLAG_REUSE = 1, /**< Try to reuse existing buffer with the same use & item */
41
PCILIB_KMEM_FLAG_EXCLUSIVE = 2, /**< Allow only a single application accessing a specified use & item */
42
PCILIB_KMEM_FLAG_PERSISTENT = 4, /**< Sets persistent mode */
43
PCILIB_KMEM_FLAG_HARDWARE = 8, /**< The buffer may be accessed by hardware, the hardware access will not occur any more if passed to _free function */
44
PCILIB_KMEM_FLAG_FORCE = 16, /**< Force memory cleanup even if references are present */
45
PCILIB_KMEM_FLAG_MASS = 32, /**< Apply to all buffers of selected use */
46
PCILIB_KMEM_FLAG_TRY = 64 /**< Do not allocate buffers, try to reuse and fail if not possible */
17
47
} pcilib_kmem_flags_t;