Update version for 3.1.1 release
[qemu/ar7.git] / hw / rdma / rdma_utils.h
blob04c7c2ef5b658123994ef7c130efda6f9ba6414b
1 /*
2 * RDMA device: Debug utilities
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
8 * Authors:
9 * Yuval Shaia <yuval.shaia@oracle.com>
10 * Marcel Apfelbaum <marcel@redhat.com>
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.
17 #ifndef RDMA_UTILS_H
18 #define RDMA_UTILS_H
20 #include "qemu/osdep.h"
21 #include "hw/pci/pci.h"
22 #include "sysemu/dma.h"
24 #define pr_info(fmt, ...) \
25 fprintf(stdout, "%s: %-20s (%3d): " fmt, "rdma", __func__, __LINE__,\
26 ## __VA_ARGS__)
28 #define pr_err(fmt, ...) \
29 fprintf(stderr, "%s: Error at %-20s (%3d): " fmt, "rdma", __func__, \
30 __LINE__, ## __VA_ARGS__)
32 #ifdef PVRDMA_DEBUG
33 extern unsigned long pr_dbg_cnt;
35 #define init_pr_dbg(void) \
36 { \
37 pr_dbg_cnt = 0; \
40 #define pr_dbg(fmt, ...) \
41 fprintf(stdout, "%lx %ld: %-20s (%3d): " fmt, pthread_self(), pr_dbg_cnt++, \
42 __func__, __LINE__, ## __VA_ARGS__)
43 #else
44 #define init_pr_dbg(void)
45 #define pr_dbg(fmt, ...)
46 #endif
48 void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t plen);
49 void rdma_pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t len);
51 #endif