-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arch: sw_isr: rework the multilevel lookup table
Previously the multilevel irq lookup table is generated by looping through the devicetree nodes using macros & Kconfig. This PR shifts the heavy lifting to devicetree & DT macros such that an interrupt controller can register itself directly with the lookup table. Signed-off-by: Yong Cong Sin <[email protected]>
- Loading branch information
Showing
9 changed files
with
202 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* @file | ||
* @brief Interrupt controller devicetree macro public API header file. | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2023 Meta | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_DEVICETREE_INTERRUPT_CONTROLLER_H_ | ||
#define ZEPHYR_INCLUDE_DEVICETREE_INTERRUPT_CONTROLLER_H_ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <zephyr/devicetree.h> | ||
#include <zephyr/sys/util_macro.h> | ||
|
||
/** | ||
* @defgroup devicetree-interrupt_controller Devicetree Interrupt Controller API | ||
* @ingroup devicetree | ||
* @{ | ||
*/ | ||
|
||
/** | ||
* @brief Get the order of an interrupt controller | ||
* | ||
* @param node_id node identifier of an interrupt controller | ||
* | ||
* @return Order of the interrupt controller | ||
*/ | ||
#define DT_INTC_GET_LEVEL(node_id) UTIL_INC(DT_CAT(node_id, _IRQ_LEVEL)) | ||
|
||
/** | ||
* @brief Get the `DT_DRV_COMPAT` order of an interrupt controller | ||
* | ||
* @param inst instance of an interrupt controller | ||
* | ||
* @return Order of the interrupt controller | ||
*/ | ||
#define DT_INST_INTC_GET_LEVEL(inst) DT_INTC_GET_LEVEL(DT_DRV_INST(inst)) | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* ZEPHYR_INCLUDE_DEVICETREE_INTERRUPT_CONTROLLER_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.