/alps/pcitool

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