2015-04-11 07:44:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014, Wind River Systems, Inc.
|
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Licensed 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
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +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.
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
|
|
|
|
2015-12-04 23:09:39 +08:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Software-managed ISR table
|
|
|
|
*
|
2015-10-21 00:42:33 +08:00
|
|
|
* Data types for a software-managed ISR table, with a parameter per-ISR.
|
2015-07-02 05:22:39 +08:00
|
|
|
*/
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
#ifndef _SW_ISR_TABLE__H_
|
|
|
|
#define _SW_ISR_TABLE__H_
|
|
|
|
|
2016-06-22 03:18:50 +08:00
|
|
|
#include <arch/cpu.h>
|
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
#if !defined(_ASMLANGUAGE)
|
|
|
|
/*
|
|
|
|
* Note the order: arg first, then ISR. This allows a table entry to be
|
2015-04-24 15:40:17 +08:00
|
|
|
* loaded arg -> r0, isr -> r3 in _isr_wrapper with one ldmia instruction,
|
2015-04-11 07:44:37 +08:00
|
|
|
* on ARM Cortex-M (Thumb2).
|
|
|
|
*/
|
|
|
|
struct _IsrTableEntry {
|
|
|
|
void *arg;
|
|
|
|
void (*isr)(void *);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _IsrTableEntry _IsrTableEntry_t;
|
|
|
|
|
2016-01-28 22:24:56 +08:00
|
|
|
#ifdef CONFIG_ARC
|
|
|
|
extern _IsrTableEntry_t _sw_isr_table[CONFIG_NUM_IRQS - 16];
|
2016-06-22 03:18:50 +08:00
|
|
|
#elif CONFIG_NIOS2
|
|
|
|
extern _IsrTableEntry_t _sw_isr_table[NIOS2_NIRQ];
|
2016-01-28 22:24:56 +08:00
|
|
|
#else
|
2015-05-09 06:12:46 +08:00
|
|
|
extern _IsrTableEntry_t _sw_isr_table[CONFIG_NUM_IRQS];
|
2016-01-28 22:24:56 +08:00
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif /* _SW_ISR_TABLE__H_ */
|