2 * Copyright (c) 2012-2013 ARM Limited
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
14 * Copyright (c) 2008 The Hewlett-Packard Development Company
15 * All rights reserved.
17 * The license below extends only to copyright in the software and shall
18 * not be construed as granting a license to any other intellectual
19 * property including but not limited to intellectual property relating
20 * to a hardware implementation of the functionality of the software
21 * licensed hereunder. You may use the software subject to the license
22 * terms below provided that you ensure that this notice is replicated
23 * unmodified and in its entirety in all distributions of the software,
24 * modified or unmodified, in source code or in binary form.
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions are
28 * met: redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer;
30 * redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in the
32 * documentation and/or other materials provided with the distribution;
33 * neither the name of the copyright holders nor the names of its
34 * contributors may be used to endorse or promote products derived from
35 * this software without specific prior written permission.
37 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
38 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
39 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
40 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
41 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
45 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 #include "arch/x86/interrupts.hh"
56 #include "arch/x86/intmessage.hh"
57 #include "arch/x86/regs/apic.hh"
58 #include "cpu/base.hh"
59 #include "debug/LocalApic.hh"
60 #include "dev/x86/i82094aa.hh"
61 #include "dev/x86/pc.hh"
62 #include "dev/x86/south_bridge.hh"
63 #include "mem/packet_access.hh"
64 #include "sim/full_system.hh"
65 #include "sim/system.hh"
68 divideFromConf(uint32_t conf
)
70 // This figures out what division we want from the division configuration
71 // register in the local APIC. The encoding is a little odd but it can
72 // be deciphered fairly easily.
73 int shift
= ((conf
& 0x8) >> 1) | (conf
& 0x3);
74 shift
= (shift
+ 1) % 8;
82 decodeAddr(Addr paddr
)
92 regNum
= APIC_VERSION
;
95 regNum
= APIC_TASK_PRIORITY
;
98 regNum
= APIC_ARBITRATION_PRIORITY
;
101 regNum
= APIC_PROCESSOR_PRIORITY
;
107 regNum
= APIC_LOGICAL_DESTINATION
;
110 regNum
= APIC_DESTINATION_FORMAT
;
113 regNum
= APIC_SPURIOUS_INTERRUPT_VECTOR
;
123 regNum
= APIC_IN_SERVICE((paddr
- 0x100) / 0x10);
133 regNum
= APIC_TRIGGER_MODE((paddr
- 0x180) / 0x10);
143 regNum
= APIC_INTERRUPT_REQUEST((paddr
- 0x200) / 0x10);
146 regNum
= APIC_ERROR_STATUS
;
149 regNum
= APIC_INTERRUPT_COMMAND_LOW
;
152 regNum
= APIC_INTERRUPT_COMMAND_HIGH
;
155 regNum
= APIC_LVT_TIMER
;
158 regNum
= APIC_LVT_THERMAL_SENSOR
;
161 regNum
= APIC_LVT_PERFORMANCE_MONITORING_COUNTERS
;
164 regNum
= APIC_LVT_LINT0
;
167 regNum
= APIC_LVT_LINT1
;
170 regNum
= APIC_LVT_ERROR
;
173 regNum
= APIC_INITIAL_COUNT
;
176 regNum
= APIC_CURRENT_COUNT
;
179 regNum
= APIC_DIVIDE_CONFIGURATION
;
182 // A reserved register field.
183 panic("Accessed reserved register field %#x.\n", paddr
);
191 X86ISA::Interrupts::read(PacketPtr pkt
)
193 Addr offset
= pkt
->getAddr() - pioAddr
;
194 // Make sure we're at least only accessing one register.
195 if ((offset
& ~mask(3)) != ((offset
+ pkt
->getSize()) & ~mask(3)))
196 panic("Accessed more than one register at a time in the APIC!\n");
197 ApicRegIndex reg
= decodeAddr(offset
);
198 uint32_t val
= htog(readReg(reg
));
200 "Reading Local APIC register %d at offset %#x as %#x.\n",
202 pkt
->setData(((uint8_t *)&val
) + (offset
& mask(3)));
203 pkt
->makeAtomicResponse();
208 X86ISA::Interrupts::write(PacketPtr pkt
)
210 Addr offset
= pkt
->getAddr() - pioAddr
;
211 // Make sure we're at least only accessing one register.
212 if ((offset
& ~mask(3)) != ((offset
+ pkt
->getSize()) & ~mask(3)))
213 panic("Accessed more than one register at a time in the APIC!\n");
214 ApicRegIndex reg
= decodeAddr(offset
);
215 uint32_t val
= regs
[reg
];
216 pkt
->writeData(((uint8_t *)&val
) + (offset
& mask(3)));
218 "Writing Local APIC register %d at offset %#x as %#x.\n",
219 reg
, offset
, gtoh(val
));
220 setReg(reg
, gtoh(val
));
221 pkt
->makeAtomicResponse();
225 X86ISA::Interrupts::requestInterrupt(uint8_t vector
,
226 uint8_t deliveryMode
, bool level
)
229 * Fixed and lowest-priority delivery mode interrupts are handled
230 * using the IRR/ISR registers, checking against the TPR, etc.
231 * The SMI, NMI, ExtInt, INIT, etc interrupts go straight through.
233 if (deliveryMode
== DeliveryMode::Fixed
||
234 deliveryMode
== DeliveryMode::LowestPriority
) {
235 DPRINTF(LocalApic
, "Interrupt is an %s.\n",
236 DeliveryMode::names
[deliveryMode
]);
237 // Queue up the interrupt in the IRR.
240 if (!getRegArrayBit(APIC_INTERRUPT_REQUEST_BASE
, vector
)) {
241 setRegArrayBit(APIC_INTERRUPT_REQUEST_BASE
, vector
);
243 setRegArrayBit(APIC_TRIGGER_MODE_BASE
, vector
);
245 clearRegArrayBit(APIC_TRIGGER_MODE_BASE
, vector
);
248 } else if (!DeliveryMode::isReserved(deliveryMode
)) {
249 DPRINTF(LocalApic
, "Interrupt is an %s.\n",
250 DeliveryMode::names
[deliveryMode
]);
251 if (deliveryMode
== DeliveryMode::SMI
&& !pendingSmi
) {
252 pendingUnmaskableInt
= pendingSmi
= true;
254 } else if (deliveryMode
== DeliveryMode::NMI
&& !pendingNmi
) {
255 pendingUnmaskableInt
= pendingNmi
= true;
257 } else if (deliveryMode
== DeliveryMode::ExtInt
&& !pendingExtInt
) {
258 pendingExtInt
= true;
259 extIntVector
= vector
;
260 } else if (deliveryMode
== DeliveryMode::INIT
&& !pendingInit
) {
261 pendingUnmaskableInt
= pendingInit
= true;
263 } else if (deliveryMode
== DeliveryMode::SIPI
&&
264 !pendingStartup
&& !startedUp
) {
265 pendingUnmaskableInt
= pendingStartup
= true;
266 startupVector
= vector
;
275 X86ISA::Interrupts::setCPU(BaseCPU
* newCPU
)
278 if (cpu
!= NULL
&& cpu
->cpuId() != newCPU
->cpuId()) {
279 panic("Local APICs can't be moved between CPUs"
280 " with different IDs.\n");
283 initialApicId
= cpu
->cpuId();
284 regs
[APIC_ID
] = (initialApicId
<< 24);
285 pioAddr
= x86LocalAPICAddress(initialApicId
, 0);
290 X86ISA::Interrupts::init()
293 // The local apic must register its address ranges on both its pio
294 // port via the basicpiodevice(piodevice) init() function and its
295 // int port that it inherited from IntDevice. Note IntDevice is
296 // not a SimObject itself.
301 // the slave port has a range so inform the connected master
302 intSlavePort
.sendRangeChange();
307 X86ISA::Interrupts::recvMessage(PacketPtr pkt
)
309 Addr offset
= pkt
->getAddr() - x86InterruptAddress(initialApicId
, 0);
310 assert(pkt
->cmd
== MemCmd::MessageReq
);
315 TriggerIntMessage message
= pkt
->getRaw
<TriggerIntMessage
>();
317 "Got Trigger Interrupt message with vector %#x.\n",
320 requestInterrupt(message
.vector
,
321 message
.deliveryMode
, message
.trigger
);
325 panic("Local apic got unknown interrupt message at offset %#x.\n",
329 pkt
->makeAtomicResponse();
335 X86ISA::Interrupts::recvResponse(PacketPtr pkt
)
337 assert(!pkt
->isError());
338 assert(pkt
->cmd
== MemCmd::MessageResp
);
339 if (--pendingIPIs
== 0) {
340 InterruptCommandRegLow low
= regs
[APIC_INTERRUPT_COMMAND_LOW
];
341 // Record that the ICR is now idle.
342 low
.deliveryStatus
= 0;
343 regs
[APIC_INTERRUPT_COMMAND_LOW
] = low
;
345 DPRINTF(LocalApic
, "ICR is now idle.\n");
351 X86ISA::Interrupts::getAddrRanges() const
354 AddrRangeList ranges
;
355 ranges
.push_back(RangeSize(pioAddr
, PageBytes
));
361 X86ISA::Interrupts::getIntAddrRange() const
363 AddrRangeList ranges
;
364 ranges
.push_back(RangeEx(x86InterruptAddress(initialApicId
, 0),
365 x86InterruptAddress(initialApicId
, 0) +
366 PhysAddrAPICRangeSize
));
372 X86ISA::Interrupts::readReg(ApicRegIndex reg
)
374 if (reg
>= APIC_TRIGGER_MODE(0) &&
375 reg
<= APIC_TRIGGER_MODE(15)) {
376 panic("Local APIC Trigger Mode registers are unimplemented.\n");
379 case APIC_ARBITRATION_PRIORITY
:
380 panic("Local APIC Arbitration Priority register unimplemented.\n");
382 case APIC_PROCESSOR_PRIORITY
:
383 panic("Local APIC Processor Priority register unimplemented.\n");
385 case APIC_ERROR_STATUS
:
386 regs
[APIC_INTERNAL_STATE
] &= ~ULL(0x1);
388 case APIC_CURRENT_COUNT
:
390 if (apicTimerEvent
.scheduled()) {
391 // Compute how many m5 ticks happen per count.
392 uint64_t ticksPerCount
= clockPeriod() *
393 divideFromConf(regs
[APIC_DIVIDE_CONFIGURATION
]);
394 // Compute how many m5 ticks are left.
395 uint64_t val
= apicTimerEvent
.when() - curTick();
396 // Turn that into a count.
397 val
= (val
+ ticksPerCount
- 1) / ticksPerCount
;
410 X86ISA::Interrupts::setReg(ApicRegIndex reg
, uint32_t val
)
412 uint32_t newVal
= val
;
413 if (reg
>= APIC_IN_SERVICE(0) &&
414 reg
<= APIC_IN_SERVICE(15)) {
415 panic("Local APIC In-Service registers are unimplemented.\n");
417 if (reg
>= APIC_TRIGGER_MODE(0) &&
418 reg
<= APIC_TRIGGER_MODE(15)) {
419 panic("Local APIC Trigger Mode registers are unimplemented.\n");
421 if (reg
>= APIC_INTERRUPT_REQUEST(0) &&
422 reg
<= APIC_INTERRUPT_REQUEST(15)) {
423 panic("Local APIC Interrupt Request registers "
424 "are unimplemented.\n");
431 // The Local APIC Version register is read only.
433 case APIC_TASK_PRIORITY
:
436 case APIC_ARBITRATION_PRIORITY
:
437 panic("Local APIC Arbitration Priority register unimplemented.\n");
439 case APIC_PROCESSOR_PRIORITY
:
440 panic("Local APIC Processor Priority register unimplemented.\n");
443 // Remove the interrupt that just completed from the local apic state.
444 clearRegArrayBit(APIC_IN_SERVICE_BASE
, ISRV
);
447 case APIC_LOGICAL_DESTINATION
:
448 newVal
= val
& 0xFF000000;
450 case APIC_DESTINATION_FORMAT
:
451 newVal
= val
| 0x0FFFFFFF;
453 case APIC_SPURIOUS_INTERRUPT_VECTOR
:
454 regs
[APIC_INTERNAL_STATE
] &= ~ULL(1 << 1);
455 regs
[APIC_INTERNAL_STATE
] |= val
& (1 << 8);
457 warn("Focus processor checking not implemented.\n");
459 case APIC_ERROR_STATUS
:
461 if (regs
[APIC_INTERNAL_STATE
] & 0x1) {
462 regs
[APIC_INTERNAL_STATE
] &= ~ULL(0x1);
465 regs
[APIC_INTERNAL_STATE
] |= ULL(0x1);
471 case APIC_INTERRUPT_COMMAND_LOW
:
473 InterruptCommandRegLow low
= regs
[APIC_INTERRUPT_COMMAND_LOW
];
474 // Check if we're already sending an IPI.
475 if (low
.deliveryStatus
) {
480 InterruptCommandRegHigh high
= regs
[APIC_INTERRUPT_COMMAND_HIGH
];
481 TriggerIntMessage message
= 0;
482 message
.destination
= high
.destination
;
483 message
.vector
= low
.vector
;
484 message
.deliveryMode
= low
.deliveryMode
;
485 message
.destMode
= low
.destMode
;
486 message
.level
= low
.level
;
487 message
.trigger
= low
.trigger
;
489 int numContexts
= sys
->numContexts();
490 switch (low
.destShorthand
) {
492 if (message
.deliveryMode
== DeliveryMode::LowestPriority
) {
493 panic("Lowest priority delivery mode "
494 "IPIs aren't implemented.\n");
496 if (message
.destMode
== 1) {
497 int dest
= message
.destination
;
498 hack_once("Assuming logical destinations are 1 << id.\n");
499 for (int i
= 0; i
< numContexts
; i
++) {
505 if (message
.destination
== 0xFF) {
506 for (int i
= 0; i
< numContexts
; i
++) {
507 if (i
== initialApicId
) {
508 requestInterrupt(message
.vector
,
509 message
.deliveryMode
, message
.trigger
);
515 if (message
.destination
== initialApicId
) {
516 requestInterrupt(message
.vector
,
517 message
.deliveryMode
, message
.trigger
);
519 apics
.push_back(message
.destination
);
526 requestInterrupt(message
.vector
,
527 message
.deliveryMode
, message
.trigger
);
530 requestInterrupt(message
.vector
,
531 message
.deliveryMode
, message
.trigger
);
535 for (int i
= 0; i
< numContexts
; i
++) {
536 if (i
!= initialApicId
) {
543 // Record that an IPI is being sent if one actually is.
545 low
.deliveryStatus
= 1;
546 pendingIPIs
+= apics
.size();
548 regs
[APIC_INTERRUPT_COMMAND_LOW
] = low
;
549 intMasterPort
.sendMessage(apics
, message
, sys
->isTimingMode());
550 newVal
= regs
[APIC_INTERRUPT_COMMAND_LOW
];
554 case APIC_LVT_THERMAL_SENSOR
:
555 case APIC_LVT_PERFORMANCE_MONITORING_COUNTERS
:
560 uint64_t readOnlyMask
= (1 << 12) | (1 << 14);
561 newVal
= (val
& ~readOnlyMask
) |
562 (regs
[reg
] & readOnlyMask
);
565 case APIC_INITIAL_COUNT
:
567 newVal
= bits(val
, 31, 0);
568 // Compute how many timer ticks we're being programmed for.
569 uint64_t newCount
= newVal
*
570 (divideFromConf(regs
[APIC_DIVIDE_CONFIGURATION
]));
571 // Schedule on the edge of the next tick plus the new count.
572 Tick offset
= curTick() % clockPeriod();
574 reschedule(apicTimerEvent
,
575 curTick() + (newCount
+ 1) *
576 clockPeriod() - offset
, true);
579 reschedule(apicTimerEvent
,
580 curTick() + newCount
*
581 clockPeriod(), true);
585 case APIC_CURRENT_COUNT
:
586 //Local APIC Current Count register is read only.
588 case APIC_DIVIDE_CONFIGURATION
:
599 X86ISA::Interrupts::Interrupts(Params
* p
)
600 : PioDevice(p
), IntDevice(this, p
->int_latency
),
601 apicTimerEvent([this]{ processApicTimerEvent(); }, name()),
602 pendingSmi(false), smiVector(0),
603 pendingNmi(false), nmiVector(0),
604 pendingExtInt(false), extIntVector(0),
605 pendingInit(false), initVector(0),
606 pendingStartup(false), startupVector(0),
607 startedUp(false), pendingUnmaskableInt(false),
608 pendingIPIs(0), cpu(NULL
),
609 intSlavePort(name() + ".int_slave", this, this),
610 pioDelay(p
->pio_latency
)
612 memset(regs
, 0, sizeof(regs
));
613 //Set the local apic DFR to the flat model.
614 regs
[APIC_DESTINATION_FORMAT
] = (uint32_t)(-1);
621 X86ISA::Interrupts::checkInterrupts(ThreadContext
*tc
) const
623 RFLAGS rflags
= tc
->readMiscRegNoEffect(MISCREG_RFLAGS
);
624 if (pendingUnmaskableInt
) {
625 DPRINTF(LocalApic
, "Reported pending unmaskable interrupt.\n");
630 DPRINTF(LocalApic
, "Reported pending external interrupt.\n");
633 if (IRRV
> ISRV
&& bits(IRRV
, 7, 4) >
634 bits(regs
[APIC_TASK_PRIORITY
], 7, 4)) {
635 DPRINTF(LocalApic
, "Reported pending regular interrupt.\n");
643 X86ISA::Interrupts::checkInterruptsRaw() const
645 return pendingUnmaskableInt
|| pendingExtInt
||
646 (IRRV
> ISRV
&& bits(IRRV
, 7, 4) >
647 bits(regs
[APIC_TASK_PRIORITY
], 7, 4));
651 X86ISA::Interrupts::getInterrupt(ThreadContext
*tc
)
653 assert(checkInterrupts(tc
));
654 // These are all probably fairly uncommon, so we'll make them easier to
656 if (pendingUnmaskableInt
) {
658 DPRINTF(LocalApic
, "Generated SMI fault object.\n");
659 return std::make_shared
<SystemManagementInterrupt
>();
660 } else if (pendingNmi
) {
661 DPRINTF(LocalApic
, "Generated NMI fault object.\n");
662 return std::make_shared
<NonMaskableInterrupt
>(nmiVector
);
663 } else if (pendingInit
) {
664 DPRINTF(LocalApic
, "Generated INIT fault object.\n");
665 return std::make_shared
<InitInterrupt
>(initVector
);
666 } else if (pendingStartup
) {
667 DPRINTF(LocalApic
, "Generating SIPI fault object.\n");
668 return std::make_shared
<StartupInterrupt
>(startupVector
);
670 panic("pendingUnmaskableInt set, but no unmaskable "
671 "ints were pending.\n");
674 } else if (pendingExtInt
) {
675 DPRINTF(LocalApic
, "Generated external interrupt fault object.\n");
676 return std::make_shared
<ExternalInterrupt
>(extIntVector
);
678 DPRINTF(LocalApic
, "Generated regular interrupt fault object.\n");
679 // The only thing left are fixed and lowest priority interrupts.
680 return std::make_shared
<ExternalInterrupt
>(IRRV
);
685 X86ISA::Interrupts::updateIntrInfo(ThreadContext
*tc
)
687 assert(checkInterrupts(tc
));
688 if (pendingUnmaskableInt
) {
690 DPRINTF(LocalApic
, "SMI sent to core.\n");
692 } else if (pendingNmi
) {
693 DPRINTF(LocalApic
, "NMI sent to core.\n");
695 } else if (pendingInit
) {
696 DPRINTF(LocalApic
, "Init sent to core.\n");
699 } else if (pendingStartup
) {
700 DPRINTF(LocalApic
, "SIPI sent to core.\n");
701 pendingStartup
= false;
704 if (!(pendingSmi
|| pendingNmi
|| pendingInit
|| pendingStartup
))
705 pendingUnmaskableInt
= false;
706 } else if (pendingExtInt
) {
707 pendingExtInt
= false;
709 DPRINTF(LocalApic
, "Interrupt %d sent to core.\n", IRRV
);
710 // Mark the interrupt as "in service".
712 setRegArrayBit(APIC_IN_SERVICE_BASE
, ISRV
);
713 // Clear it out of the IRR.
714 clearRegArrayBit(APIC_INTERRUPT_REQUEST_BASE
, IRRV
);
720 X86ISA::Interrupts::serialize(CheckpointOut
&cp
) const
722 SERIALIZE_ARRAY(regs
, NUM_APIC_REGS
);
723 SERIALIZE_SCALAR(pendingSmi
);
724 SERIALIZE_SCALAR(smiVector
);
725 SERIALIZE_SCALAR(pendingNmi
);
726 SERIALIZE_SCALAR(nmiVector
);
727 SERIALIZE_SCALAR(pendingExtInt
);
728 SERIALIZE_SCALAR(extIntVector
);
729 SERIALIZE_SCALAR(pendingInit
);
730 SERIALIZE_SCALAR(initVector
);
731 SERIALIZE_SCALAR(pendingStartup
);
732 SERIALIZE_SCALAR(startupVector
);
733 SERIALIZE_SCALAR(startedUp
);
734 SERIALIZE_SCALAR(pendingUnmaskableInt
);
735 SERIALIZE_SCALAR(pendingIPIs
);
736 SERIALIZE_SCALAR(IRRV
);
737 SERIALIZE_SCALAR(ISRV
);
738 bool apicTimerEventScheduled
= apicTimerEvent
.scheduled();
739 SERIALIZE_SCALAR(apicTimerEventScheduled
);
740 Tick apicTimerEventTick
= apicTimerEvent
.when();
741 SERIALIZE_SCALAR(apicTimerEventTick
);
745 X86ISA::Interrupts::unserialize(CheckpointIn
&cp
)
747 UNSERIALIZE_ARRAY(regs
, NUM_APIC_REGS
);
748 UNSERIALIZE_SCALAR(pendingSmi
);
749 UNSERIALIZE_SCALAR(smiVector
);
750 UNSERIALIZE_SCALAR(pendingNmi
);
751 UNSERIALIZE_SCALAR(nmiVector
);
752 UNSERIALIZE_SCALAR(pendingExtInt
);
753 UNSERIALIZE_SCALAR(extIntVector
);
754 UNSERIALIZE_SCALAR(pendingInit
);
755 UNSERIALIZE_SCALAR(initVector
);
756 UNSERIALIZE_SCALAR(pendingStartup
);
757 UNSERIALIZE_SCALAR(startupVector
);
758 UNSERIALIZE_SCALAR(startedUp
);
759 UNSERIALIZE_SCALAR(pendingUnmaskableInt
);
760 UNSERIALIZE_SCALAR(pendingIPIs
);
761 UNSERIALIZE_SCALAR(IRRV
);
762 UNSERIALIZE_SCALAR(ISRV
);
763 bool apicTimerEventScheduled
;
764 UNSERIALIZE_SCALAR(apicTimerEventScheduled
);
765 if (apicTimerEventScheduled
) {
766 Tick apicTimerEventTick
;
767 UNSERIALIZE_SCALAR(apicTimerEventTick
);
768 if (apicTimerEvent
.scheduled()) {
769 reschedule(apicTimerEvent
, apicTimerEventTick
, true);
771 schedule(apicTimerEvent
, apicTimerEventTick
);
777 X86LocalApicParams::create()
779 return new X86ISA::Interrupts(this);
783 X86ISA::Interrupts::processApicTimerEvent() {
784 if (triggerTimerInterrupt())
785 setReg(APIC_INITIAL_COUNT
, readReg(APIC_INITIAL_COUNT
));