intdev.cc (5827:ac2c268bf4f1) intdev.cc (6045:214461cb8abe)
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 "dev/x86/intdev.hh"
32
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 "dev/x86/intdev.hh"
32
33void
34X86ISA::IntDev::IntPort::sendMessage(TriggerIntMessage message, bool timing)
35{
36 if (DeliveryMode::isReserved(message.deliveryMode)) {
37 fatal("Tried to use reserved delivery mode %d\n",
38 message.deliveryMode);
39 } else if (DTRACE(IntDev)) {
40 DPRINTF(IntDev, "Delivery mode is: %s.\n",
41 DeliveryMode::names[message.deliveryMode]);
42 DPRINTF(IntDev, "Vector is %#x.\n", message.vector);
43 }
44 if (message.destMode == 0) {
45 DPRINTF(IntDev,
46 "Sending interrupt to APIC ID %d.\n", message.destination);
47 PacketPtr pkt = buildIntRequest(message.destination, message);
48 if (timing)
49 sendMessageTiming(pkt, latency);
50 else
51 sendMessageAtomic(pkt);
52 } else {
53 DPRINTF(IntDev, "Sending interrupts to APIC IDs:"
54 "%s%s%s%s%s%s%s%s\n",
55 bits((int)message.destination, 0) ? " 0": "",
56 bits((int)message.destination, 1) ? " 1": "",
57 bits((int)message.destination, 2) ? " 2": "",
58 bits((int)message.destination, 3) ? " 3": "",
59 bits((int)message.destination, 4) ? " 4": "",
60 bits((int)message.destination, 5) ? " 5": "",
61 bits((int)message.destination, 6) ? " 6": "",
62 bits((int)message.destination, 7) ? " 7": ""
63 );
64 uint8_t dests = message.destination;
65 uint8_t id = 0;
66 while(dests) {
67 if (dests & 0x1) {
68 PacketPtr pkt = buildIntRequest(id, message);
69 if (timing)
70 sendMessageTiming(pkt, latency);
71 else
72 sendMessageAtomic(pkt);
73 }
74 dests >>= 1;
75 id++;
76 }
77 }
78}
79
33X86ISA::IntSourcePin *
34X86IntSourcePinParams::create()
35{
36 return new X86ISA::IntSourcePin(this);
37}
38
39X86ISA::IntSinkPin *
40X86IntSinkPinParams::create()
41{
42 return new X86ISA::IntSinkPin(this);
43}
44
45X86ISA::IntLine *
46X86IntLineParams::create()
47{
48 return new X86ISA::IntLine(this);
49}
80X86ISA::IntSourcePin *
81X86IntSourcePinParams::create()
82{
83 return new X86ISA::IntSourcePin(this);
84}
85
86X86ISA::IntSinkPin *
87X86IntSinkPinParams::create()
88{
89 return new X86ISA::IntSinkPin(this);
90}
91
92X86ISA::IntLine *
93X86IntLineParams::create()
94{
95 return new X86ISA::IntLine(this);
96}