2008-09-19 00:56:32 +02:00
|
|
|
/****************************************************************************
|
2014-08-08 22:31:15 +02:00
|
|
|
* sched/irq/irq_initialize.c
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2024-09-11 13:45:11 +02:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
2021-02-08 16:33:58 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2021-02-08 16:33:58 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2021-02-08 16:33:58 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2008-09-19 00:56:32 +02:00
|
|
|
****************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2008-09-19 00:56:32 +02:00
|
|
|
/****************************************************************************
|
2007-02-18 00:21:28 +01:00
|
|
|
* Included Files
|
2008-09-19 00:56:32 +02:00
|
|
|
****************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2009-12-14 19:39:29 +01:00
|
|
|
#include <nuttx/config.h>
|
2007-02-18 00:21:28 +01:00
|
|
|
#include <nuttx/arch.h>
|
|
|
|
#include <nuttx/irq.h>
|
2023-02-22 04:08:22 +01:00
|
|
|
#include <nuttx/trace.h>
|
2012-07-14 21:30:31 +02:00
|
|
|
|
2014-08-08 22:31:15 +02:00
|
|
|
#include "irq/irq.h"
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2017-03-03 15:55:16 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* This is the number of entries in the interrupt vector table */
|
|
|
|
|
|
|
|
#ifdef CONFIG_ARCH_MINIMAL_VECTORTABLE
|
|
|
|
# define TAB_SIZE CONFIG_ARCH_NUSER_INTERRUPTS
|
|
|
|
#else
|
|
|
|
# define TAB_SIZE NR_IRQS
|
|
|
|
#endif
|
|
|
|
|
2008-09-19 00:56:32 +02:00
|
|
|
/****************************************************************************
|
2015-10-03 00:30:35 +02:00
|
|
|
* Public Data
|
2008-09-19 00:56:32 +02:00
|
|
|
****************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2017-03-03 15:55:16 +01:00
|
|
|
/* This is the interrupt vector table */
|
|
|
|
|
|
|
|
#ifdef CONFIG_ARCH_MINIMAL_VECTORTABLE
|
|
|
|
struct irq_info_s g_irqvector[CONFIG_ARCH_NUSER_INTERRUPTS];
|
|
|
|
#else
|
|
|
|
struct irq_info_s g_irqvector[NR_IRQS];
|
|
|
|
#endif
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2008-09-19 00:56:32 +02:00
|
|
|
/****************************************************************************
|
2007-02-18 00:21:28 +01:00
|
|
|
* Public Functions
|
2008-09-19 00:56:32 +02:00
|
|
|
****************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2008-09-19 00:56:32 +02:00
|
|
|
/****************************************************************************
|
2012-07-14 21:30:31 +02:00
|
|
|
* Name: irq_initialize
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Configure the IRQ subsystem
|
|
|
|
*
|
2008-09-19 00:56:32 +02:00
|
|
|
****************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
void irq_initialize(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2023-02-22 04:08:22 +01:00
|
|
|
sched_trace_begin();
|
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
/* Point all interrupt vectors to the unexpected interrupt */
|
|
|
|
|
2017-03-03 15:55:16 +01:00
|
|
|
for (i = 0; i < TAB_SIZE; i++)
|
2007-02-18 00:21:28 +01:00
|
|
|
{
|
2017-02-27 13:27:56 +01:00
|
|
|
g_irqvector[i].handler = irq_unexpected_isr;
|
2007-02-18 00:21:28 +01:00
|
|
|
}
|
2018-08-24 23:10:23 +02:00
|
|
|
|
|
|
|
#ifdef CONFIG_IRQCHAIN
|
|
|
|
/* Initialize IRQ chain support */
|
|
|
|
|
|
|
|
irqchain_initialize();
|
|
|
|
#endif
|
2020-02-07 07:41:58 +01:00
|
|
|
|
|
|
|
up_irqinitialize();
|
2023-02-22 04:08:22 +01:00
|
|
|
sched_trace_end();
|
2007-02-18 00:21:28 +01:00
|
|
|
}
|