]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/dpdk/drivers/vdpa/ifc/base/ifcvf_osdep.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / drivers / vdpa / ifc / base / ifcvf_osdep.h
CommitLineData
11fdf7f2
TL
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
3 */
4
5#ifndef _IFCVF_OSDEP_H_
6#define _IFCVF_OSDEP_H_
7
8#include <stdint.h>
9#include <linux/pci_regs.h>
10
11#include <rte_cycles.h>
12#include <rte_pci.h>
13#include <rte_bus_pci.h>
14#include <rte_log.h>
15#include <rte_io.h>
16
17#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args)
18#define STATIC static
19
9f95a23c 20#define msec_delay(x) rte_delay_us_sleep(1000 * (x))
11fdf7f2
TL
21
22#define IFCVF_READ_REG8(reg) rte_read8(reg)
23#define IFCVF_WRITE_REG8(val, reg) rte_write8((val), (reg))
24#define IFCVF_READ_REG16(reg) rte_read16(reg)
25#define IFCVF_WRITE_REG16(val, reg) rte_write16((val), (reg))
26#define IFCVF_READ_REG32(reg) rte_read32(reg)
27#define IFCVF_WRITE_REG32(val, reg) rte_write32((val), (reg))
28
29typedef struct rte_pci_device PCI_DEV;
30
31#define PCI_READ_CONFIG_BYTE(dev, val, where) \
32 rte_pci_read_config(dev, val, 1, where)
33
34#define PCI_READ_CONFIG_DWORD(dev, val, where) \
35 rte_pci_read_config(dev, val, 4, where)
36
37typedef uint8_t u8;
38typedef int8_t s8;
39typedef uint16_t u16;
40typedef int16_t s16;
41typedef uint32_t u32;
42typedef int32_t s32;
43typedef int64_t s64;
44typedef uint64_t u64;
45
46static inline int
47PCI_READ_CONFIG_RANGE(PCI_DEV *dev, uint32_t *val, int size, int where)
48{
49 return rte_pci_read_config(dev, val, size, where);
50}
51
52#endif /* _IFCVF_OSDEP_H_ */