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