/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/mem.h

  • Committer: Suren A. Chilingaryan
  • Date: 2016-05-13 23:10:33 UTC
  • Revision ID: csa@suren.me-20160513231033-deh0biipgpln877s
Allow mapping of arbitrary memory areas

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _PCILIB_MEM_H
 
2
#define _PCILIB_MEM_H
 
3
 
 
4
#ifdef __cplusplus
 
5
extern "C" {
 
6
#endif
 
7
 
 
8
/**
 
9
 * Maps the specified memory area in the address space of the process. 
 
10
 * @param[in,out] ctx   - pcilib context
 
11
 * @param[in] addr      - hardware address (should be page-aligned)
 
12
 * @param[in] size      - size (should be multiple of page size)
 
13
 * return               - the address where the memory area is mapped
 
14
 */
 
15
void *pcilib_map_area(pcilib_t *ctx, uintptr_t addr, size_t size);
 
16
 
 
17
/**
 
18
 * Unmaps the specified memory area in the address space of the process. 
 
19
 * @param[in,out] ctx   - pcilib context
 
20
 * @param[in] addr      - pointer to the virtual address where the area is mapped
 
21
 * @param[in] size      - size (should be multiple of page size)
 
22
 */
 
23
void pcilib_unmap_area(pcilib_t *ctx, void *addr, size_t size);
 
24
 
 
25
#ifdef __cplusplus
 
26
}
 
27
#endif
 
28
 
 
29
#endif /* _PCILIB_MEM_H */