irq: multilevel: compile 3rd level IRQ APIs only when enabled
This revert the idea of 3fa7d78 from #78845.
The 3rd level IRQ APIs won't compile when
CONFIG_3RD_LEVEL_INTERRUPT_BITS=0.
Updated testcases accordingly.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
@ -241,6 +252,7 @@ static inline unsigned int irq_parent_level_3(unsigned int irq)
@@ -241,6 +252,7 @@ static inline unsigned int irq_parent_level_3(unsigned int irq)
return_z_l2_irq(z_irq);
}
#endif /* CONFIG_3RD_LEVEL_INTERRUPTS */
/**
*@briefReturntheinterruptnumberforagivenlevel
@ -256,11 +268,14 @@ static inline unsigned int irq_from_level(unsigned int irq, unsigned int level)
@@ -256,11 +268,14 @@ static inline unsigned int irq_from_level(unsigned int irq, unsigned int level)
returnirq;
}elseif(level==2){
returnirq_from_level_2(irq);
}elseif(level==3){
}
#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
elseif(level==3){
returnirq_from_level_3(irq);
}
#endif /* CONFIG_3RD_LEVEL_INTERRUPTS */
/* level is higher than 3 */
/* level is higher than what's supported */
__ASSERT_NO_MSG(false);
returnirq;
}
@ -279,11 +294,14 @@ static inline unsigned int irq_to_level(unsigned int irq, unsigned int level)
@@ -279,11 +294,14 @@ static inline unsigned int irq_to_level(unsigned int irq, unsigned int level)
returnirq;
}elseif(level==2){
returnirq_to_level_2(irq);
}elseif(level==3){
}
#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
elseif(level==3){
returnirq_to_level_3(irq);
}
#endif /* CONFIG_3RD_LEVEL_INTERRUPTS */
/* level is higher than 3 */
/* level is higher than what's supported */
__ASSERT_NO_MSG(false);
returnirq;
}
@ -303,11 +321,14 @@ static inline unsigned int irq_parent_level(unsigned int irq, unsigned int level
@@ -303,11 +321,14 @@ static inline unsigned int irq_parent_level(unsigned int irq, unsigned int level
returnirq;
}elseif(level==2){
returnirq_parent_level_2(irq);
}elseif(level==3){
}
#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
elseif(level==3){
returnirq_parent_level_3(irq);
}
#endif /* CONFIG_3RD_LEVEL_INTERRUPTS */
/* level is higher than 3 */
/* level is higher than what's supported */
__ASSERT_NO_MSG(false);
returnirq;
}
@ -322,19 +343,24 @@ static inline unsigned int irq_parent_level(unsigned int irq, unsigned int level
@@ -322,19 +343,24 @@ static inline unsigned int irq_parent_level(unsigned int irq, unsigned int level
@ -351,8 +377,12 @@ static inline unsigned int irq_increment(unsigned int irq, unsigned int val)
@@ -351,8 +377,12 @@ static inline unsigned int irq_increment(unsigned int irq, unsigned int val)