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

4.104.114.84.95
Last change on this file since 1efeb61 was 1efeb61, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 16, 1998 at 6:22:54 PM

Added css_iface -- assumes ../include/dy_supplied.

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