intelmp.cc revision 8737
12137SN/A/*
25268Sksewell@umich.edu * Copyright (c) 2008 The Hewlett-Packard Development Company
35254Sksewell@umich.edu * All rights reserved.
45254Sksewell@umich.edu *
52137SN/A * The license below extends only to copyright in the software and shall
65254Sksewell@umich.edu * not be construed as granting a license to any other intellectual
75254Sksewell@umich.edu * property including but not limited to intellectual property relating
85254Sksewell@umich.edu * to a hardware implementation of the functionality of the software
95254Sksewell@umich.edu * licensed hereunder.  You may use the software subject to the license
105254Sksewell@umich.edu * terms below provided that you ensure that this notice is replicated
115254Sksewell@umich.edu * unmodified and in its entirety in all distributions of the software,
125254Sksewell@umich.edu * modified or unmodified, in source code or in binary form.
135254Sksewell@umich.edu *
145254Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without
155254Sksewell@umich.edu * modification, are permitted provided that the following conditions are
162137SN/A * met: redistributions of source code must retain the above copyright
175254Sksewell@umich.edu * notice, this list of conditions and the following disclaimer;
185254Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright
195254Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the
205254Sksewell@umich.edu * documentation and/or other materials provided with the distribution;
215254Sksewell@umich.edu * neither the name of the copyright holders nor the names of its
225254Sksewell@umich.edu * contributors may be used to endorse or promote products derived from
235254Sksewell@umich.edu * this software without specific prior written permission.
245254Sksewell@umich.edu *
255254Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
265254Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
275254Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
282665Ssaidi@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
295268Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
305268Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
312137SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
322137SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
332597SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
342597SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
352137SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
362137SN/A *
372680Sktlim@umich.edu * Authors: Gabe Black
388232Snate@binkert.org */
392137SN/A
408229Snate@binkert.org#include "arch/x86/bios/intelmp.hh"
412137SN/A#include "arch/x86/isa_traits.hh"
428229Snate@binkert.org#include "base/misc.hh"
434661Sksewell@umich.edu#include "base/types.hh"
442137SN/A#include "mem/port_proxy.hh"
452137SN/A#include "sim/byteswap.hh"
462137SN/A
472137SN/A// Config entry types
482137SN/A#include "params/X86IntelMPBaseConfigEntry.hh"
492137SN/A#include "params/X86IntelMPExtConfigEntry.hh"
503114Sgblack@eecs.umich.edu
512680Sktlim@umich.edu// General table structures
522137SN/A#include "params/X86IntelMPConfigTable.hh"
536701Sgblack@eecs.umich.edu#include "params/X86IntelMPFloatingPointer.hh"
546701Sgblack@eecs.umich.edu
552137SN/A// Base entry types
562137SN/A#include "params/X86IntelMPBus.hh"
579149SAli.Saidi@ARM.com#include "params/X86IntelMPIOAPIC.hh"
589149SAli.Saidi@ARM.com#include "params/X86IntelMPIOIntAssignment.hh"
592137SN/A#include "params/X86IntelMPLocalIntAssignment.hh"
602137SN/A#include "params/X86IntelMPProcessor.hh"
612137SN/A
628706Sandreas.hansson@arm.com// Extended entry types
632137SN/A#include "params/X86IntelMPAddrSpaceMapping.hh"
642137SN/A#include "params/X86IntelMPBusHierarchy.hh"
652137SN/A#include "params/X86IntelMPCompatAddrSpaceMod.hh"
662484SN/A
672137SN/Ausing namespace std;
682137SN/A
692137SN/Aconst char X86ISA::IntelMP::FloatingPointer::signature[] = "_MP_";
703114Sgblack@eecs.umich.edu
712680Sktlim@umich.edutemplate<class T>
722137SN/Auint8_t
736701Sgblack@eecs.umich.eduwriteOutField(PortProxy* proxy, Addr addr, T val)
746701Sgblack@eecs.umich.edu{
756701Sgblack@eecs.umich.edu    uint64_t guestVal = X86ISA::htog(val);
766701Sgblack@eecs.umich.edu    proxy->writeBlob(addr, (uint8_t *)(&guestVal), sizeof(T));
772137SN/A
782137SN/A    uint8_t checkSum = 0;
796378Sgblack@eecs.umich.edu    while(guestVal) {
806378Sgblack@eecs.umich.edu        checkSum += guestVal;
816378Sgblack@eecs.umich.edu        guestVal >>= 8;
826701Sgblack@eecs.umich.edu    }
836378Sgblack@eecs.umich.edu    return checkSum;
846378Sgblack@eecs.umich.edu}
858706Sandreas.hansson@arm.com
866378Sgblack@eecs.umich.eduuint8_t
876378Sgblack@eecs.umich.eduwriteOutString(PortProxy* proxy, Addr addr, string str, int length)
882137SN/A{
892484SN/A    char cleanedString[length + 1];
902137SN/A    cleanedString[length] = 0;
912137SN/A
922137SN/A    if (str.length() > length) {
932137SN/A        memcpy(cleanedString, str.c_str(), length);
942137SN/A        warn("Intel MP configuration table string \"%s\" "
952137SN/A                "will be truncated to \"%s\".\n", str, cleanedString);
962137SN/A    } else {
972484SN/A        memcpy(cleanedString, str.c_str(), str.length());
982137SN/A        memset(cleanedString + str.length(), 0, length - str.length());
993114Sgblack@eecs.umich.edu    }
1002680Sktlim@umich.edu    proxy->writeBlob(addr, (uint8_t *)(&cleanedString), length);
1012137SN/A
1026701Sgblack@eecs.umich.edu    uint8_t checkSum = 0;
1036701Sgblack@eecs.umich.edu    for (int i = 0; i < length; i++)
1046701Sgblack@eecs.umich.edu        checkSum += cleanedString[i];
1056701Sgblack@eecs.umich.edu
1062137SN/A    return checkSum;
1072137SN/A}
1082137SN/A
1096378Sgblack@eecs.umich.eduAddr
1106378Sgblack@eecs.umich.eduX86ISA::IntelMP::FloatingPointer::writeOut(PortProxy* proxy, Addr addr)
1116378Sgblack@eecs.umich.edu{
1126701Sgblack@eecs.umich.edu    // Make sure that either a config table is present or a default
1136378Sgblack@eecs.umich.edu    // configuration was found but not both.
1148706Sandreas.hansson@arm.com    if (!tableAddr && !defaultConfig)
1156378Sgblack@eecs.umich.edu        fatal("Either an MP configuration table or a default configuration "
1162137SN/A                "must be used.");
1176378Sgblack@eecs.umich.edu    if (tableAddr && defaultConfig)
1186378Sgblack@eecs.umich.edu        fatal("Both an MP configuration table and a default configuration "
1192137SN/A                "were set.");
1202484SN/A
1212137SN/A    uint8_t checkSum = 0;
1222137SN/A
1232137SN/A    proxy->writeBlob(addr, (uint8_t *)signature, 4);
1242137SN/A    for (int i = 0; i < 4; i++)
1252137SN/A        checkSum += signature[i];
1262137SN/A
1272137SN/A    checkSum += writeOutField(proxy, addr + 4, tableAddr);
1286808Sgblack@eecs.umich.edu
1296808Sgblack@eecs.umich.edu    // The length of the structure in paragraphs, aka 16 byte chunks.
1306808Sgblack@eecs.umich.edu    uint8_t length = 1;
1316808Sgblack@eecs.umich.edu    proxy->writeBlob(addr + 8, &length, 1);
1326808Sgblack@eecs.umich.edu    checkSum += length;
1336808Sgblack@eecs.umich.edu
1346808Sgblack@eecs.umich.edu    proxy->writeBlob(addr + 9, &specRev, 1);
1356808Sgblack@eecs.umich.edu    checkSum += specRev;
1366808Sgblack@eecs.umich.edu
1376808Sgblack@eecs.umich.edu    proxy->writeBlob(addr + 11, &defaultConfig, 1);
1382137SN/A    checkSum += defaultConfig;
1392484SN/A
1402137SN/A    uint32_t features2_5 = imcrPresent ? (1 << 7) : 0;
1412137SN/A    checkSum += writeOutField(proxy, addr + 12, features2_5);
1422137SN/A
1432137SN/A    checkSum = -checkSum;
1442553SN/A    proxy->writeBlob(addr + 10, &checkSum, 1);
1452137SN/A
1462484SN/A    return 16;
1472484SN/A}
1482137SN/A
1492137SN/AX86ISA::IntelMP::FloatingPointer::FloatingPointer(Params * p) :
1502484SN/A    SimObject(p), tableAddr(0), specRev(p->spec_rev),
1512137SN/A    defaultConfig(p->default_config), imcrPresent(p->imcr_present)
1522484SN/A{}
1532137SN/A
1542553SN/AX86ISA::IntelMP::FloatingPointer *
1552484SN/AX86IntelMPFloatingPointerParams::create()
1565748SSteve.Reinhardt@amd.com{
1572484SN/A    return new X86ISA::IntelMP::FloatingPointer(this);
1582137SN/A}
1592484SN/A
1602484SN/AAddr
1612137SN/AX86ISA::IntelMP::BaseConfigEntry::writeOut(PortProxy* proxy,
1622137SN/A        Addr addr, uint8_t &checkSum)
1632484SN/A{
1642484SN/A    proxy->writeBlob(addr, &type, 1);
1652484SN/A    checkSum += type;
1662484SN/A    return 1;
1672484SN/A}
1682484SN/A
1692484SN/AX86ISA::IntelMP::BaseConfigEntry::BaseConfigEntry(Params * p, uint8_t _type) :
1702484SN/A    SimObject(p), type(_type)
1712484SN/A{}
1722137SN/A
1732484SN/AAddr
1742484SN/AX86ISA::IntelMP::ExtConfigEntry::writeOut(PortProxy* proxy,
1752137SN/A        Addr addr, uint8_t &checkSum)
1764661Sksewell@umich.edu{
1772484SN/A    proxy->writeBlob(addr, &type, 1);
1785513SMichael.Adler@intel.com    checkSum += type;
1792484SN/A    proxy->writeBlob(addr + 1, &length, 1);
1802137SN/A    checkSum += length;
1814661Sksewell@umich.edu    return 1;
1822484SN/A}
1832484SN/A
1845748SSteve.Reinhardt@amd.comX86ISA::IntelMP::ExtConfigEntry::ExtConfigEntry(Params * p,
1852491SN/A        uint8_t _type, uint8_t _length) :
1862484SN/A    SimObject(p), type(_type), length(_length)
1872484SN/A{}
1882491SN/A
1892491SN/Aconst char X86ISA::IntelMP::ConfigTable::signature[] = "PCMP";
1902137SN/A
1912484SN/AAddr
1922484SN/AX86ISA::IntelMP::ConfigTable::writeOut(PortProxy* proxy, Addr addr)
1935867Sksewell@umich.edu{
1942686Sksewell@umich.edu    uint8_t checkSum = 0;
1952484SN/A
1962484SN/A    proxy->writeBlob(addr, (uint8_t *)signature, 4);
1972484SN/A    for (int i = 0; i < 4; i++)
1982484SN/A        checkSum += signature[i];
1995513SMichael.Adler@intel.com
2002137SN/A    // Base table length goes here but will be calculated later.
2012484SN/A
2022484SN/A    proxy->writeBlob(addr + 6, (uint8_t *)(&specRev), 1);
2032484SN/A    checkSum += specRev;
2042484SN/A
2052484SN/A    // The checksum goes here but is still being calculated.
2062495SN/A
2072495SN/A    checkSum += writeOutString(proxy, addr + 8, oemID, 8);
2082484SN/A    checkSum += writeOutString(proxy, addr + 16, productID, 12);
2092484SN/A
2102495SN/A    checkSum += writeOutField(proxy, addr + 28, oemTableAddr);
2112484SN/A    checkSum += writeOutField(proxy, addr + 32, oemTableSize);
2122495SN/A    checkSum += writeOutField(proxy, addr + 34, (uint16_t)baseEntries.size());
2132484SN/A    checkSum += writeOutField(proxy, addr + 36, localApic);
2146378Sgblack@eecs.umich.edu
2156378Sgblack@eecs.umich.edu    uint8_t reserved = 0;
2164661Sksewell@umich.edu    proxy->writeBlob(addr + 43, &reserved, 1);
2172484SN/A    checkSum += reserved;
2182484SN/A
2192484SN/A    vector<BaseConfigEntry *>::iterator baseEnt;
2202484SN/A    uint16_t offset = 44;
2212484SN/A    for (baseEnt = baseEntries.begin();
2222484SN/A            baseEnt != baseEntries.end(); baseEnt++) {
2232484SN/A        offset += (*baseEnt)->writeOut(proxy, addr + offset, checkSum);
2245513SMichael.Adler@intel.com    }
2252484SN/A
2262484SN/A    // We've found the end of the base table this point.
2272484SN/A    checkSum += writeOutField(proxy, addr + 4, offset);
2282484SN/A
2292553SN/A    vector<ExtConfigEntry *>::iterator extEnt;
2302495SN/A    uint16_t extOffset = 0;
2312686Sksewell@umich.edu    uint8_t extCheckSum = 0;
2322686Sksewell@umich.edu    for (extEnt = extEntries.begin();
2334661Sksewell@umich.edu            extEnt != extEntries.end(); extEnt++) {
2344661Sksewell@umich.edu        extOffset += (*extEnt)->writeOut(proxy,
2352484SN/A                addr + offset + extOffset, extCheckSum);
2362484SN/A    }
2372484SN/A
2382484SN/A    checkSum += writeOutField(proxy, addr + 40, extOffset);
2392484SN/A    extCheckSum = -extCheckSum;
2402484SN/A    checkSum += writeOutField(proxy, addr + 42, extCheckSum);
2412484SN/A
2422484SN/A    // And now, we finally have the whole check sum completed.
2432484SN/A    checkSum = -checkSum;
2442484SN/A    writeOutField(proxy, addr + 7, checkSum);
2452553SN/A
2462484SN/A    return offset + extOffset;
2472553SN/A};
2482484SN/A
2492484SN/AX86ISA::IntelMP::ConfigTable::ConfigTable(Params * p) : SimObject(p),
2502484SN/A    specRev(p->spec_rev), oemID(p->oem_id), productID(p->product_id),
2512484SN/A    oemTableAddr(p->oem_table_addr), oemTableSize(p->oem_table_size),
2522484SN/A    localApic(p->local_apic),
2532484SN/A    baseEntries(p->base_entries), extEntries(p->ext_entries)
2542484SN/A{}
2556640Svince@csl.cornell.edu
2562484SN/AX86ISA::IntelMP::ConfigTable *
2572484SN/AX86IntelMPConfigTableParams::create()
2582484SN/A{
2596378Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::ConfigTable(this);
2602484SN/A}
2612492SN/A
2622491SN/AAddr
2632491SN/AX86ISA::IntelMP::Processor::writeOut(
2642495SN/A        PortProxy* proxy, Addr addr, uint8_t &checkSum)
2652484SN/A{
2662484SN/A    BaseConfigEntry::writeOut(proxy, addr, checkSum);
2672484SN/A    checkSum += writeOutField(proxy, addr + 1, localApicID);
2682484SN/A    checkSum += writeOutField(proxy, addr + 2, localApicVersion);
2692484SN/A    checkSum += writeOutField(proxy, addr + 3, cpuFlags);
2702484SN/A    checkSum += writeOutField(proxy, addr + 4, cpuSignature);
2712484SN/A    checkSum += writeOutField(proxy, addr + 8, featureFlags);
2722484SN/A
2732484SN/A    uint32_t reserved = 0;
2742484SN/A    proxy->writeBlob(addr + 12, (uint8_t *)(&reserved), 4);
2752484SN/A    proxy->writeBlob(addr + 16, (uint8_t *)(&reserved), 4);
2762484SN/A    return 20;
2772484SN/A}
2782484SN/A
2792484SN/AX86ISA::IntelMP::Processor::Processor(Params * p) : BaseConfigEntry(p, 0),
28010495Snilay@cs.wisc.edu    localApicID(p->local_apic_id), localApicVersion(p->local_apic_version),
2812484SN/A    cpuFlags(0), cpuSignature(0), featureFlags(p->feature_flags)
2822484SN/A{
2832686Sksewell@umich.edu    if (p->enable)
2842484SN/A        cpuFlags |= (1 << 0);
2852553SN/A    if (p->bootstrap)
2862484SN/A        cpuFlags |= (1 << 1);
2872484SN/A
2882484SN/A    replaceBits(cpuSignature, 0, 3, p->stepping);
2892484SN/A    replaceBits(cpuSignature, 4, 7, p->model);
2902484SN/A    replaceBits(cpuSignature, 8, 11, p->family);
2912484SN/A}
2924661Sksewell@umich.edu
2932484SN/AX86ISA::IntelMP::Processor *
2942484SN/AX86IntelMPProcessorParams::create()
2952484SN/A{
2962484SN/A    return new X86ISA::IntelMP::Processor(this);
2972484SN/A}
2982484SN/A
2992484SN/AAddr
3002484SN/AX86ISA::IntelMP::Bus::writeOut(
3012484SN/A        PortProxy* proxy, Addr addr, uint8_t &checkSum)
3022484SN/A{
3032484SN/A    BaseConfigEntry::writeOut(proxy, addr, checkSum);
3042484SN/A    checkSum += writeOutField(proxy, addr + 1, busID);
3052484SN/A    checkSum += writeOutString(proxy, addr + 2, busType, 6);
3065877Shsul@eecs.umich.edu    return 8;
3072484SN/A}
3082484SN/A
3092484SN/AX86ISA::IntelMP::Bus::Bus(Params * p) : BaseConfigEntry(p, 1),
3102484SN/A    busID(p->bus_id), busType(p->bus_type)
3112484SN/A{}
3122484SN/A
3132484SN/AX86ISA::IntelMP::Bus *
3142484SN/AX86IntelMPBusParams::create()
3152484SN/A{
3162484SN/A    return new X86ISA::IntelMP::Bus(this);
3172484SN/A}
3182484SN/A
3192484SN/AAddr
3202484SN/AX86ISA::IntelMP::IOAPIC::writeOut(
3212137SN/A        PortProxy* proxy, Addr addr, uint8_t &checkSum)
3222484SN/A{
3232484SN/A    BaseConfigEntry::writeOut(proxy, addr, checkSum);
3242484SN/A    checkSum += writeOutField(proxy, addr + 1, id);
3252484SN/A    checkSum += writeOutField(proxy, addr + 2, version);
3262484SN/A    checkSum += writeOutField(proxy, addr + 3, flags);
3272484SN/A    checkSum += writeOutField(proxy, addr + 4, address);
3282484SN/A    return 8;
3292484SN/A}
3302484SN/A
3312484SN/AX86ISA::IntelMP::IOAPIC::IOAPIC(Params * p) : BaseConfigEntry(p, 2),
3322484SN/A    id(p->id), version(p->version), flags(0), address(p->address)
3336378Sgblack@eecs.umich.edu{
3346378Sgblack@eecs.umich.edu    if (p->enable)
3352484SN/A        flags |= 1;
3362484SN/A}
3372484SN/A
3386378Sgblack@eecs.umich.eduX86ISA::IntelMP::IOAPIC *
3392484SN/AX86IntelMPIOAPICParams::create()
3402484SN/A{
3412484SN/A    return new X86ISA::IntelMP::IOAPIC(this);
3425513SMichael.Adler@intel.com}
3432484SN/A
3442484SN/AAddr
3452484SN/AX86ISA::IntelMP::IntAssignment::writeOut(
3462484SN/A        PortProxy* proxy, Addr addr, uint8_t &checkSum)
3472484SN/A{
3482484SN/A    BaseConfigEntry::writeOut(proxy, addr, checkSum);
3492484SN/A    checkSum += writeOutField(proxy, addr + 1, interruptType);
3502484SN/A    checkSum += writeOutField(proxy, addr + 2, flags);
3512484SN/A    checkSum += writeOutField(proxy, addr + 4, sourceBusID);
3522484SN/A    checkSum += writeOutField(proxy, addr + 5, sourceBusIRQ);
3532553SN/A    checkSum += writeOutField(proxy, addr + 6, destApicID);
3542553SN/A    checkSum += writeOutField(proxy, addr + 7, destApicIntIn);
3552484SN/A    return 8;
3562484SN/A}
3572484SN/A
35810495Snilay@cs.wisc.eduX86ISA::IntelMP::IOIntAssignment::IOIntAssignment(Params * p) :
3592686Sksewell@umich.edu    IntAssignment(p, p->interrupt_type, p->polarity, p->trigger, 3,
3602484SN/A            p->source_bus_id, p->source_bus_irq,
3612484SN/A            p->dest_io_apic_id, p->dest_io_apic_intin)
3622484SN/A{}
3632484SN/A
3642484SN/AX86ISA::IntelMP::IOIntAssignment *
3652484SN/AX86IntelMPIOIntAssignmentParams::create()
3662484SN/A{
3672484SN/A    return new X86ISA::IntelMP::IOIntAssignment(this);
3682484SN/A}
3692484SN/A
3702484SN/AX86ISA::IntelMP::LocalIntAssignment::LocalIntAssignment(Params * p) :
3712484SN/A    IntAssignment(p, p->interrupt_type, p->polarity, p->trigger, 4,
3722484SN/A            p->source_bus_id, p->source_bus_irq,
3732484SN/A            p->dest_local_apic_id, p->dest_local_apic_intin)
3742484SN/A{}
3752484SN/A
3762484SN/AX86ISA::IntelMP::LocalIntAssignment *
3772484SN/AX86IntelMPLocalIntAssignmentParams::create()
3782484SN/A{
3792484SN/A    return new X86ISA::IntelMP::LocalIntAssignment(this);
3802484SN/A}
3812484SN/A
3822484SN/AAddr
3832484SN/AX86ISA::IntelMP::AddrSpaceMapping::writeOut(
3842484SN/A        PortProxy* proxy, Addr addr, uint8_t &checkSum)
3852495SN/A{
3862484SN/A    ExtConfigEntry::writeOut(proxy, addr, checkSum);
3872484SN/A    checkSum += writeOutField(proxy, addr + 2, busID);
3882484SN/A    checkSum += writeOutField(proxy, addr + 3, addrType);
3892484SN/A    checkSum += writeOutField(proxy, addr + 4, addr);
3902484SN/A    checkSum += writeOutField(proxy, addr + 12, addrLength);
3912484SN/A    return length;
3922484SN/A}
3932484SN/A
3942484SN/AX86ISA::IntelMP::AddrSpaceMapping::AddrSpaceMapping(Params * p) :
3952484SN/A    ExtConfigEntry(p, 128, 20),
3962484SN/A    busID(p->bus_id), addrType(p->address_type),
3972484SN/A    addr(p->address), addrLength(p->length)
3982484SN/A{}
3992484SN/A
4002484SN/AX86ISA::IntelMP::AddrSpaceMapping *
4012484SN/AX86IntelMPAddrSpaceMappingParams::create()
4022484SN/A{
4032484SN/A    return new X86ISA::IntelMP::AddrSpaceMapping(this);
4042484SN/A}
4052484SN/A
4062484SN/AAddr
4072484SN/AX86ISA::IntelMP::BusHierarchy::writeOut(
4082484SN/A        PortProxy* proxy, Addr addr, uint8_t &checkSum)
4092484SN/A{
4102484SN/A    ExtConfigEntry::writeOut(proxy, addr, checkSum);
4112484SN/A    checkSum += writeOutField(proxy, addr + 2, busID);
4122484SN/A    checkSum += writeOutField(proxy, addr + 3, info);
4132484SN/A    checkSum += writeOutField(proxy, addr + 4, parentBus);
4142484SN/A
4152484SN/A    uint32_t reserved = 0;
4162484SN/A    proxy->writeBlob(addr + 5, (uint8_t *)(&reserved), 3);
4172484SN/A
4182137SN/A    return length;
4192484SN/A}
4202484SN/A
4216805Sgblack@eecs.umich.eduX86ISA::IntelMP::BusHierarchy::BusHierarchy(Params * p) :
4226808Sgblack@eecs.umich.edu    ExtConfigEntry(p, 129, 8),
4236805Sgblack@eecs.umich.edu    busID(p->bus_id), info(0), parentBus(p->parent_bus)
4246805Sgblack@eecs.umich.edu{
4256805Sgblack@eecs.umich.edu    if (p->subtractive_decode)
4266805Sgblack@eecs.umich.edu        info |= 1;
4276805Sgblack@eecs.umich.edu}
4286805Sgblack@eecs.umich.edu
4296805Sgblack@eecs.umich.eduX86ISA::IntelMP::BusHierarchy *
4306805Sgblack@eecs.umich.eduX86IntelMPBusHierarchyParams::create()
4316805Sgblack@eecs.umich.edu{
4326805Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::BusHierarchy(this);
4336805Sgblack@eecs.umich.edu}
4346805Sgblack@eecs.umich.edu
4356805Sgblack@eecs.umich.eduAddr
4366805Sgblack@eecs.umich.eduX86ISA::IntelMP::CompatAddrSpaceMod::writeOut(
4376805Sgblack@eecs.umich.edu        PortProxy* proxy, Addr addr, uint8_t &checkSum)
4386805Sgblack@eecs.umich.edu{
4396805Sgblack@eecs.umich.edu    ExtConfigEntry::writeOut(proxy, addr, checkSum);
4406805Sgblack@eecs.umich.edu    checkSum += writeOutField(proxy, addr + 2, busID);
4416805Sgblack@eecs.umich.edu    checkSum += writeOutField(proxy, addr + 3, mod);
4426805Sgblack@eecs.umich.edu    checkSum += writeOutField(proxy, addr + 4, rangeList);
4436805Sgblack@eecs.umich.edu    return length;
4446805Sgblack@eecs.umich.edu}
4456805Sgblack@eecs.umich.edu
4466805Sgblack@eecs.umich.eduX86ISA::IntelMP::CompatAddrSpaceMod::CompatAddrSpaceMod(Params * p) :
4476805Sgblack@eecs.umich.edu    ExtConfigEntry(p, 130, 8),
4486805Sgblack@eecs.umich.edu    busID(p->bus_id), mod(0), rangeList(p->range_list)
4496805Sgblack@eecs.umich.edu{
4506805Sgblack@eecs.umich.edu    if (p->add)
4516805Sgblack@eecs.umich.edu        mod |= 1;
4526805Sgblack@eecs.umich.edu}
4536805Sgblack@eecs.umich.edu
4546805Sgblack@eecs.umich.eduX86ISA::IntelMP::CompatAddrSpaceMod *
4556805Sgblack@eecs.umich.eduX86IntelMPCompatAddrSpaceModParams::create()
4566805Sgblack@eecs.umich.edu{
4576805Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::CompatAddrSpaceMod(this);
4586805Sgblack@eecs.umich.edu}
4592137SN/A