intdev.cc revision 9807:63d7362bbdf2
110298Salexandru.dutu@amd.com/*
210298Salexandru.dutu@amd.com * Copyright (c) 2012 ARM Limited
310298Salexandru.dutu@amd.com * All rights reserved
410298Salexandru.dutu@amd.com *
510298Salexandru.dutu@amd.com * The license below extends only to copyright in the software and shall
610298Salexandru.dutu@amd.com * not be construed as granting a license to any other intellectual
710298Salexandru.dutu@amd.com * property including but not limited to intellectual property relating
810298Salexandru.dutu@amd.com * to a hardware implementation of the functionality of the software
910298Salexandru.dutu@amd.com * licensed hereunder.  You may use the software subject to the license
1010298Salexandru.dutu@amd.com * terms below provided that you ensure that this notice is replicated
1110298Salexandru.dutu@amd.com * unmodified and in its entirety in all distributions of the software,
1210298Salexandru.dutu@amd.com * modified or unmodified, in source code or in binary form.
1310298Salexandru.dutu@amd.com *
1410298Salexandru.dutu@amd.com * Copyright (c) 2008 The Regents of The University of Michigan
1510298Salexandru.dutu@amd.com * All rights reserved.
1610298Salexandru.dutu@amd.com *
1710298Salexandru.dutu@amd.com * Redistribution and use in source and binary forms, with or without
1810298Salexandru.dutu@amd.com * modification, are permitted provided that the following conditions are
1910298Salexandru.dutu@amd.com * met: redistributions of source code must retain the above copyright
2010298Salexandru.dutu@amd.com * notice, this list of conditions and the following disclaimer;
2110298Salexandru.dutu@amd.com * redistributions in binary form must reproduce the above copyright
2210298Salexandru.dutu@amd.com * notice, this list of conditions and the following disclaimer in the
2310298Salexandru.dutu@amd.com * documentation and/or other materials provided with the distribution;
2410298Salexandru.dutu@amd.com * neither the name of the copyright holders nor the names of its
2510298Salexandru.dutu@amd.com * contributors may be used to endorse or promote products derived from
2610298Salexandru.dutu@amd.com * this software without specific prior written permission.
2710298Salexandru.dutu@amd.com *
2810298Salexandru.dutu@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2910298Salexandru.dutu@amd.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3010298Salexandru.dutu@amd.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3110298Salexandru.dutu@amd.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3210298Salexandru.dutu@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3310298Salexandru.dutu@amd.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3410298Salexandru.dutu@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3510298Salexandru.dutu@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3610298Salexandru.dutu@amd.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3710298Salexandru.dutu@amd.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3810298Salexandru.dutu@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3910298Salexandru.dutu@amd.com *
4010298Salexandru.dutu@amd.com * Authors: Gabe Black
4110298Salexandru.dutu@amd.com */
4210298Salexandru.dutu@amd.com
4310298Salexandru.dutu@amd.com#include "dev/x86/intdev.hh"
4410298Salexandru.dutu@amd.com
4510298Salexandru.dutu@amd.comvoid
4610298Salexandru.dutu@amd.comX86ISA::IntDevice::IntMasterPort::sendMessage(ApicList apics,
4710298Salexandru.dutu@amd.com                                           TriggerIntMessage message,
4810298Salexandru.dutu@amd.com                                           bool timing)
4910298Salexandru.dutu@amd.com{
5010298Salexandru.dutu@amd.com    ApicList::iterator apicIt;
5110298Salexandru.dutu@amd.com    for (apicIt = apics.begin(); apicIt != apics.end(); apicIt++) {
5210298Salexandru.dutu@amd.com        PacketPtr pkt = buildIntRequest(*apicIt, message);
5310298Salexandru.dutu@amd.com        if (timing) {
5410298Salexandru.dutu@amd.com            schedTimingReq(pkt, curTick() + latency);
5510298Salexandru.dutu@amd.com            // The target handles cleaning up the packet in timing mode.
5610298Salexandru.dutu@amd.com        } else {
5710298Salexandru.dutu@amd.com            // ignore the latency involved in the atomic transaction
5810298Salexandru.dutu@amd.com            sendAtomic(pkt);
5910298Salexandru.dutu@amd.com            assert(pkt->isResponse());
6010298Salexandru.dutu@amd.com            // also ignore the latency in handling the response
6110298Salexandru.dutu@amd.com            recvResponse(pkt);
6210298Salexandru.dutu@amd.com            delete pkt->req;
6310298Salexandru.dutu@amd.com            delete pkt;
6410298Salexandru.dutu@amd.com        }
6510298Salexandru.dutu@amd.com    }
6610298Salexandru.dutu@amd.com}
6710298Salexandru.dutu@amd.com
6810298Salexandru.dutu@amd.comvoid
6910298Salexandru.dutu@amd.comX86ISA::IntDevice::init()
7010298Salexandru.dutu@amd.com{
7110298Salexandru.dutu@amd.com    if (!intMasterPort.isConnected()) {
7210298Salexandru.dutu@amd.com        panic("Int port not connected to anything!");
7310298Salexandru.dutu@amd.com    }
7410298Salexandru.dutu@amd.com}
7510298Salexandru.dutu@amd.com
7610298Salexandru.dutu@amd.comX86ISA::IntSourcePin *
7710298Salexandru.dutu@amd.comX86IntSourcePinParams::create()
7810298Salexandru.dutu@amd.com{
7910298Salexandru.dutu@amd.com    return new X86ISA::IntSourcePin(this);
8010298Salexandru.dutu@amd.com}
8110298Salexandru.dutu@amd.com
8210298Salexandru.dutu@amd.comX86ISA::IntSinkPin *
8310298Salexandru.dutu@amd.comX86IntSinkPinParams::create()
8410298Salexandru.dutu@amd.com{
8510298Salexandru.dutu@amd.com    return new X86ISA::IntSinkPin(this);
8610298Salexandru.dutu@amd.com}
8710298Salexandru.dutu@amd.com
8810298Salexandru.dutu@amd.comX86ISA::IntLine *
8910298Salexandru.dutu@amd.comX86IntLineParams::create()
9010298Salexandru.dutu@amd.com{
9110298Salexandru.dutu@amd.com    return new X86ISA::IntLine(this);
9210298Salexandru.dutu@amd.com}
9310298Salexandru.dutu@amd.com