acpi.cc revision 8229
15335Shines@cs.fsu.edu/*
24486Sbinkertn@umich.edu * Copyright (c) 2008 The Hewlett-Packard Development Company
34486Sbinkertn@umich.edu * All rights reserved.
44486Sbinkertn@umich.edu *
54486Sbinkertn@umich.edu * The license below extends only to copyright in the software and shall
64486Sbinkertn@umich.edu * not be construed as granting a license to any other intellectual
74486Sbinkertn@umich.edu * property including but not limited to intellectual property relating
84486Sbinkertn@umich.edu * to a hardware implementation of the functionality of the software
94486Sbinkertn@umich.edu * licensed hereunder.  You may use the software subject to the license
104486Sbinkertn@umich.edu * terms below provided that you ensure that this notice is replicated
114486Sbinkertn@umich.edu * unmodified and in its entirety in all distributions of the software,
124486Sbinkertn@umich.edu * modified or unmodified, in source code or in binary form.
134486Sbinkertn@umich.edu *
144486Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without
154486Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are
164486Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright
174486Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer;
184486Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright
194486Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the
204486Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution;
214486Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its
224486Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from
234486Sbinkertn@umich.edu * this software without specific prior written permission.
244486Sbinkertn@umich.edu *
254486Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
264486Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
274486Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
284486Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
296654Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
306654Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
316654Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
323102SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
333102SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
346654Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
352998SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
364776Sgblack@eecs.umich.edu *
374776Sgblack@eecs.umich.edu * Authors: Gabe Black
386654Snate@binkert.org */
392667SN/A
404776Sgblack@eecs.umich.edu#include "arch/x86/bios/acpi.hh"
414776Sgblack@eecs.umich.edu#include "mem/port.hh"
426654Snate@binkert.org#include "params/X86ACPIRSDP.hh"
436023Snate@binkert.org#include "params/X86ACPIRSDT.hh"
446654Snate@binkert.org#include "params/X86ACPISysDescTable.hh"
455647Sgblack@eecs.umich.edu#include "params/X86ACPIXSDT.hh"
466654Snate@binkert.org#include "sim/byteswap.hh"
476022Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
486654Snate@binkert.org
495647Sgblack@eecs.umich.eduusing namespace std;
506654Snate@binkert.org
516022Sgblack@eecs.umich.educonst char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
526654Snate@binkert.org
535647Sgblack@eecs.umich.eduX86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
546654Snate@binkert.org    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
556022Sgblack@eecs.umich.edu{}
566654Snate@binkert.org
575647Sgblack@eecs.umich.eduX86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
586654Snate@binkert.org        const char * _signature, uint8_t _revision) : SimObject(p),
596116Snate@binkert.org    signature(_signature), revision(_revision),
606654Snate@binkert.org    oemID(p->oem_id), oemTableID(p->oem_table_id),
615647Sgblack@eecs.umich.edu    oemRevision(p->oem_revision),
624486Sbinkertn@umich.edu    creatorID(p->creator_id), creatorRevision(p->creator_revision)
635529Snate@binkert.org{}
641366SN/A
651310SN/AX86ISA::ACPI::RSDT::RSDT(Params *p) :
661310SN/A    SysDescTable(p, "RSDT", 1), entries(p->entries)
672901SN/A{}
685712Shsul@eecs.umich.edu
695529Snate@binkert.orgX86ISA::ACPI::XSDT::XSDT(Params *p) :
705529Snate@binkert.org    SysDescTable(p, "XSDT", 1), entries(p->entries)
715529Snate@binkert.org{}
725529Snate@binkert.org
735529Snate@binkert.orgX86ISA::ACPI::RSDP *
745821Ssaidi@eecs.umich.eduX86ACPIRSDPParams::create()
753170SN/A{
765780Ssteve.reinhardt@amd.com    return new X86ISA::ACPI::RSDP(this);
775780Ssteve.reinhardt@amd.com}
785780Ssteve.reinhardt@amd.com
795780Ssteve.reinhardt@amd.comX86ISA::ACPI::RSDT *
805780Ssteve.reinhardt@amd.comX86ACPIRSDTParams::create()
816654Snate@binkert.org{
825529Snate@binkert.org    return new X86ISA::ACPI::RSDT(this);
833620SN/A}
841445SN/A
851445SN/AX86ISA::ACPI::XSDT *
861310SN/AX86ACPIXSDTParams::create()
876654Snate@binkert.org{
886022Sgblack@eecs.umich.edu    return new X86ISA::ACPI::XSDT(this);
896022Sgblack@eecs.umich.edu}
906654Snate@binkert.org