i8259.cc (5631:38912b6250d0) i8259.cc (5632:65132fd646c6)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 119 unchanged lines hidden (view full) ---

128 break;
129 case 0x1:
130 DPRINTF(I8259, "Received initialization command word 2.\n");
131 DPRINTF(I8259, "Responsible for vectors %#x-%#x.\n",
132 val & ~mask(3), val | mask(3));
133 if (cascadeMode) {
134 initControlWord++;
135 } else {
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 119 unchanged lines hidden (view full) ---

128 break;
129 case 0x1:
130 DPRINTF(I8259, "Received initialization command word 2.\n");
131 DPRINTF(I8259, "Responsible for vectors %#x-%#x.\n",
132 val & ~mask(3), val | mask(3));
133 if (cascadeMode) {
134 initControlWord++;
135 } else {
136 cascadeBits = 0;
136 initControlWord = 0;
137 }
138 break;
139 case 0x2:
140 DPRINTF(I8259, "Received initialization command word 3.\n");
137 initControlWord = 0;
138 }
139 break;
140 case 0x2:
141 DPRINTF(I8259, "Received initialization command word 3.\n");
141 if (master) {
142 if (master == NULL) {
142 DPRINTF(I8259, "Slaves attached to IRQs:%s%s%s%s%s%s%s%s\n",
143 bits(val, 0) ? " 0" : "",
144 bits(val, 1) ? " 1" : "",
145 bits(val, 2) ? " 2" : "",
146 bits(val, 3) ? " 3" : "",
147 bits(val, 4) ? " 4" : "",
148 bits(val, 5) ? " 5" : "",
149 bits(val, 6) ? " 6" : "",
150 bits(val, 7) ? " 7" : "");
143 DPRINTF(I8259, "Slaves attached to IRQs:%s%s%s%s%s%s%s%s\n",
144 bits(val, 0) ? " 0" : "",
145 bits(val, 1) ? " 1" : "",
146 bits(val, 2) ? " 2" : "",
147 bits(val, 3) ? " 3" : "",
148 bits(val, 4) ? " 4" : "",
149 bits(val, 5) ? " 5" : "",
150 bits(val, 6) ? " 6" : "",
151 bits(val, 7) ? " 7" : "");
152 cascadeBits = val;
151 } else {
152 DPRINTF(I8259, "Slave ID is %d.\n", val & mask(3));
153 } else {
154 DPRINTF(I8259, "Slave ID is %d.\n", val & mask(3));
155 cascadeBits = val & mask(3);
153 }
154 if (expectICW4)
155 initControlWord++;
156 else
157 initControlWord = 0;
158 break;
159 case 0x3:
160 DPRINTF(I8259, "Received initialization command word 4.\n");

--- 15 unchanged lines hidden (view full) ---

176 initControlWord = 0;
177 break;
178 }
179 break;
180 }
181 return latency;
182}
183
156 }
157 if (expectICW4)
158 initControlWord++;
159 else
160 initControlWord = 0;
161 break;
162 case 0x3:
163 DPRINTF(I8259, "Received initialization command word 4.\n");

--- 15 unchanged lines hidden (view full) ---

179 initControlWord = 0;
180 break;
181 }
182 break;
183 }
184 return latency;
185}
186
187void
188X86ISA::I8259::signalInterrupt(int line)
189{
190 DPRINTF(I8259, "Interrupt raised on line %d.\n", line);
191 if (line > 7)
192 fatal("Line number %d doesn't exist. The max is 7.\n");
193 if (bits(IMR, line)) {
194 DPRINTF(I8259, "Interrupt %d was masked.\n", line);
195 } else if (master != NULL) {
196 DPRINTF(I8259, "Propogating interrupt to master.\n");
197 master->signalInterrupt(cascadeBits);
198 }
199}
200
184X86ISA::I8259 *
185I8259Params::create()
186{
187 return new X86ISA::I8259(this);
188}
201X86ISA::I8259 *
202I8259Params::create()
203{
204 return new X86ISA::I8259(this);
205}