Zephyr API 3.6.99
Loading...
Searching...
No Matches
gicv3_its.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 BayLibre, SAS
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
16#ifndef ZEPHYR_INCLUDE_DRIVERS_GICV3_ITS_H_
17#define ZEPHYR_INCLUDE_DRIVERS_GICV3_ITS_H_
18
19typedef unsigned int (*its_api_alloc_intid_t)(const struct device *dev);
20typedef int (*its_api_setup_deviceid_t)(const struct device *dev, uint32_t device_id,
21 unsigned int nites);
22typedef int (*its_api_map_intid_t)(const struct device *dev, uint32_t device_id,
23 uint32_t event_id, unsigned int intid);
24typedef int (*its_api_send_int_t)(const struct device *dev, uint32_t device_id, uint32_t event_id);
25typedef uint32_t (*its_api_get_msi_addr_t)(const struct device *dev);
26
34
35static inline int its_alloc_intid(const struct device *dev)
36{
37 const struct its_driver_api *api =
38 (const struct its_driver_api *)dev->api;
39
40 return api->alloc_intid(dev);
41}
42
43static inline int its_setup_deviceid(const struct device *dev, uint32_t device_id,
44 unsigned int nites)
45{
46 const struct its_driver_api *api =
47 (const struct its_driver_api *)dev->api;
48
49 return api->setup_deviceid(dev, device_id, nites);
50}
51
52static inline int its_map_intid(const struct device *dev, uint32_t device_id,
53 uint32_t event_id, unsigned int intid)
54{
55 const struct its_driver_api *api =
56 (const struct its_driver_api *)dev->api;
57
58 return api->map_intid(dev, device_id, event_id, intid);
59}
60
61static inline int its_send_int(const struct device *dev, uint32_t device_id, uint32_t event_id)
62{
63 const struct its_driver_api *api =
64 (const struct its_driver_api *)dev->api;
65
66 return api->send_int(dev, device_id, event_id);
67}
68
69static inline uint32_t its_get_msi_addr(const struct device *dev)
70{
71 const struct its_driver_api *api =
72 (const struct its_driver_api *)dev->api;
73
74 return api->get_msi_addr(dev);
75}
76
77#endif /* ZEPHYR_INCLUDE_DRIVERS_GICV3_ITS_H_ */
static int its_setup_deviceid(const struct device *dev, uint32_t device_id, unsigned int nites)
Definition gicv3_its.h:43
int(* its_api_map_intid_t)(const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid)
Definition gicv3_its.h:22
int(* its_api_send_int_t)(const struct device *dev, uint32_t device_id, uint32_t event_id)
Definition gicv3_its.h:24
int(* its_api_setup_deviceid_t)(const struct device *dev, uint32_t device_id, unsigned int nites)
Definition gicv3_its.h:20
unsigned int(* its_api_alloc_intid_t)(const struct device *dev)
Definition gicv3_its.h:19
static int its_alloc_intid(const struct device *dev)
Definition gicv3_its.h:35
static int its_send_int(const struct device *dev, uint32_t device_id, uint32_t event_id)
Definition gicv3_its.h:61
static int its_map_intid(const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid)
Definition gicv3_its.h:52
uint32_t(* its_api_get_msi_addr_t)(const struct device *dev)
Definition gicv3_its.h:25
static uint32_t its_get_msi_addr(const struct device *dev)
Definition gicv3_its.h:69
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:409
Definition gicv3_its.h:27
its_api_map_intid_t map_intid
Definition gicv3_its.h:30
its_api_setup_deviceid_t setup_deviceid
Definition gicv3_its.h:29
its_api_get_msi_addr_t get_msi_addr
Definition gicv3_its.h:32
its_api_send_int_t send_int
Definition gicv3_its.h:31
its_api_alloc_intid_t alloc_intid
Definition gicv3_its.h:28