bzr branch
http://suren.me/webbzr/alps/pcitool
330
by Suren A. Chilingaryan
Support for 64-bit registes |
1 |
#ifndef _PCILIB_DATACPY_H
|
2 |
#define _PCILIB_DATACPY_H
|
|
3 |
||
4 |
#include <stdio.h> |
|
5 |
#include <stdint.h> |
|
6 |
||
7 |
#include <pcilib.h> |
|
8 |
||
9 |
#ifdef __cplusplus
|
|
10 |
extern "C" { |
|
11 |
#endif
|
|
12 |
||
361
by Suren A. Chilingaryan
Documentation update |
13 |
/**
|
14 |
* The collection of slow memcpy functions to move the data between BAR and system memory.
|
|
15 |
* If necessary the endianess conversion is performed to ensure that the data is encoded
|
|
16 |
* using the specified endianess in the BAR memory and using the native host order in the
|
|
17 |
* system memory. Since endianess conversion is symmetric, it is irrelevant if we are
|
|
18 |
* copying from system memory to BAR memory or vice-versa.
|
|
19 |
*
|
|
20 |
* The hardware may restrict access width or expose different behavior depending on the
|
|
21 |
* access width. These functions access memory using the specified word width only.
|
|
22 |
* 8-, 16-, 32-, and 64-bit wide access is supported.
|
|
23 |
*
|
|
24 |
* @param[out] dst - the destination memory region
|
|
25 |
* @param[in] src - the source memory region
|
|
26 |
* @param[in] access - the size of word (a single memory access) in bytes
|
|
27 |
* @param[in] n - the number of words to copy (\p n * \p access bytes are copied).
|
|
28 |
* @param[in] endianess - the endianess of the data words in the BAR memory
|
|
29 |
* @return - `dst` or NULL on error
|
|
30 |
*/
|
|
31 |
void *pcilib_datacpy(void * dst, void const * src, uint8_t access, size_t n, pcilib_endianess_t endianess); |
|
32 |
||
33 |
/**
|
|
34 |
* The collection of slow memcpy functions to move the data between BAR and system memory.
|
|
35 |
* If necessary the endianess conversion is performed to ensure that the data is encoded
|
|
36 |
* using the specified endianess in the BAR memory and using the native host order in the
|
|
37 |
* system memory. Since endianess conversion is symmetric, it is irrelevant if we are
|
|
38 |
* copying from system memory to BAR memory or vice-versa.
|
|
39 |
*
|
|
40 |
* The hardware may restrict access width or expose different behavior depending on the
|
|
41 |
* access width. This function only perform 32-bit memory accesses.
|
|
42 |
*
|
|
43 |
* @param[out] dst - the destination memory region
|
|
44 |
* @param[in] src - the source memory region
|
|
45 |
* @param[in] n - the number of 32-bit words to copy (4 * \p n bytes are copied)
|
|
46 |
* @param[in] endianess - the endianess of the data words in the BAR memory
|
|
47 |
* @return - `dst` or NULL on error
|
|
48 |
*/
|
|
330
by Suren A. Chilingaryan
Support for 64-bit registes |
49 |
void *pcilib_datacpy32(void * dst, void const * src, size_t n, pcilib_endianess_t endianess); |
361
by Suren A. Chilingaryan
Documentation update |
50 |
|
51 |
/**
|
|
52 |
* The collection of slow memcpy functions to move the data between BAR and system memory.
|
|
53 |
* If necessary the endianess conversion is performed to ensure that the data is encoded
|
|
54 |
* using the specified endianess in the BAR memory and using the native host order in the
|
|
55 |
* system memory. Since endianess conversion is symmetric, it is irrelevant if we are
|
|
56 |
* copying from system memory to BAR memory or vice-versa.
|
|
57 |
*
|
|
58 |
* The hardware may restrict access width or expose different behavior depending on the
|
|
59 |
* access width. This function only perform 64-bit memory accesses.
|
|
60 |
*
|
|
61 |
* @param[out] dst - the destination memory region
|
|
62 |
* @param[in] src - the source memory region
|
|
63 |
* @param[in] n - the number of 64-bit words to copy (8 * \p n bytes are copied)
|
|
64 |
* @param[in] endianess - the endianess of the data words in the BAR memory
|
|
65 |
* @return - `dst` or NULL on error
|
|
66 |
*/
|
|
330
by Suren A. Chilingaryan
Support for 64-bit registes |
67 |
void *pcilib_datacpy64(void * dst, void const * src, size_t n, pcilib_endianess_t endianess); |
68 |
||
69 |
#ifdef __cplusplus
|
|
70 |
}
|
|
71 |
#endif
|
|
72 |
||
73 |
#endif /* _PCILIB_DATACPY_H */ |