mem.h 834 B

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