intelmp.cc revision 8852
15625Sgblack@eecs.umich.edu/*
25625Sgblack@eecs.umich.edu * Copyright (c) 2008 The Hewlett-Packard Development Company
35625Sgblack@eecs.umich.edu * All rights reserved.
45625Sgblack@eecs.umich.edu *
57087Snate@binkert.org * The license below extends only to copyright in the software and shall
67087Snate@binkert.org * not be construed as granting a license to any other intellectual
77087Snate@binkert.org * property including but not limited to intellectual property relating
87087Snate@binkert.org * to a hardware implementation of the functionality of the software
97087Snate@binkert.org * licensed hereunder.  You may use the software subject to the license
107087Snate@binkert.org * terms below provided that you ensure that this notice is replicated
117087Snate@binkert.org * unmodified and in its entirety in all distributions of the software,
127087Snate@binkert.org * modified or unmodified, in source code or in binary form.
135625Sgblack@eecs.umich.edu *
147087Snate@binkert.org * Redistribution and use in source and binary forms, with or without
157087Snate@binkert.org * modification, are permitted provided that the following conditions are
167087Snate@binkert.org * met: redistributions of source code must retain the above copyright
177087Snate@binkert.org * notice, this list of conditions and the following disclaimer;
187087Snate@binkert.org * redistributions in binary form must reproduce the above copyright
197087Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
207087Snate@binkert.org * documentation and/or other materials provided with the distribution;
217087Snate@binkert.org * neither the name of the copyright holders nor the names of its
225625Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
237087Snate@binkert.org * this software without specific prior written permission.
245625Sgblack@eecs.umich.edu *
255625Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
265625Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
275625Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
285625Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
295625Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
305625Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
315625Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
325625Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
335625Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
345625Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
355625Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
365625Sgblack@eecs.umich.edu *
375625Sgblack@eecs.umich.edu * Authors: Gabe Black
385625Sgblack@eecs.umich.edu */
395625Sgblack@eecs.umich.edu
405625Sgblack@eecs.umich.edu#include "arch/x86/bios/intelmp.hh"
415625Sgblack@eecs.umich.edu#include "arch/x86/isa_traits.hh"
425625Sgblack@eecs.umich.edu#include "base/misc.hh"
436216Snate@binkert.org#include "base/types.hh"
448706Sandreas.hansson@arm.com#include "mem/port_proxy.hh"
455625Sgblack@eecs.umich.edu#include "sim/byteswap.hh"
465625Sgblack@eecs.umich.edu
475625Sgblack@eecs.umich.edu// Config entry types
485625Sgblack@eecs.umich.edu#include "params/X86IntelMPBaseConfigEntry.hh"
495625Sgblack@eecs.umich.edu#include "params/X86IntelMPExtConfigEntry.hh"
505625Sgblack@eecs.umich.edu
515625Sgblack@eecs.umich.edu// General table structures
525625Sgblack@eecs.umich.edu#include "params/X86IntelMPConfigTable.hh"
535625Sgblack@eecs.umich.edu#include "params/X86IntelMPFloatingPointer.hh"
545625Sgblack@eecs.umich.edu
555625Sgblack@eecs.umich.edu// Base entry types
565625Sgblack@eecs.umich.edu#include "params/X86IntelMPBus.hh"
575625Sgblack@eecs.umich.edu#include "params/X86IntelMPIOAPIC.hh"
585625Sgblack@eecs.umich.edu#include "params/X86IntelMPIOIntAssignment.hh"
595625Sgblack@eecs.umich.edu#include "params/X86IntelMPLocalIntAssignment.hh"
605625Sgblack@eecs.umich.edu#include "params/X86IntelMPProcessor.hh"
615625Sgblack@eecs.umich.edu
625625Sgblack@eecs.umich.edu// Extended entry types
635625Sgblack@eecs.umich.edu#include "params/X86IntelMPAddrSpaceMapping.hh"
645625Sgblack@eecs.umich.edu#include "params/X86IntelMPBusHierarchy.hh"
655625Sgblack@eecs.umich.edu#include "params/X86IntelMPCompatAddrSpaceMod.hh"
665625Sgblack@eecs.umich.edu
675625Sgblack@eecs.umich.eduusing namespace std;
685625Sgblack@eecs.umich.edu
695625Sgblack@eecs.umich.educonst char X86ISA::IntelMP::FloatingPointer::signature[] = "_MP_";
705625Sgblack@eecs.umich.edu
715625Sgblack@eecs.umich.edutemplate<class T>
725625Sgblack@eecs.umich.eduuint8_t
738852Sandreas.hansson@arm.comwriteOutField(PortProxy& proxy, Addr addr, T val)
745625Sgblack@eecs.umich.edu{
758737Skoansin.tan@gmail.com    uint64_t guestVal = X86ISA::htog(val);
768852Sandreas.hansson@arm.com    proxy.writeBlob(addr, (uint8_t *)(&guestVal), sizeof(T));
775625Sgblack@eecs.umich.edu
785625Sgblack@eecs.umich.edu    uint8_t checkSum = 0;
795625Sgblack@eecs.umich.edu    while(guestVal) {
805625Sgblack@eecs.umich.edu        checkSum += guestVal;
815625Sgblack@eecs.umich.edu        guestVal >>= 8;
825625Sgblack@eecs.umich.edu    }
835625Sgblack@eecs.umich.edu    return checkSum;
845625Sgblack@eecs.umich.edu}
855625Sgblack@eecs.umich.edu
865625Sgblack@eecs.umich.eduuint8_t
878852Sandreas.hansson@arm.comwriteOutString(PortProxy& proxy, Addr addr, string str, int length)
885625Sgblack@eecs.umich.edu{
895625Sgblack@eecs.umich.edu    char cleanedString[length + 1];
905625Sgblack@eecs.umich.edu    cleanedString[length] = 0;
915625Sgblack@eecs.umich.edu
925625Sgblack@eecs.umich.edu    if (str.length() > length) {
935625Sgblack@eecs.umich.edu        memcpy(cleanedString, str.c_str(), length);
945625Sgblack@eecs.umich.edu        warn("Intel MP configuration table string \"%s\" "
955625Sgblack@eecs.umich.edu                "will be truncated to \"%s\".\n", str, cleanedString);
965625Sgblack@eecs.umich.edu    } else {
975625Sgblack@eecs.umich.edu        memcpy(cleanedString, str.c_str(), str.length());
985625Sgblack@eecs.umich.edu        memset(cleanedString + str.length(), 0, length - str.length());
995625Sgblack@eecs.umich.edu    }
1008852Sandreas.hansson@arm.com    proxy.writeBlob(addr, (uint8_t *)(&cleanedString), length);
1015625Sgblack@eecs.umich.edu
1025625Sgblack@eecs.umich.edu    uint8_t checkSum = 0;
1035625Sgblack@eecs.umich.edu    for (int i = 0; i < length; i++)
1045625Sgblack@eecs.umich.edu        checkSum += cleanedString[i];
1055625Sgblack@eecs.umich.edu
1065625Sgblack@eecs.umich.edu    return checkSum;
1075625Sgblack@eecs.umich.edu}
1085625Sgblack@eecs.umich.edu
1095625Sgblack@eecs.umich.eduAddr
1108852Sandreas.hansson@arm.comX86ISA::IntelMP::FloatingPointer::writeOut(PortProxy& proxy, Addr addr)
1115625Sgblack@eecs.umich.edu{
1125625Sgblack@eecs.umich.edu    // Make sure that either a config table is present or a default
1135625Sgblack@eecs.umich.edu    // configuration was found but not both.
1145625Sgblack@eecs.umich.edu    if (!tableAddr && !defaultConfig)
1155625Sgblack@eecs.umich.edu        fatal("Either an MP configuration table or a default configuration "
1165625Sgblack@eecs.umich.edu                "must be used.");
1175625Sgblack@eecs.umich.edu    if (tableAddr && defaultConfig)
1185625Sgblack@eecs.umich.edu        fatal("Both an MP configuration table and a default configuration "
1195625Sgblack@eecs.umich.edu                "were set.");
1205625Sgblack@eecs.umich.edu
1215625Sgblack@eecs.umich.edu    uint8_t checkSum = 0;
1225625Sgblack@eecs.umich.edu
1238852Sandreas.hansson@arm.com    proxy.writeBlob(addr, (uint8_t *)signature, 4);
1245625Sgblack@eecs.umich.edu    for (int i = 0; i < 4; i++)
1255625Sgblack@eecs.umich.edu        checkSum += signature[i];
1265625Sgblack@eecs.umich.edu
1278706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, tableAddr);
1285625Sgblack@eecs.umich.edu
1295625Sgblack@eecs.umich.edu    // The length of the structure in paragraphs, aka 16 byte chunks.
1305625Sgblack@eecs.umich.edu    uint8_t length = 1;
1318852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 8, &length, 1);
1325625Sgblack@eecs.umich.edu    checkSum += length;
1335625Sgblack@eecs.umich.edu
1348852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 9, &specRev, 1);
1355625Sgblack@eecs.umich.edu    checkSum += specRev;
1365625Sgblack@eecs.umich.edu
1378852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 11, &defaultConfig, 1);
1385625Sgblack@eecs.umich.edu    checkSum += defaultConfig;
1395625Sgblack@eecs.umich.edu
1405625Sgblack@eecs.umich.edu    uint32_t features2_5 = imcrPresent ? (1 << 7) : 0;
1418706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 12, features2_5);
1425625Sgblack@eecs.umich.edu
1435625Sgblack@eecs.umich.edu    checkSum = -checkSum;
1448852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 10, &checkSum, 1);
1455625Sgblack@eecs.umich.edu
1465625Sgblack@eecs.umich.edu    return 16;
1475625Sgblack@eecs.umich.edu}
1485625Sgblack@eecs.umich.edu
1495625Sgblack@eecs.umich.eduX86ISA::IntelMP::FloatingPointer::FloatingPointer(Params * p) :
1505625Sgblack@eecs.umich.edu    SimObject(p), tableAddr(0), specRev(p->spec_rev),
1515625Sgblack@eecs.umich.edu    defaultConfig(p->default_config), imcrPresent(p->imcr_present)
1525625Sgblack@eecs.umich.edu{}
1535625Sgblack@eecs.umich.edu
1545625Sgblack@eecs.umich.eduX86ISA::IntelMP::FloatingPointer *
1555625Sgblack@eecs.umich.eduX86IntelMPFloatingPointerParams::create()
1565625Sgblack@eecs.umich.edu{
1575625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::FloatingPointer(this);
1585625Sgblack@eecs.umich.edu}
1595625Sgblack@eecs.umich.edu
1605625Sgblack@eecs.umich.eduAddr
1618852Sandreas.hansson@arm.comX86ISA::IntelMP::BaseConfigEntry::writeOut(PortProxy& proxy,
1625625Sgblack@eecs.umich.edu        Addr addr, uint8_t &checkSum)
1635625Sgblack@eecs.umich.edu{
1648852Sandreas.hansson@arm.com    proxy.writeBlob(addr, &type, 1);
1655625Sgblack@eecs.umich.edu    checkSum += type;
1665625Sgblack@eecs.umich.edu    return 1;
1675625Sgblack@eecs.umich.edu}
1685625Sgblack@eecs.umich.edu
1695625Sgblack@eecs.umich.eduX86ISA::IntelMP::BaseConfigEntry::BaseConfigEntry(Params * p, uint8_t _type) :
1705625Sgblack@eecs.umich.edu    SimObject(p), type(_type)
1715625Sgblack@eecs.umich.edu{}
1725625Sgblack@eecs.umich.edu
1735625Sgblack@eecs.umich.eduAddr
1748852Sandreas.hansson@arm.comX86ISA::IntelMP::ExtConfigEntry::writeOut(PortProxy& proxy,
1755625Sgblack@eecs.umich.edu        Addr addr, uint8_t &checkSum)
1765625Sgblack@eecs.umich.edu{
1778852Sandreas.hansson@arm.com    proxy.writeBlob(addr, &type, 1);
1785625Sgblack@eecs.umich.edu    checkSum += type;
1798852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 1, &length, 1);
1805625Sgblack@eecs.umich.edu    checkSum += length;
1815625Sgblack@eecs.umich.edu    return 1;
1825625Sgblack@eecs.umich.edu}
1835625Sgblack@eecs.umich.edu
1845625Sgblack@eecs.umich.eduX86ISA::IntelMP::ExtConfigEntry::ExtConfigEntry(Params * p,
1855625Sgblack@eecs.umich.edu        uint8_t _type, uint8_t _length) :
1865625Sgblack@eecs.umich.edu    SimObject(p), type(_type), length(_length)
1875625Sgblack@eecs.umich.edu{}
1885625Sgblack@eecs.umich.edu
1895625Sgblack@eecs.umich.educonst char X86ISA::IntelMP::ConfigTable::signature[] = "PCMP";
1905625Sgblack@eecs.umich.edu
1915625Sgblack@eecs.umich.eduAddr
1928852Sandreas.hansson@arm.comX86ISA::IntelMP::ConfigTable::writeOut(PortProxy& proxy, Addr addr)
1935625Sgblack@eecs.umich.edu{
1945625Sgblack@eecs.umich.edu    uint8_t checkSum = 0;
1955625Sgblack@eecs.umich.edu
1968852Sandreas.hansson@arm.com    proxy.writeBlob(addr, (uint8_t *)signature, 4);
1975625Sgblack@eecs.umich.edu    for (int i = 0; i < 4; i++)
1985625Sgblack@eecs.umich.edu        checkSum += signature[i];
1995625Sgblack@eecs.umich.edu
2005625Sgblack@eecs.umich.edu    // Base table length goes here but will be calculated later.
2015625Sgblack@eecs.umich.edu
2028852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 6, (uint8_t *)(&specRev), 1);
2035625Sgblack@eecs.umich.edu    checkSum += specRev;
2045625Sgblack@eecs.umich.edu
2055625Sgblack@eecs.umich.edu    // The checksum goes here but is still being calculated.
2065625Sgblack@eecs.umich.edu
2078706Sandreas.hansson@arm.com    checkSum += writeOutString(proxy, addr + 8, oemID, 8);
2088706Sandreas.hansson@arm.com    checkSum += writeOutString(proxy, addr + 16, productID, 12);
2095625Sgblack@eecs.umich.edu
2108706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 28, oemTableAddr);
2118706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 32, oemTableSize);
2128706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 34, (uint16_t)baseEntries.size());
2138706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 36, localApic);
2145625Sgblack@eecs.umich.edu
2155625Sgblack@eecs.umich.edu    uint8_t reserved = 0;
2168852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 43, &reserved, 1);
2175625Sgblack@eecs.umich.edu    checkSum += reserved;
2185625Sgblack@eecs.umich.edu
2195625Sgblack@eecs.umich.edu    vector<BaseConfigEntry *>::iterator baseEnt;
2205625Sgblack@eecs.umich.edu    uint16_t offset = 44;
2215625Sgblack@eecs.umich.edu    for (baseEnt = baseEntries.begin();
2225625Sgblack@eecs.umich.edu            baseEnt != baseEntries.end(); baseEnt++) {
2238706Sandreas.hansson@arm.com        offset += (*baseEnt)->writeOut(proxy, addr + offset, checkSum);
2245625Sgblack@eecs.umich.edu    }
2255625Sgblack@eecs.umich.edu
2265625Sgblack@eecs.umich.edu    // We've found the end of the base table this point.
2278706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, offset);
2285625Sgblack@eecs.umich.edu
2295625Sgblack@eecs.umich.edu    vector<ExtConfigEntry *>::iterator extEnt;
2305625Sgblack@eecs.umich.edu    uint16_t extOffset = 0;
2315625Sgblack@eecs.umich.edu    uint8_t extCheckSum = 0;
2325625Sgblack@eecs.umich.edu    for (extEnt = extEntries.begin();
2335625Sgblack@eecs.umich.edu            extEnt != extEntries.end(); extEnt++) {
2348706Sandreas.hansson@arm.com        extOffset += (*extEnt)->writeOut(proxy,
2355625Sgblack@eecs.umich.edu                addr + offset + extOffset, extCheckSum);
2365625Sgblack@eecs.umich.edu    }
2375625Sgblack@eecs.umich.edu
2388706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 40, extOffset);
2395625Sgblack@eecs.umich.edu    extCheckSum = -extCheckSum;
2408706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 42, extCheckSum);
2415625Sgblack@eecs.umich.edu
2425625Sgblack@eecs.umich.edu    // And now, we finally have the whole check sum completed.
2435625Sgblack@eecs.umich.edu    checkSum = -checkSum;
2448706Sandreas.hansson@arm.com    writeOutField(proxy, addr + 7, checkSum);
2455625Sgblack@eecs.umich.edu
2465625Sgblack@eecs.umich.edu    return offset + extOffset;
2475625Sgblack@eecs.umich.edu};
2485625Sgblack@eecs.umich.edu
2495625Sgblack@eecs.umich.eduX86ISA::IntelMP::ConfigTable::ConfigTable(Params * p) : SimObject(p),
2505625Sgblack@eecs.umich.edu    specRev(p->spec_rev), oemID(p->oem_id), productID(p->product_id),
2515625Sgblack@eecs.umich.edu    oemTableAddr(p->oem_table_addr), oemTableSize(p->oem_table_size),
2525625Sgblack@eecs.umich.edu    localApic(p->local_apic),
2535625Sgblack@eecs.umich.edu    baseEntries(p->base_entries), extEntries(p->ext_entries)
2545625Sgblack@eecs.umich.edu{}
2555625Sgblack@eecs.umich.edu
2565625Sgblack@eecs.umich.eduX86ISA::IntelMP::ConfigTable *
2575625Sgblack@eecs.umich.eduX86IntelMPConfigTableParams::create()
2585625Sgblack@eecs.umich.edu{
2595625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::ConfigTable(this);
2605625Sgblack@eecs.umich.edu}
2615625Sgblack@eecs.umich.edu
2625625Sgblack@eecs.umich.eduAddr
2635625Sgblack@eecs.umich.eduX86ISA::IntelMP::Processor::writeOut(
2648852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
2655625Sgblack@eecs.umich.edu{
2668706Sandreas.hansson@arm.com    BaseConfigEntry::writeOut(proxy, addr, checkSum);
2678706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 1, localApicID);
2688706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 2, localApicVersion);
2698706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 3, cpuFlags);
2708706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, cpuSignature);
2718706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 8, featureFlags);
2725625Sgblack@eecs.umich.edu
2735625Sgblack@eecs.umich.edu    uint32_t reserved = 0;
2748852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 12, (uint8_t *)(&reserved), 4);
2758852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 16, (uint8_t *)(&reserved), 4);
2765625Sgblack@eecs.umich.edu    return 20;
2775625Sgblack@eecs.umich.edu}
2785625Sgblack@eecs.umich.edu
2795625Sgblack@eecs.umich.eduX86ISA::IntelMP::Processor::Processor(Params * p) : BaseConfigEntry(p, 0),
2805625Sgblack@eecs.umich.edu    localApicID(p->local_apic_id), localApicVersion(p->local_apic_version),
2815625Sgblack@eecs.umich.edu    cpuFlags(0), cpuSignature(0), featureFlags(p->feature_flags)
2825625Sgblack@eecs.umich.edu{
2835625Sgblack@eecs.umich.edu    if (p->enable)
2845625Sgblack@eecs.umich.edu        cpuFlags |= (1 << 0);
2855625Sgblack@eecs.umich.edu    if (p->bootstrap)
2865625Sgblack@eecs.umich.edu        cpuFlags |= (1 << 1);
2875625Sgblack@eecs.umich.edu
2885625Sgblack@eecs.umich.edu    replaceBits(cpuSignature, 0, 3, p->stepping);
2895625Sgblack@eecs.umich.edu    replaceBits(cpuSignature, 4, 7, p->model);
2905625Sgblack@eecs.umich.edu    replaceBits(cpuSignature, 8, 11, p->family);
2915625Sgblack@eecs.umich.edu}
2925625Sgblack@eecs.umich.edu
2935625Sgblack@eecs.umich.eduX86ISA::IntelMP::Processor *
2945625Sgblack@eecs.umich.eduX86IntelMPProcessorParams::create()
2955625Sgblack@eecs.umich.edu{
2965625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::Processor(this);
2975625Sgblack@eecs.umich.edu}
2985625Sgblack@eecs.umich.edu
2995625Sgblack@eecs.umich.eduAddr
3005625Sgblack@eecs.umich.eduX86ISA::IntelMP::Bus::writeOut(
3018852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
3025625Sgblack@eecs.umich.edu{
3038706Sandreas.hansson@arm.com    BaseConfigEntry::writeOut(proxy, addr, checkSum);
3048706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 1, busID);
3058706Sandreas.hansson@arm.com    checkSum += writeOutString(proxy, addr + 2, busType, 6);
3065625Sgblack@eecs.umich.edu    return 8;
3075625Sgblack@eecs.umich.edu}
3085625Sgblack@eecs.umich.edu
3095625Sgblack@eecs.umich.eduX86ISA::IntelMP::Bus::Bus(Params * p) : BaseConfigEntry(p, 1),
3105625Sgblack@eecs.umich.edu    busID(p->bus_id), busType(p->bus_type)
3115625Sgblack@eecs.umich.edu{}
3125625Sgblack@eecs.umich.edu
3135625Sgblack@eecs.umich.eduX86ISA::IntelMP::Bus *
3145625Sgblack@eecs.umich.eduX86IntelMPBusParams::create()
3155625Sgblack@eecs.umich.edu{
3165625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::Bus(this);
3175625Sgblack@eecs.umich.edu}
3185625Sgblack@eecs.umich.edu
3195625Sgblack@eecs.umich.eduAddr
3205625Sgblack@eecs.umich.eduX86ISA::IntelMP::IOAPIC::writeOut(
3218852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
3225625Sgblack@eecs.umich.edu{
3238706Sandreas.hansson@arm.com    BaseConfigEntry::writeOut(proxy, addr, checkSum);
3248706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 1, id);
3258706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 2, version);
3268706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 3, flags);
3278706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, address);
3285625Sgblack@eecs.umich.edu    return 8;
3295625Sgblack@eecs.umich.edu}
3305625Sgblack@eecs.umich.edu
3315625Sgblack@eecs.umich.eduX86ISA::IntelMP::IOAPIC::IOAPIC(Params * p) : BaseConfigEntry(p, 2),
3325625Sgblack@eecs.umich.edu    id(p->id), version(p->version), flags(0), address(p->address)
3335625Sgblack@eecs.umich.edu{
3345625Sgblack@eecs.umich.edu    if (p->enable)
3355625Sgblack@eecs.umich.edu        flags |= 1;
3365625Sgblack@eecs.umich.edu}
3375625Sgblack@eecs.umich.edu
3385625Sgblack@eecs.umich.eduX86ISA::IntelMP::IOAPIC *
3395625Sgblack@eecs.umich.eduX86IntelMPIOAPICParams::create()
3405625Sgblack@eecs.umich.edu{
3415625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::IOAPIC(this);
3425625Sgblack@eecs.umich.edu}
3435625Sgblack@eecs.umich.edu
3445625Sgblack@eecs.umich.eduAddr
3455625Sgblack@eecs.umich.eduX86ISA::IntelMP::IntAssignment::writeOut(
3468852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
3475625Sgblack@eecs.umich.edu{
3488706Sandreas.hansson@arm.com    BaseConfigEntry::writeOut(proxy, addr, checkSum);
3498706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 1, interruptType);
3508706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 2, flags);
3518706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, sourceBusID);
3528706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 5, sourceBusIRQ);
3538706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 6, destApicID);
3548706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 7, destApicIntIn);
3555625Sgblack@eecs.umich.edu    return 8;
3565625Sgblack@eecs.umich.edu}
3575625Sgblack@eecs.umich.edu
3585625Sgblack@eecs.umich.eduX86ISA::IntelMP::IOIntAssignment::IOIntAssignment(Params * p) :
3595625Sgblack@eecs.umich.edu    IntAssignment(p, p->interrupt_type, p->polarity, p->trigger, 3,
3605625Sgblack@eecs.umich.edu            p->source_bus_id, p->source_bus_irq,
3615625Sgblack@eecs.umich.edu            p->dest_io_apic_id, p->dest_io_apic_intin)
3625625Sgblack@eecs.umich.edu{}
3635625Sgblack@eecs.umich.edu
3645625Sgblack@eecs.umich.eduX86ISA::IntelMP::IOIntAssignment *
3655625Sgblack@eecs.umich.eduX86IntelMPIOIntAssignmentParams::create()
3665625Sgblack@eecs.umich.edu{
3675625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::IOIntAssignment(this);
3685625Sgblack@eecs.umich.edu}
3695625Sgblack@eecs.umich.edu
3705625Sgblack@eecs.umich.eduX86ISA::IntelMP::LocalIntAssignment::LocalIntAssignment(Params * p) :
3715625Sgblack@eecs.umich.edu    IntAssignment(p, p->interrupt_type, p->polarity, p->trigger, 4,
3725625Sgblack@eecs.umich.edu            p->source_bus_id, p->source_bus_irq,
3735625Sgblack@eecs.umich.edu            p->dest_local_apic_id, p->dest_local_apic_intin)
3745625Sgblack@eecs.umich.edu{}
3755625Sgblack@eecs.umich.edu
3765625Sgblack@eecs.umich.eduX86ISA::IntelMP::LocalIntAssignment *
3775625Sgblack@eecs.umich.eduX86IntelMPLocalIntAssignmentParams::create()
3785625Sgblack@eecs.umich.edu{
3795625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::LocalIntAssignment(this);
3805625Sgblack@eecs.umich.edu}
3815625Sgblack@eecs.umich.edu
3825625Sgblack@eecs.umich.eduAddr
3835625Sgblack@eecs.umich.eduX86ISA::IntelMP::AddrSpaceMapping::writeOut(
3848852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
3855625Sgblack@eecs.umich.edu{
3868706Sandreas.hansson@arm.com    ExtConfigEntry::writeOut(proxy, addr, checkSum);
3878706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 2, busID);
3888706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 3, addrType);
3898706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, addr);
3908706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 12, addrLength);
3915625Sgblack@eecs.umich.edu    return length;
3925625Sgblack@eecs.umich.edu}
3935625Sgblack@eecs.umich.edu
3945625Sgblack@eecs.umich.eduX86ISA::IntelMP::AddrSpaceMapping::AddrSpaceMapping(Params * p) :
3955625Sgblack@eecs.umich.edu    ExtConfigEntry(p, 128, 20),
3965625Sgblack@eecs.umich.edu    busID(p->bus_id), addrType(p->address_type),
3975625Sgblack@eecs.umich.edu    addr(p->address), addrLength(p->length)
3985625Sgblack@eecs.umich.edu{}
3995625Sgblack@eecs.umich.edu
4005625Sgblack@eecs.umich.eduX86ISA::IntelMP::AddrSpaceMapping *
4015625Sgblack@eecs.umich.eduX86IntelMPAddrSpaceMappingParams::create()
4025625Sgblack@eecs.umich.edu{
4035625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::AddrSpaceMapping(this);
4045625Sgblack@eecs.umich.edu}
4055625Sgblack@eecs.umich.edu
4065625Sgblack@eecs.umich.eduAddr
4075625Sgblack@eecs.umich.eduX86ISA::IntelMP::BusHierarchy::writeOut(
4088852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
4095625Sgblack@eecs.umich.edu{
4108706Sandreas.hansson@arm.com    ExtConfigEntry::writeOut(proxy, addr, checkSum);
4118706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 2, busID);
4128706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 3, info);
4138706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, parentBus);
4145625Sgblack@eecs.umich.edu
4155625Sgblack@eecs.umich.edu    uint32_t reserved = 0;
4168852Sandreas.hansson@arm.com    proxy.writeBlob(addr + 5, (uint8_t *)(&reserved), 3);
4175625Sgblack@eecs.umich.edu
4185625Sgblack@eecs.umich.edu    return length;
4195625Sgblack@eecs.umich.edu}
4205625Sgblack@eecs.umich.edu
4215625Sgblack@eecs.umich.eduX86ISA::IntelMP::BusHierarchy::BusHierarchy(Params * p) :
4225625Sgblack@eecs.umich.edu    ExtConfigEntry(p, 129, 8),
4235625Sgblack@eecs.umich.edu    busID(p->bus_id), info(0), parentBus(p->parent_bus)
4245625Sgblack@eecs.umich.edu{
4255625Sgblack@eecs.umich.edu    if (p->subtractive_decode)
4265625Sgblack@eecs.umich.edu        info |= 1;
4275625Sgblack@eecs.umich.edu}
4285625Sgblack@eecs.umich.edu
4295625Sgblack@eecs.umich.eduX86ISA::IntelMP::BusHierarchy *
4305625Sgblack@eecs.umich.eduX86IntelMPBusHierarchyParams::create()
4315625Sgblack@eecs.umich.edu{
4325625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::BusHierarchy(this);
4335625Sgblack@eecs.umich.edu}
4345625Sgblack@eecs.umich.edu
4355625Sgblack@eecs.umich.eduAddr
4365625Sgblack@eecs.umich.eduX86ISA::IntelMP::CompatAddrSpaceMod::writeOut(
4378852Sandreas.hansson@arm.com        PortProxy& proxy, Addr addr, uint8_t &checkSum)
4385625Sgblack@eecs.umich.edu{
4398706Sandreas.hansson@arm.com    ExtConfigEntry::writeOut(proxy, addr, checkSum);
4408706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 2, busID);
4418706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 3, mod);
4428706Sandreas.hansson@arm.com    checkSum += writeOutField(proxy, addr + 4, rangeList);
4435625Sgblack@eecs.umich.edu    return length;
4445625Sgblack@eecs.umich.edu}
4455625Sgblack@eecs.umich.edu
4465625Sgblack@eecs.umich.eduX86ISA::IntelMP::CompatAddrSpaceMod::CompatAddrSpaceMod(Params * p) :
4475625Sgblack@eecs.umich.edu    ExtConfigEntry(p, 130, 8),
4485625Sgblack@eecs.umich.edu    busID(p->bus_id), mod(0), rangeList(p->range_list)
4495625Sgblack@eecs.umich.edu{
4505625Sgblack@eecs.umich.edu    if (p->add)
4515625Sgblack@eecs.umich.edu        mod |= 1;
4525625Sgblack@eecs.umich.edu}
4535625Sgblack@eecs.umich.edu
4545625Sgblack@eecs.umich.eduX86ISA::IntelMP::CompatAddrSpaceMod *
4555625Sgblack@eecs.umich.eduX86IntelMPCompatAddrSpaceModParams::create()
4565625Sgblack@eecs.umich.edu{
4575625Sgblack@eecs.umich.edu    return new X86ISA::IntelMP::CompatAddrSpaceMod(this);
4585625Sgblack@eecs.umich.edu}
459