source: rtems/c/src/lib/libbsp/powerpc/dmv177/css_iface/css_iface.c @ fe52766e

4.104.114.84.95
Last change on this file since fe52766e was fe52766e, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 16, 1998 at 7:06:35 PM

Corrected compilation problems.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1#include <bsp.h>
2#include <Css.h>
3#include <dmv170.h>
4#include <assert.h>
5
6css_jump_table_struct         *W_Css_jump_table;
7#define JUMP_TABLE_ADDRESS   ((void **) 0xf0f030a0)
8
9void Init_Css()
10{
11  W_Css_jump_table = *JUMP_TABLE_ADDRESS;
12}
13
14rtems_unsigned32 Css_Id(
15  rtems_vector_number vector        /* vector number      */
16)
17{
18  rtems_unsigned32 id = 0;
19
20  switch ( vector ) {
21    case DMV170_DUART_IRQ:
22      id = CSS_DARF_INT;
23      break;
24
25    case DMV170_MEZZANINE_IRQ_0:
26      id = CSS_MAXPACK_INT;
27      break;
28
29    case DMV170_TICK_IRQ:
30      id = CSS_TICK_INT;
31      break;
32
33    case DMV170_LOCATION_MON_IRQ:
34      id = CSS_LM_INT;
35      break;
36
37    case DMV170_SCV64_IRQ:
38      id = CSS_SCV_VME_INT;
39      break;
40
41    case DMV170_RTC_IRQ:
42      id = CSS_RTC_INT;
43      break;
44  }
45
46  return id;
47}
48
49rtems_vector_number Vector_id(
50  rtems_unsigned32 id
51)
52{
53  rtems_vector_number vector = 0;
54
55  switch ( id ) {
56    case CSS_ACFAIL_INT:
57      vector = DMV170_ACFAIL_IRQ;
58      break;
59    case CSS_SYSFAIL_INT:
60      vector = DMV170_SYSFAIL_IRQ;
61      break;
62    case CSS_WATCHDOG_INT:
63      vector = DMV170_WATCHDOG_IRQ;
64      break;
65    case CSS_BI_INT:
66      vector = DMV170_BI_IRQ;
67      break;
68    case CSS_LM_INT:
69      vector = DMV170_LOCATION_MON_IRQ;
70      break;
71    case CSS_TICK_INT:
72      vector = DMV170_TICK_IRQ;
73      break;
74    case CSS_DARF_INT:
75      vector = DMV170_DUART_IRQ;
76      break;
77    case CSS_RAM_PARITY_INT:
78      vector = DMV170_RAM_PARITY_IRQ;
79      break;
80    case CSS_DARF_BUS_ERROR:
81      vector = DMV170_DARF_BUS_ERROR_IRQ;
82      break;
83    case CSS_PERIPHERAL_INT:
84      vector = DMV170_PERIPHERAL_IRQ;
85      break;
86    case CSS_MAXPACK_INT:
87      assert(0);
88      break;
89    case CSS_SCV_VME_INT:
90      assert(0);
91      break;
92    case CSS_RTC_INT:
93      vector = DMV170_RTC_IRQ;
94      break;
95  }
96
97  return vector;
98}
99
100void enable_card_interrupt( 
101  rtems_vector_number vector        /* vector number      */
102)
103{
104  rtems_unsigned32 Id;
105  Id = Css_Id(vector);
106
107  Enable_int(Id, TRUE);
108}
109
110rtems_vector_number Get_interrupt()
111{
112  rtems_vector_number vector = 0;
113  rtems_unsigned32    id;
114
115  if ( Get_int_status(CSS_ACFAIL_INT) )
116    vector = DMV170_ACFAIL_IRQ;
117  else if ( Get_int_status( CSS_SYSFAIL_INT) )
118    vector = DMV170_SYSFAIL_IRQ;
119  else if ( Get_int_status( CSS_WATCHDOG_INT) )
120    vector = DMV170_WATCHDOG_IRQ;
121  else if ( Get_int_status( CSS_BI_INT) )
122    vector = DMV170_BI_IRQ;
123  else if ( Get_int_status( CSS_LM_INT) )
124    vector = DMV170_LOCATION_MON_IRQ;
125  else if ( Get_int_status( CSS_TICK_INT) )
126    vector = DMV170_TICK_IRQ;
127  else if ( Get_int_status( CSS_DARF_INT) )
128    vector = DMV170_DUART_IRQ;
129  else if ( Get_int_status( CSS_RAM_PARITY_INT) )
130    vector = DMV170_RAM_PARITY_IRQ;
131  else if ( Get_int_status( CSS_DARF_BUS_ERROR) )
132    vector = DMV170_DARF_BUS_ERROR_IRQ;
133  else if ( Get_int_status( CSS_PERIPHERAL_INT) )
134    vector = DMV170_PERIPHERAL_IRQ;
135  else if ( Get_int_status( CSS_MAXPACK_INT) ) {
136    vector = DMV170_MEZZANINE_IRQ_0;
137    assert(0);
138  }
139  else if ( Get_int_status( CSS_SCV_VME_INT) ) {
140    vector = DMV170_MEZZANINE_IRQ_0;
141    assert(0);
142  }
143  else if ( Get_int_status( CSS_RTC_INT) )
144    vector = DMV170_RTC_IRQ;
145
146  return vector;
147}
148
149void Clear_interrupt( 
150  rtems_vector_number vector
151)
152{
153 rtems_unsigned32 Id;
154  Id = Css_Id(vector);
155
156  Clear_int(Id);
157}
Note: See TracBrowser for help on using the repository browser.