summaryrefslogtreecommitdiffstats
path: root/pcilib/kmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcilib/kmem.h')
-rw-r--r--pcilib/kmem.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/pcilib/kmem.h b/pcilib/kmem.h
index ae690fe..8299379 100644
--- a/pcilib/kmem.h
+++ b/pcilib/kmem.h
@@ -13,7 +13,8 @@ typedef enum {
} pcilib_tristate_t;
#define PCILIB_KMEM_TYPE_MASK 0xFFFF0000
-#define PCILIB_KMEM_USE(type, subtype) (((type) << 16)|(subtype))
+#define PCILIB_KMEM_USE(type, subtype) ((pcilib_kmem_use_t)(((type) << 16)|(subtype)))
+
typedef enum {
PCILIB_KMEM_TYPE_CONSISTENT = 0x00000,
@@ -95,6 +96,10 @@ struct pcilib_kmem_list_s {
pcilib_kmem_buffer_t buf; // variable size, should be last item in struct
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
pcilib_kmem_handle_t *pcilib_alloc_kernel_memory(pcilib_t *ctx, pcilib_kmem_type_t type, size_t nmemb, size_t size, size_t alignment, pcilib_kmem_use_t use, pcilib_kmem_flags_t flags);
void pcilib_free_kernel_memory(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_kmem_flags_t flags);
//int pcilib_kmem_sync(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_kmem_sync_direction_t dir);
@@ -110,4 +115,8 @@ pcilib_kmem_reuse_state_t pcilib_kmem_is_reused(pcilib_t *ctx, pcilib_kmem_handl
int pcilib_clean_kernel_memory(pcilib_t *ctx, pcilib_kmem_use_t use, pcilib_kmem_flags_t flags);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _PCILIB_KMEM_H */