Deleted Added
sdiff udiff text old ( 6069:cb5b778785a6 ) new ( 6136:4f8af2f3185f )
full compact
1/*
2 * Copyright (c) 2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

290 }
291 cpu->wakeup();
292}
293
294
295void
296X86ISA::Interrupts::setCPU(BaseCPU * newCPU)
297{
298 assert(newCPU);
299 if (cpu != NULL && cpu->cpuId() != newCPU->cpuId()) {
300 panic("Local APICs can't be moved between CPUs"
301 " with different IDs.\n");
302 }
303 cpu = newCPU;
304 initialApicId = cpu->cpuId();
305 regs[APIC_ID] = (initialApicId << 24);
306}
307
308
309Tick
310X86ISA::Interrupts::recvMessage(PacketPtr pkt)
311{
312 Addr offset = pkt->getAddr() - x86InterruptAddress(initialApicId, 0);
313 assert(pkt->cmd == MemCmd::MessageReq);
314 switch(offset)
315 {
316 case 0:
317 {
318 TriggerIntMessage message = pkt->get<TriggerIntMessage>();
319 DPRINTF(LocalApic,
320 "Got Trigger Interrupt message with vector %#x.\n",
321 message.vector);
322
323 requestInterrupt(message.vector,
324 message.deliveryMode, message.trigger);
325 }
326 break;
327 default:
328 panic("Local apic got unknown interrupt message at offset %#x.\n",
329 offset);

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

350 DPRINTF(LocalApic, "ICR is now idle.\n");
351 return 0;
352}
353
354
355void
356X86ISA::Interrupts::addressRanges(AddrRangeList &range_list)
357{
358 range_list.clear();
359 Range<Addr> range = RangeEx(x86LocalAPICAddress(initialApicId, 0),
360 x86LocalAPICAddress(initialApicId, 0) +
361 PageBytes);
362 range_list.push_back(range);
363 pioAddr = range.start;
364}
365
366
367void
368X86ISA::Interrupts::getIntAddrRange(AddrRangeList &range_list)
369{
370 range_list.clear();
371 range_list.push_back(RangeEx(x86InterruptAddress(initialApicId, 0),
372 x86InterruptAddress(initialApicId, 0) +
373 PhysAddrAPICRangeSize));
374}
375
376
377uint32_t
378X86ISA::Interrupts::readReg(ApicRegIndex reg)
379{
380 if (reg >= APIC_TRIGGER_MODE(0) &&
381 reg <= APIC_TRIGGER_MODE(15)) {

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

511 case 2:
512 requestInterrupt(message.vector,
513 message.deliveryMode, message.trigger);
514 // Fall through
515 case 3:
516 {
517 int numContexts = sys->numContexts();
518 pendingIPIs += (numContexts - 1);
519 for (int i = 0; i < numContexts; i++) {
520 int thisId = sys->getThreadContext(i)->contextId();
521 if (thisId != initialApicId) {
522 PacketPtr pkt = buildIntRequest(thisId, message);
523 if (timing)
524 intPort->sendMessageTiming(pkt, latency);
525 else
526 intPort->sendMessageAtomic(pkt);
527 }
528 }
529 }

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

580 BasicPioDevice(p), IntDev(this), latency(p->pio_latency), clock(0),
581 apicTimerEvent(this),
582 pendingSmi(false), smiVector(0),
583 pendingNmi(false), nmiVector(0),
584 pendingExtInt(false), extIntVector(0),
585 pendingInit(false), initVector(0),
586 pendingStartup(false), startupVector(0),
587 startedUp(false), pendingUnmaskableInt(false),
588 pendingIPIs(0), cpu(NULL)
589{
590 pioSize = PageBytes;
591 memset(regs, 0, sizeof(regs));
592 //Set the local apic DFR to the flat model.
593 regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1);
594 ISRV = 0;
595 IRRV = 0;
596}

--- 98 unchanged lines hidden ---