source: rtems/c/src/lib/libbsp/powerpc/psim/irq/irq_init.c @ b679966d

4.104.114.95
Last change on this file since b679966d was 1e556198, checked in by Till Straumann <strauman@…>, on 12/11/07 at 05:22:57

2007-12-10 Till Straumann <strauman@…>

  • Makefile.am, irq/irq_init.c: use vector/interrupt support from libcpu/powerpc/new-exceptions/bspsupport.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/* irq_init.c
2 *
3 *  This file contains the implementation of rtems initialization
4 *  related to interrupt handling.
5 *
6 *  CopyRight (C) 1999 valette@crf.canon.fr
7 *
8 * Enhanced by Jay Kulpinski <jskulpin@eng01.gdds.com>
9 * to make it valid for MVME2300 Motorola boards.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  irq_init.c,v 1.6.2.5 2003/09/04 18:45:20 joel Exp
16 */
17
18#include <libcpu/io.h>
19#include <libcpu/spr.h>
20#include <bsp/irq.h>
21#include <bsp.h>
22#include <libcpu/raw_exception.h>
23#include <rtems/bspIo.h>
24
25/*
26 * default on/off function
27 */
28static void nop_func(){}
29/*
30 * default isOn function
31 */
32static int not_connected() {return 0;}
33
34static rtems_irq_connect_data      rtemsIrq[BSP_IRQ_NUMBER];
35static rtems_irq_global_settings   initial_config;
36static rtems_irq_connect_data      defaultIrq = {
37  /* vectorIdex,     hdl   , handle  , on       , off      , isOn */
38      0,          nop_func , NULL    , nop_func , nop_func , not_connected
39};
40static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER]={
41  /*
42   * Processor exceptions handled as interrupts
43   */
44  0
45};
46
47  /*
48   * This code assumes the exceptions management setup has already
49   * been done. We just need to replace the exceptions that will
50   * be handled like interrupt. On mcp750/mpc750 and many PPC processors
51   * this means the decrementer exception and the external exception.
52   */
53void BSP_rtems_irq_mng_init(unsigned cpuId)
54{
55  int i;
56 
57  /*
58   * First initialize the Interrupt management hardware
59   */
60
61  /*
62   * Initialize Rtems management interrupt table
63   */
64  /*
65   * re-init the rtemsIrq table
66   */
67  for (i = 0; i < BSP_IRQ_NUMBER; i++) {
68    rtemsIrq[i]      = defaultIrq;
69    rtemsIrq[i].name = i;
70  }
71  /*
72   * Init initial Interrupt management config
73   */
74  initial_config.irqNb        = BSP_IRQ_NUMBER;
75  initial_config.defaultEntry = defaultIrq;
76  initial_config.irqHdlTbl    = rtemsIrq;
77  initial_config.irqBase      = BSP_LOWEST_OFFSET;
78  initial_config.irqPrioTbl   = irqPrioTable;
79
80  if (!BSP_rtems_irq_mngt_set(&initial_config)) {
81    /*
82     * put something here that will show the failure...
83     */
84    BSP_panic(
85      "Unable to initialize RTEMS interrupt Management!!! System locked\n"
86    );
87  }
88 
89  #ifdef TRACE_IRQ_INIT 
90    printk("RTEMS IRQ management is now operationnal\n");
91  #endif
92}
Note: See TracBrowser for help on using the repository browser.