Deleted Added
sdiff udiff text old ( 8739:925f15f96322 ) new ( 8746:42d3554b1c35 )
full compact
1/*
2 * Copyright (c) 2008 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;

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

25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Gabe Black
29 */
30
31#include "config/full_system.hh"
32
33#if FULL_SYSTEM
34#include "arch/x86/interrupts.hh"
35#endif
36
37#include "arch/x86/intmessage.hh"
38#include "debug/I82094AA.hh"
39#include "dev/x86/i82094aa.hh"
40#include "dev/x86/i8259.hh"
41#include "mem/packet.hh"
42#include "mem/packet_access.hh"
43#include "sim/system.hh"
44
45X86ISA::I82094AA::I82094AA(Params *p) : PioDevice(p),

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

167{
168 DPRINTF(I82094AA, "Received interrupt %d.\n", line);
169 assert(line < TableSize);
170 RedirTableEntry entry = redirTable[line];
171 if (entry.mask) {
172 DPRINTF(I82094AA, "Entry was masked.\n");
173 return;
174 } else {
175#if FULL_SYSTEM //XXX No interrupt controller in SE mode.
176 TriggerIntMessage message = 0;
177 message.destination = entry.dest;
178 if (entry.deliveryMode == DeliveryMode::ExtInt) {
179 assert(extIntPic);
180 message.vector = extIntPic->getVector();
181 } else {
182 message.vector = entry.vector;
183 }

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

197 for (int i = 0; i < numContexts; i++) {
198 apics.push_back(i);
199 }
200 } else {
201 apics.push_back(message.destination);
202 }
203 } else {
204 for (int i = 0; i < numContexts; i++) {
205 std::map<int, Interrupts *>::iterator localApicIt =
206 localApics.find(i);
207 assert(localApicIt != localApics.end());
208 Interrupts *localApic = localApicIt->second;
209 if ((localApic->readReg(APIC_LOGICAL_DESTINATION) >> 24) &
210 message.destination) {
211 apics.push_back(localApicIt->first);
212 }
213 }
214 if (message.deliveryMode == DeliveryMode::LowestPriority &&
215 apics.size()) {
216 // The manual seems to suggest that the chipset just does
217 // something reasonable for these instead of actually using
218 // state from the local APIC. We'll just rotate an offset
219 // through the set of APICs selected above.

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

226 }
227 int selected = *apicIt;
228 apics.clear();
229 apics.push_back(selected);
230 }
231 }
232 intPort->sendMessage(apics, message,
233 sys->getMemoryMode() == Enums::timing);
234#endif
235 }
236}
237
238void
239X86ISA::I82094AA::raiseInterruptPin(int number)
240{
241 assert(number < TableSize);
242 if (!pinStates[number])

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

247void
248X86ISA::I82094AA::lowerInterruptPin(int number)
249{
250 assert(number < TableSize);
251 pinStates[number] = false;
252}
253
254void
255X86ISA::I82094AA::registerLocalApic(int initialId, Interrupts *localApic)
256{
257 assert(localApic);
258 localApics[initialId] = localApic;
259}
260
261void
262X86ISA::I82094AA::serialize(std::ostream &os)
263{
264 uint64_t* redirTableArray = (uint64_t*)redirTable;
265 SERIALIZE_SCALAR(regSel);
266 SERIALIZE_SCALAR(initialApicId);
267 SERIALIZE_SCALAR(id);
268 SERIALIZE_SCALAR(arbId);
269 SERIALIZE_SCALAR(lowestPriorityOffset);

--- 25 unchanged lines hidden ---