rdma_utils.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * RDMA device: Debug utilities
  3. *
  4. * Copyright (C) 2018 Oracle
  5. * Copyright (C) 2018 Red Hat Inc
  6. *
  7. *
  8. * Authors:
  9. * Yuval Shaia <yuval.shaia@oracle.com>
  10. * Marcel Apfelbaum <marcel@redhat.com>
  11. *
  12. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  13. * See the COPYING file in the top-level directory.
  14. *
  15. */
  16. #ifndef RDMA_UTILS_H
  17. #define RDMA_UTILS_H
  18. #include "qemu/osdep.h"
  19. #include "hw/pci/pci.h"
  20. #include "sysemu/dma.h"
  21. #define pr_info(fmt, ...) \
  22. fprintf(stdout, "%s: %-20s (%3d): " fmt, "pvrdma", __func__, __LINE__,\
  23. ## __VA_ARGS__)
  24. #define pr_err(fmt, ...) \
  25. fprintf(stderr, "%s: Error at %-20s (%3d): " fmt, "pvrdma", __func__, \
  26. __LINE__, ## __VA_ARGS__)
  27. #ifdef PVRDMA_DEBUG
  28. #define pr_dbg(fmt, ...) \
  29. fprintf(stdout, "%s: %-20s (%3d): " fmt, "pvrdma", __func__, __LINE__,\
  30. ## __VA_ARGS__)
  31. #else
  32. #define pr_dbg(fmt, ...)
  33. #endif
  34. void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t plen);
  35. void rdma_pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t len);
  36. #endif