summaryrefslogtreecommitdiffstats
path: root/pcilib/datacpy.h
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-02 10:28:04 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-02 10:28:04 +0100
commit8e7c95957ee73d6c11ef28f7c0e2319a11103783 (patch)
tree83df220932b3d88e071eda4c756e485dd48d50e9 /pcilib/datacpy.h
parent8719b84a95805d109e21c20f05a0164315e1b38a (diff)
parent867bddcf7be374221a04b7ae89f93a5f5d703ee6 (diff)
downloadpcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.tar.gz
pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.tar.bz2
pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.tar.xz
pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.zip
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 362 revision
Diffstat (limited to 'pcilib/datacpy.h')
-rw-r--r--pcilib/datacpy.h54
1 files changed, 53 insertions, 1 deletions
diff --git a/pcilib/datacpy.h b/pcilib/datacpy.h
index 1ce2e79..e807e01 100644
--- a/pcilib/datacpy.h
+++ b/pcilib/datacpy.h
@@ -10,9 +10,61 @@
extern "C" {
#endif
+/**
+ * The collection of slow memcpy functions to move the data between BAR and system memory.
+ * If necessary the endianess conversion is performed to ensure that the data is encoded
+ * using the specified endianess in the BAR memory and using the native host order in the
+ * system memory. Since endianess conversion is symmetric, it is irrelevant if we are
+ * copying from system memory to BAR memory or vice-versa.
+ *
+ * The hardware may restrict access width or expose different behavior depending on the
+ * access width. These functions access memory using the specified word width only.
+ * 8-, 16-, 32-, and 64-bit wide access is supported.
+ *
+ * @param[out] dst - the destination memory region
+ * @param[in] src - the source memory region
+ * @param[in] access - the size of word (a single memory access) in bytes
+ * @param[in] n - the number of words to copy (\p n * \p access bytes are copied).
+ * @param[in] endianess - the endianess of the data words in the BAR memory
+ * @return - `dst` or NULL on error
+ */
+void *pcilib_datacpy(void * dst, void const * src, uint8_t access, size_t n, pcilib_endianess_t endianess);
+
+/**
+ * The collection of slow memcpy functions to move the data between BAR and system memory.
+ * If necessary the endianess conversion is performed to ensure that the data is encoded
+ * using the specified endianess in the BAR memory and using the native host order in the
+ * system memory. Since endianess conversion is symmetric, it is irrelevant if we are
+ * copying from system memory to BAR memory or vice-versa.
+ *
+ * The hardware may restrict access width or expose different behavior depending on the
+ * access width. This function only perform 32-bit memory accesses.
+ *
+ * @param[out] dst - the destination memory region
+ * @param[in] src - the source memory region
+ * @param[in] n - the number of 32-bit words to copy (4 * \p n bytes are copied)
+ * @param[in] endianess - the endianess of the data words in the BAR memory
+ * @return - `dst` or NULL on error
+ */
void *pcilib_datacpy32(void * dst, void const * src, size_t n, pcilib_endianess_t endianess);
+
+/**
+ * The collection of slow memcpy functions to move the data between BAR and system memory.
+ * If necessary the endianess conversion is performed to ensure that the data is encoded
+ * using the specified endianess in the BAR memory and using the native host order in the
+ * system memory. Since endianess conversion is symmetric, it is irrelevant if we are
+ * copying from system memory to BAR memory or vice-versa.
+ *
+ * The hardware may restrict access width or expose different behavior depending on the
+ * access width. This function only perform 64-bit memory accesses.
+ *
+ * @param[out] dst - the destination memory region
+ * @param[in] src - the source memory region
+ * @param[in] n - the number of 64-bit words to copy (8 * \p n bytes are copied)
+ * @param[in] endianess - the endianess of the data words in the BAR memory
+ * @return - `dst` or NULL on error
+ */
void *pcilib_datacpy64(void * dst, void const * src, size_t n, pcilib_endianess_t endianess);
-void *pcilib_datacpy(void * dst, void const * src, uint8_t size, size_t n, pcilib_endianess_t endianess);
#ifdef __cplusplus
}