diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-16 06:18:05 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-16 06:18:05 +0200 |
commit | 7ac0539951ff0eba200e64b850b5181a82915c86 (patch) | |
tree | 6d41563807fcadcbf03eb756d8d7d191d3d4446c /kmem.h | |
parent | b3e8d49f41b18d17b40bd8f6926d7db54981e89e (diff) | |
download | pcitool-7ac0539951ff0eba200e64b850b5181a82915c86.tar.gz pcitool-7ac0539951ff0eba200e64b850b5181a82915c86.tar.bz2 pcitool-7ac0539951ff0eba200e64b850b5181a82915c86.tar.xz pcitool-7ac0539951ff0eba200e64b850b5181a82915c86.zip |
Implement DMA access synchronization in the driver
Diffstat (limited to 'kmem.h')
-rw-r--r-- | kmem.h | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -4,15 +4,21 @@ #include "pcilib.h" typedef enum { - PCILIB_KMEM_FLAG_REUSE = 1, /**< Try to reuse buffers on alloc and only unmap non-reused buffers on free (reused are freed only if FORCE flag is specified) */ + PCILIB_KMEM_FLAG_REUSE = KMEM_FLAG_REUSE, + PCILIB_KMEM_FLAG_EXCLUSIVE = KMEM_FLAG_EXCLUSIVE, + PCILIB_KMEM_FLAG_PERSISTENT = KMEM_FLAG_PERSISTENT, + PCILIB_KMEM_FLAG_HARDWARE = KMEM_FLAG_HW // PCILIB_KMEM_FLAG_FORCE = 2 /**< Force buffer } pcilib_kmem_flags_t; typedef enum { - PCILIB_KMEM_REUSE_ALLOCATED = 0, - PCILIB_KMEM_REUSE_PARTIAL = 1, - PCILIB_KMEM_REUSE_REUSED = 2 -} pcilib_kmem_reuse_t; + PCILIB_KMEM_REUSE_REUSED = PCILIB_TRISTATE_YES, + PCILIB_KMEM_REUSE_ALLOCATED = PCILIB_TRISTATE_NO, + PCILIB_KMEM_REUSE_PARTIAL = PCILIB_TRISTATE_PARTIAL, + PCILIB_KMEM_REUSE_PERSISTENT = 0x100, + PCILIB_KMEM_REUSE_HARDWARE = 0x200 +} pcilib_kmem_reuse_state_t; + typedef struct { int handle_id; @@ -33,7 +39,8 @@ typedef struct { */ typedef struct { pcilib_kmem_addr_t addr; - pcilib_kmem_reuse_t reuse; + + pcilib_kmem_reuse_state_t reused; size_t n_blocks; pcilib_kmem_addr_t blocks[]; @@ -57,6 +64,6 @@ uintptr_t pcilib_kmem_get_pa(pcilib_t *ctx, pcilib_kmem_handle_t *k); void *pcilib_kmem_get_block_ua(pcilib_t *ctx, pcilib_kmem_handle_t *k, size_t block); uintptr_t pcilib_kmem_get_block_pa(pcilib_t *ctx, pcilib_kmem_handle_t *k, size_t block); size_t pcilib_kmem_get_block_size(pcilib_t *ctx, pcilib_kmem_handle_t *k, size_t block); -pcilib_kmem_reuse_t pcilib_kmem_is_reused(pcilib_t *ctx, pcilib_kmem_handle_t *k); +pcilib_kmem_reuse_state_t pcilib_kmem_is_reused(pcilib_t *ctx, pcilib_kmem_handle_t *k); #endif /* _PCILIB_KMEM_H */ |