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

4.104.114.95
Last change on this file since 4243433 was 4243433, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 18, 2008 at 9:17:16 PM

2008-08-18 Joel Sherrill <joel.sherrill@…>

  • irq/irq_init.c: Fix warnings.
  • Property mode set to 100644
File size: 2.2 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
25static rtems_irq_connect_data      rtemsIrq[BSP_IRQ_NUMBER];
26static rtems_irq_global_settings   initial_config;
27static rtems_irq_connect_data      defaultIrq = {
28  /* vectorIdex, hdl  , handle  , on  , off , isOn */
29      0,          NULL, NULL    , NULL, NULL, NULL
30};
31static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER]={
32  /*
33   * Processor exceptions handled as interrupts
34   */
35  0
36};
37
38  /*
39   * This code assumes the exceptions management setup has already
40   * been done. We just need to replace the exceptions that will
41   * be handled like interrupt. On mcp750/mpc750 and many PPC processors
42   * this means the decrementer exception and the external exception.
43   */
44void BSP_rtems_irq_mng_init(unsigned cpuId)
45{
46  int i;
47 
48  /*
49   * First initialize the Interrupt management hardware
50   */
51
52  /*
53   * Initialize Rtems management interrupt table
54   */
55  /*
56   * re-init the rtemsIrq table
57   */
58  for (i = 0; i < BSP_IRQ_NUMBER; i++) {
59    rtemsIrq[i]      = defaultIrq;
60    rtemsIrq[i].name = i;
61  }
62  /*
63   * Init initial Interrupt management config
64   */
65  initial_config.irqNb        = BSP_IRQ_NUMBER;
66  initial_config.defaultEntry = defaultIrq;
67  initial_config.irqHdlTbl    = rtemsIrq;
68  initial_config.irqBase      = BSP_LOWEST_OFFSET;
69  initial_config.irqPrioTbl   = irqPrioTable;
70
71  if (!BSP_rtems_irq_mngt_set(&initial_config)) {
72    /*
73     * put something here that will show the failure...
74     */
75    BSP_panic(
76      "Unable to initialize RTEMS interrupt Management!!! System locked\n"
77    );
78  }
79 
80  #ifdef TRACE_IRQ_INIT 
81    printk("RTEMS IRQ management is now operationnal\n");
82  #endif
83}
Note: See TracBrowser for help on using the repository browser.