/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/datacpy.h

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-02 04:47:04 UTC
  • Revision ID: csa@suren.me-20160302044704-wncsxtf6sx0r0tps
Documentation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
extern "C" {
11
11
#endif
12
12
 
 
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
 */
13
49
void *pcilib_datacpy32(void * dst, void const * src, size_t n, pcilib_endianess_t endianess);
 
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
 */
14
67
void *pcilib_datacpy64(void * dst, void const * src, size_t n, pcilib_endianess_t endianess);
15
 
void *pcilib_datacpy(void * dst, void const * src, uint8_t size, size_t n, pcilib_endianess_t endianess);
16
68
 
17
69
#ifdef __cplusplus
18
70
}