Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
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
17#ifndef ZEPHYR_INCLUDE_DRIVERS_INTERRUPT_CONTROLLER_GICV3_ITS_H_
18#define ZEPHYR_INCLUDE_DRIVERS_INTERRUPT_CONTROLLER_GICV3_ITS_H_
19
27
32
43typedef unsigned int (*its_api_alloc_intid_t)(const struct device *dev);
44
78typedef int (*its_api_alloc_map_intids_t)(const struct device *dev, uint32_t device_id,
79 unsigned int count, unsigned int *intid);
80
93typedef int (*its_api_alloc_intids_t)(const struct device *dev, unsigned int count,
94 unsigned int *intid);
95
100typedef int (*its_api_setup_deviceid_t)(const struct device *dev, uint32_t device_id,
101 unsigned int nites);
102
130typedef int (*its_api_map_intid_t)(const struct device *dev, uint32_t device_id,
131 uint32_t event_id, unsigned int intid);
132
137typedef int (*its_api_send_int_t)(const struct device *dev, uint32_t device_id, uint32_t event_id);
138
146typedef uint64_t (*its_api_get_msi_addr_t)(const struct device *dev);
147
167
169
180static inline __deprecated int its_alloc_intid(const struct device *dev)
181{
182 return DEVICE_API_GET(its, dev)->alloc_intid(dev);
183}
184
197static inline int its_alloc_intids(const struct device *dev, unsigned int count,
198 unsigned int *intid)
199{
200 return DEVICE_API_GET(its, dev)->alloc_intids(dev, count, intid);
201}
202
236static inline int its_alloc_map_intids(const struct device *dev, uint32_t device_id,
237 unsigned int count, unsigned int *intid)
238{
239 return DEVICE_API_GET(its, dev)->alloc_map_intids(dev, device_id, count, intid);
240}
241
265static inline int its_setup_deviceid(const struct device *dev, uint32_t device_id,
266 unsigned int nites)
267{
268 return DEVICE_API_GET(its, dev)->setup_deviceid(dev, device_id, nites);
269}
270
298static inline int its_map_intid(const struct device *dev, uint32_t device_id,
299 uint32_t event_id, unsigned int intid)
300{
301 return DEVICE_API_GET(its, dev)->map_intid(dev, device_id, event_id, intid);
302}
303
326static inline int its_send_int(const struct device *dev, uint32_t device_id, uint32_t event_id)
327{
328 return DEVICE_API_GET(its, dev)->send_int(dev, device_id, event_id);
329}
330
341static inline uint64_t its_get_msi_addr(const struct device *dev)
342{
343 return DEVICE_API_GET(its, dev)->get_msi_addr(dev);
344}
345
347
348#endif /* ZEPHYR_INCLUDE_DRIVERS_INTERRUPT_CONTROLLER_GICV3_ITS_H_ */
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1505
int(* its_api_map_intid_t)(const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid)
Callback type for mapping an EventID to an LPI INTID.
Definition gicv3_its.h:130
int(* its_api_send_int_t)(const struct device *dev, uint32_t device_id, uint32_t event_id)
Callback type for sending an interrupt.
Definition gicv3_its.h:137
uint64_t(* its_api_get_msi_addr_t)(const struct device *dev)
Callback type for retrieving the physical MSI target address.
Definition gicv3_its.h:146
int(* its_api_setup_deviceid_t)(const struct device *dev, uint32_t device_id, unsigned int nites)
Callback type for setting up a device ID.
Definition gicv3_its.h:100
unsigned int(* its_api_alloc_intid_t)(const struct device *dev)
Callback type for allocating an LPI INTID.
Definition gicv3_its.h:43
int(* its_api_alloc_map_intids_t)(const struct device *dev, uint32_t device_id, unsigned int count, unsigned int *intid)
Allocate and map consecutive LPI INTIDs to EventIDs starting at zero.
Definition gicv3_its.h:78
int(* its_api_alloc_intids_t)(const struct device *dev, unsigned int count, unsigned int *intid)
Allocate consecutive LPI INTIDs.
Definition gicv3_its.h:93
static int its_setup_deviceid(const struct device *dev, uint32_t device_id, unsigned int nites)
Set up a device ID for an ITS device.
Definition gicv3_its.h:265
static int its_alloc_intid(const struct device *dev)
Allocate an LPI INTID.
Definition gicv3_its.h:180
static int its_send_int(const struct device *dev, uint32_t device_id, uint32_t event_id)
Send an interrupt for an EventID.
Definition gicv3_its.h:326
static int its_alloc_intids(const struct device *dev, unsigned int count, unsigned int *intid)
Allocate consecutive LPI INTIDs.
Definition gicv3_its.h:197
static uint64_t its_get_msi_addr(const struct device *dev)
Get the physical MSI target address for an ITS device.
Definition gicv3_its.h:341
static int its_alloc_map_intids(const struct device *dev, uint32_t device_id, unsigned int count, unsigned int *intid)
Allocate consecutive LPI INTIDs and map them to EventIDs.
Definition gicv3_its.h:236
static int its_map_intid(const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid)
Map an EventID to an LPI INTID.
Definition gicv3_its.h:298
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Runtime device structure (in ROM) per driver instance.
Definition device.h:543
<span class="mlabel">Driver Operations</span> GICv3 ITS driver operations
Definition gicv3_its.h:151
its_api_map_intid_t map_intid
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:157
its_api_setup_deviceid_t setup_deviceid
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:155
its_api_get_msi_addr_t get_msi_addr
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:161
its_api_alloc_intids_t alloc_intids
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:163
its_api_alloc_map_intids_t alloc_map_intids
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:165
its_api_send_int_t send_int
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:159
its_api_alloc_intid_t alloc_intid
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition gicv3_its.h:153