risc-v/espressif: Panic if CPU interrupt allocation fails
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
parent
7aecd751f0
commit
8be8aab9bb
@ -422,8 +422,7 @@ void esp_route_intr(int source, int cpuint, irq_priority_t priority,
|
|||||||
* type - Interrupt trigger type.
|
* type - Interrupt trigger type.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* The allocated CPU interrupt on success, a negated errno value on
|
* Allocated CPU interrupt.
|
||||||
* failure.
|
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -449,11 +448,10 @@ int esp_setup_irq(int source, irq_priority_t priority, irq_trigger_t type)
|
|||||||
cpuint = esp_cpuint_alloc(irq);
|
cpuint = esp_cpuint_alloc(irq);
|
||||||
if (cpuint < 0)
|
if (cpuint < 0)
|
||||||
{
|
{
|
||||||
irqerr("Unable to allocate CPU interrupt for priority=%d and type=%d",
|
_alert("Unable to allocate CPU interrupt for source=%d\n",
|
||||||
priority, type);
|
priority, type);
|
||||||
leave_critical_section(irqstate);
|
|
||||||
|
|
||||||
return cpuint;
|
PANIC();
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_route_intr(source, cpuint, priority, type);
|
esp_route_intr(source, cpuint, priority, type);
|
||||||
|
@ -115,8 +115,7 @@ void esp_route_intr(int source, int cpuint, irq_priority_t priority,
|
|||||||
* type - Interrupt trigger type.
|
* type - Interrupt trigger type.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* The allocated CPU interrupt on success, a negated errno value on
|
* Allocated CPU interrupt.
|
||||||
* failure.
|
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
@ -493,10 +493,6 @@ static int esp_attach(uart_dev_t *dev)
|
|||||||
|
|
||||||
priv->cpuint = esp_setup_irq(priv->source, priv->int_pri,
|
priv->cpuint = esp_setup_irq(priv->source, priv->int_pri,
|
||||||
ESP_IRQ_TRIGGER_LEVEL);
|
ESP_IRQ_TRIGGER_LEVEL);
|
||||||
if (priv->cpuint < 0)
|
|
||||||
{
|
|
||||||
return priv->cpuint;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Attach and enable the IRQ */
|
/* Attach and enable the IRQ */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user