2008-09-19 06:56:32 +08:00
|
|
|
/****************************************************************************
|
2014-08-09 04:31:15 +08:00
|
|
|
* sched/irq/irq_initialize.c
|
2007-02-18 07:21:28 +08:00
|
|
|
*
|
2024-09-11 19:45:11 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
2021-02-08 23:33:58 +08: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 07:21:28 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-02-18 07:21:28 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08: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 07:21:28 +08:00
|
|
|
*
|
2008-09-19 06:56:32 +08:00
|
|
|
****************************************************************************/
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2008-09-19 06:56:32 +08:00
|
|
|
/****************************************************************************
|
2007-02-18 07:21:28 +08:00
|
|
|
* Included Files
|
2008-09-19 06:56:32 +08:00
|
|
|
****************************************************************************/
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2009-12-15 02:39:29 +08:00
|
|
|
#include <nuttx/config.h>
|
2007-02-18 07:21:28 +08:00
|
|
|
#include <nuttx/arch.h>
|
|
|
|
#include <nuttx/irq.h>
|
2023-02-22 11:08:22 +08:00
|
|
|
#include <nuttx/trace.h>
|
2012-07-15 03:30:31 +08:00
|
|
|
|
2014-08-09 04:31:15 +08:00
|
|
|
#include "irq/irq.h"
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2017-03-03 22:55:16 +08: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 06:56:32 +08:00
|
|
|
/****************************************************************************
|
2015-10-03 06:30:35 +08:00
|
|
|
* Public Data
|
2008-09-19 06:56:32 +08:00
|
|
|
****************************************************************************/
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2017-03-03 22:55:16 +08: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 07:21:28 +08:00
|
|
|
|
2008-09-19 06:56:32 +08:00
|
|
|
/****************************************************************************
|
2007-02-18 07:21:28 +08:00
|
|
|
* Public Functions
|
2008-09-19 06:56:32 +08:00
|
|
|
****************************************************************************/
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2008-09-19 06:56:32 +08:00
|
|
|
/****************************************************************************
|
2012-07-15 03:30:31 +08:00
|
|
|
* Name: irq_initialize
|
2007-02-18 07:21:28 +08:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Configure the IRQ subsystem
|
|
|
|
*
|
2008-09-19 06:56:32 +08:00
|
|
|
****************************************************************************/
|
2007-02-18 07:21:28 +08:00
|
|
|
|
|
|
|
void irq_initialize(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2023-02-22 11:08:22 +08:00
|
|
|
sched_trace_begin();
|
|
|
|
|
2007-02-18 07:21:28 +08:00
|
|
|
/* Point all interrupt vectors to the unexpected interrupt */
|
|
|
|
|
2017-03-03 22:55:16 +08:00
|
|
|
for (i = 0; i < TAB_SIZE; i++)
|
2007-02-18 07:21:28 +08:00
|
|
|
{
|
2017-02-27 20:27:56 +08:00
|
|
|
g_irqvector[i].handler = irq_unexpected_isr;
|
2007-02-18 07:21:28 +08:00
|
|
|
}
|
2018-08-25 05:10:23 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_IRQCHAIN
|
|
|
|
/* Initialize IRQ chain support */
|
|
|
|
|
|
|
|
irqchain_initialize();
|
|
|
|
#endif
|
2020-02-07 14:41:58 +08:00
|
|
|
|
|
|
|
up_irqinitialize();
|
2023-02-22 11:08:22 +08:00
|
|
|
sched_trace_end();
|
2007-02-18 07:21:28 +08:00
|
|
|
}
|