File indexing completed on 2025-05-11 08:23:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include <rtems.h>
0019 #include <bsp.h>
0020 #include <bsp/irq.h>
0021 #include <bsp/vectors.h>
0022 #include <rtems/bspIo.h>
0023
0024 #if 0
0025 #include <libcpu/io.h>
0026 #include <libcpu/spr.h>
0027 #include <bsp/pci.h>
0028 #include <bsp/residual.h>
0029 #include <bsp/openpic.h>
0030 #include <bsp/irq.h>
0031 #include <bsp.h>
0032 #include <bsp/motorola.h>
0033 #endif
0034
0035
0036
0037
0038
0039 extern unsigned int external_exception_vector_prolog_code_size[];
0040 extern void external_exception_vector_prolog_code(void);
0041 extern unsigned int decrementer_exception_vector_prolog_code_size[];
0042 extern void decrementer_exception_vector_prolog_code(void);
0043
0044
0045
0046
0047 static void nop_func(void *arg){}
0048
0049 static rtems_irq_connect_data rtemsIrq[BSP_IRQ_NUMBER];
0050 static rtems_irq_global_settings initial_config;
0051 static rtems_irq_prio rtemsPrioTbl[BSP_IRQ_NUMBER];
0052 static rtems_irq_connect_data defaultIrq = {
0053 name: 0,
0054 hdl: nop_func,
0055 handle: 0,
0056 on: 0,
0057 off: 0,
0058 isOn: 0
0059 };
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 void BSP_rtems_irq_mng_init(unsigned cpuId)
0070 {
0071 int i;
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 for (i = BSP_LOWEST_OFFSET; i <= BSP_MAX_OFFSET; i++) {
0085 rtemsIrq[i] = defaultIrq;
0086 rtemsIrq[i].name = i;
0087 rtemsPrioTbl[i] = BSP_IRQ_DEFAULT_PRIORITY;
0088 }
0089
0090
0091
0092
0093 initial_config.irqNb = BSP_IRQ_NUMBER;
0094 initial_config.defaultEntry = defaultIrq;
0095 initial_config.irqHdlTbl = rtemsIrq;
0096 initial_config.irqBase = BSP_LOWEST_OFFSET;
0097 initial_config.irqPrioTbl = rtemsPrioTbl;
0098
0099 if (!BSP_rtems_irq_mngt_set(&initial_config)) {
0100
0101
0102
0103 rtems_panic("Unable to initialize RTEMS interrupt Management!!! System locked\n");
0104 }
0105
0106 #ifdef TRACE_IRQ_INIT
0107 printk("RTEMS IRQ management is now operationnal\n");
0108 #endif
0109 }
0110