summaryrefslogtreecommitdiffstats
path: root/pcilib/mem.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcilib/mem.h')
-rw-r--r--pcilib/mem.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/pcilib/mem.h b/pcilib/mem.h
new file mode 100644
index 0000000..2e3ac02
--- /dev/null
+++ b/pcilib/mem.h
@@ -0,0 +1,29 @@
+#ifndef _PCILIB_MEM_H
+#define _PCILIB_MEM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Maps the specified memory area in the address space of the process.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] addr - hardware address (should be page-aligned)
+ * @param[in] size - size (should be multiple of page size)
+ * return - the address where the memory area is mapped
+ */
+void *pcilib_map_area(pcilib_t *ctx, uintptr_t addr, size_t size);
+
+/**
+ * Unmaps the specified memory area in the address space of the process.
+ * @param[in,out] ctx - pcilib context
+ * @param[in] addr - pointer to the virtual address where the area is mapped
+ * @param[in] size - size (should be multiple of page size)
+ */
+void pcilib_unmap_area(pcilib_t *ctx, void *addr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PCILIB_MEM_H */