event/octeontx2: support event timer
[dpdk.git] / drivers / event / octeontx2 / otx2_tim_evdev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2019 Marvell International Ltd.
3  */
4
5 #ifndef __OTX2_TIM_EVDEV_H__
6 #define __OTX2_TIM_EVDEV_H__
7
8 #include <rte_event_timer_adapter.h>
9
10 #include "otx2_dev.h"
11
12 #define OTX2_TIM_EVDEV_NAME otx2_tim_eventdev
13
14 struct otx2_tim_evdev {
15         struct rte_pci_device *pci_dev;
16         struct otx2_mbox *mbox;
17         uint16_t nb_rings;
18         uintptr_t bar2;
19 };
20
21 static inline struct otx2_tim_evdev *
22 tim_priv_get(void)
23 {
24         const struct rte_memzone *mz;
25
26         mz = rte_memzone_lookup(RTE_STR(OTX2_TIM_EVDEV_NAME));
27         if (mz == NULL)
28                 return NULL;
29
30         return mz->addr;
31 }
32
33 void otx2_tim_init(struct rte_pci_device *pci_dev, struct otx2_dev *cmn_dev);
34 void otx2_tim_fini(void);
35
36 #endif /* __OTX2_TIM_EVDEV_H__ */