interrupts.cc (6066:a9fe0813039f) interrupts.cc (6069:cb5b778785a6)
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 *

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

333}
334
335
336Tick
337X86ISA::Interrupts::recvResponse(PacketPtr pkt)
338{
339 assert(!pkt->isError());
340 assert(pkt->cmd == MemCmd::MessageResp);
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 *

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

333}
334
335
336Tick
337X86ISA::Interrupts::recvResponse(PacketPtr pkt)
338{
339 assert(!pkt->isError());
340 assert(pkt->cmd == MemCmd::MessageResp);
341 InterruptCommandRegLow low = regs[APIC_INTERRUPT_COMMAND_LOW];
342 // Record that the ICR is now idle.
343 low.deliveryStatus = 0;
344 regs[APIC_INTERRUPT_COMMAND_LOW] = low;
341 if (--pendingIPIs == 0) {
342 InterruptCommandRegLow low = regs[APIC_INTERRUPT_COMMAND_LOW];
343 // Record that the ICR is now idle.
344 low.deliveryStatus = 0;
345 regs[APIC_INTERRUPT_COMMAND_LOW] = low;
346 }
345 delete pkt->req;
346 delete pkt;
347 DPRINTF(LocalApic, "ICR is now idle.\n");
348 return 0;
349}
350
351
352void

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

491 message.destMode = low.destMode;
492 message.level = low.level;
493 message.trigger = low.trigger;
494 bool timing = sys->getMemoryMode() == Enums::timing;
495 // Be careful no updates of the delivery status bit get lost.
496 regs[APIC_INTERRUPT_COMMAND_LOW] = low;
497 switch (low.destShorthand) {
498 case 0:
347 delete pkt->req;
348 delete pkt;
349 DPRINTF(LocalApic, "ICR is now idle.\n");
350 return 0;
351}
352
353
354void

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

493 message.destMode = low.destMode;
494 message.level = low.level;
495 message.trigger = low.trigger;
496 bool timing = sys->getMemoryMode() == Enums::timing;
497 // Be careful no updates of the delivery status bit get lost.
498 regs[APIC_INTERRUPT_COMMAND_LOW] = low;
499 switch (low.destShorthand) {
500 case 0:
501 pendingIPIs++;
499 intPort->sendMessage(message, timing);
500 newVal = regs[APIC_INTERRUPT_COMMAND_LOW];
501 break;
502 case 1:
502 intPort->sendMessage(message, timing);
503 newVal = regs[APIC_INTERRUPT_COMMAND_LOW];
504 break;
505 case 1:
503 panic("Self IPIs aren't implemented.\n");
506 newVal = val;
507 requestInterrupt(message.vector,
508 message.deliveryMode, message.trigger);
504 break;
505 case 2:
509 break;
510 case 2:
506 panic("Broadcast including self IPIs aren't implemented.\n");
507 break;
511 requestInterrupt(message.vector,
512 message.deliveryMode, message.trigger);
513 // Fall through
508 case 3:
514 case 3:
509 panic("Broadcast excluding self IPIs aren't implemented.\n");
515 {
516 int numContexts = sys->numContexts();
517 pendingIPIs += (numContexts - 1);
518 // We have no way to get at the thread context we're part
519 // of, so we'll just have to go with the CPU for now.
520 hack_once("Broadcast IPIs can't handle more than "
521 "one context per CPU.\n");
522 int myId = cpu->getContext(0)->contextId();
523 for (int i = 0; i < numContexts; i++) {
524 int thisId = sys->getThreadContext(i)->contextId();
525 if (thisId != myId) {
526 PacketPtr pkt = buildIntRequest(thisId, message);
527 if (timing)
528 intPort->sendMessageTiming(pkt, latency);
529 else
530 intPort->sendMessageAtomic(pkt);
531 }
532 }
533 }
534 newVal = regs[APIC_INTERRUPT_COMMAND_LOW];
510 break;
511 }
512 }
513 break;
514 case APIC_LVT_TIMER:
515 case APIC_LVT_THERMAL_SENSOR:
516 case APIC_LVT_PERFORMANCE_MONITORING_COUNTERS:
517 case APIC_LVT_LINT0:

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

558X86ISA::Interrupts::Interrupts(Params * p) :
559 BasicPioDevice(p), IntDev(this), latency(p->pio_latency), clock(0),
560 apicTimerEvent(this),
561 pendingSmi(false), smiVector(0),
562 pendingNmi(false), nmiVector(0),
563 pendingExtInt(false), extIntVector(0),
564 pendingInit(false), initVector(0),
565 pendingStartup(false), startupVector(0),
535 break;
536 }
537 }
538 break;
539 case APIC_LVT_TIMER:
540 case APIC_LVT_THERMAL_SENSOR:
541 case APIC_LVT_PERFORMANCE_MONITORING_COUNTERS:
542 case APIC_LVT_LINT0:

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

583X86ISA::Interrupts::Interrupts(Params * p) :
584 BasicPioDevice(p), IntDev(this), latency(p->pio_latency), clock(0),
585 apicTimerEvent(this),
586 pendingSmi(false), smiVector(0),
587 pendingNmi(false), nmiVector(0),
588 pendingExtInt(false), extIntVector(0),
589 pendingInit(false), initVector(0),
590 pendingStartup(false), startupVector(0),
566 startedUp(false), pendingUnmaskableInt(false)
591 startedUp(false), pendingUnmaskableInt(false),
592 pendingIPIs(0)
567{
568 pioSize = PageBytes;
569 memset(regs, 0, sizeof(regs));
570 //Set the local apic DFR to the flat model.
571 regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1);
572 ISRV = 0;
573 IRRV = 0;
574}

--- 98 unchanged lines hidden ---
593{
594 pioSize = PageBytes;
595 memset(regs, 0, sizeof(regs));
596 //Set the local apic DFR to the flat model.
597 regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1);
598 ISRV = 0;
599 IRRV = 0;
600}

--- 98 unchanged lines hidden ---