pagecpy.h 882 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _PCILIB_PAGECPY_H
  2. #define _PCILIB_PAGECPY_H
  3. #include <stdio.h>
  4. #include <stdint.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /**
  9. * This function should be used to move large blocks of non-cached memory between
  10. * aligned memory locations. The function will determine the CPU model and alginment
  11. * and call appropriate implementation. If nothing suitable found, standard memcpy
  12. * will be used. It is OK to call on small or unligned data, the standard memcpy
  13. * will be executed in this case. The memory regions should not intersect.
  14. * Only AVX implementation so far.
  15. * @param[out] dst - destination memory region
  16. * @param[in] src - source memory region
  17. * @param[in] size - size of memory region in bytes.
  18. * @return - `dst` or NULL on error
  19. */
  20. void pcilib_pagecpy(void *dst, const void *src, size_t size);
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif /* _PCILIB_PAGECPY_H */