acpi.cc revision 7087
15335Shines@cs.fsu.edu/*
27897Shestness@cs.utexas.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
297897Shestness@cs.utexas.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
304486Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
316654Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
326654Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
336654Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
343102SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
353102SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
366654Snate@binkert.org *
372998SN/A * Authors: Gabe Black
384776Sgblack@eecs.umich.edu */
394776Sgblack@eecs.umich.edu
406654Snate@binkert.org#include "arch/x86/bios/acpi.hh"
412667SN/A#include "mem/port.hh"
424776Sgblack@eecs.umich.edu#include "sim/byteswap.hh"
434776Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
446654Snate@binkert.org
456023Snate@binkert.org#include "params/X86ACPIRSDP.hh"
468745Sgblack@eecs.umich.edu
476654Snate@binkert.org#include "params/X86ACPISysDescTable.hh"
486022Sgblack@eecs.umich.edu#include "params/X86ACPIRSDT.hh"
498745Sgblack@eecs.umich.edu#include "params/X86ACPIXSDT.hh"
506654Snate@binkert.org
516022Sgblack@eecs.umich.eduusing namespace std;
528745Sgblack@eecs.umich.edu
536654Snate@binkert.orgconst char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
546022Sgblack@eecs.umich.edu
558745Sgblack@eecs.umich.eduX86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
566654Snate@binkert.org    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
576116Snate@binkert.org{}
588745Sgblack@eecs.umich.edu
596691Stjones1@inf.ed.ac.ukX86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
606691Stjones1@inf.ed.ac.uk        const char * _signature, uint8_t _revision) : SimObject(p),
618745Sgblack@eecs.umich.edu    signature(_signature), revision(_revision),
624486Sbinkertn@umich.edu    oemID(p->oem_id), oemTableID(p->oem_table_id),
635529Snate@binkert.org    oemRevision(p->oem_revision),
641366SN/A    creatorID(p->creator_id), creatorRevision(p->creator_revision)
651310SN/A{}
661310SN/A
672901SN/AX86ISA::ACPI::RSDT::RSDT(Params *p) :
685712Shsul@eecs.umich.edu    SysDescTable(p, "RSDT", 1), entries(p->entries)
695529Snate@binkert.org{}
705529Snate@binkert.org
715529Snate@binkert.orgX86ISA::ACPI::XSDT::XSDT(Params *p) :
725529Snate@binkert.org    SysDescTable(p, "XSDT", 1), entries(p->entries)
735529Snate@binkert.org{}
745821Ssaidi@eecs.umich.edu
753170SN/AX86ISA::ACPI::RSDP *
765780Ssteve.reinhardt@amd.comX86ACPIRSDPParams::create()
775780Ssteve.reinhardt@amd.com{
785780Ssteve.reinhardt@amd.com    return new X86ISA::ACPI::RSDP(this);
795780Ssteve.reinhardt@amd.com}
805780Ssteve.reinhardt@amd.com
818784Sgblack@eecs.umich.eduX86ISA::ACPI::RSDT *
828784Sgblack@eecs.umich.eduX86ACPIRSDTParams::create()
838784Sgblack@eecs.umich.edu{
848793Sgblack@eecs.umich.edu    return new X86ISA::ACPI::RSDT(this);
851310SN/A}
866654Snate@binkert.org
876022Sgblack@eecs.umich.eduX86ISA::ACPI::XSDT *
886022Sgblack@eecs.umich.eduX86ACPIXSDTParams::create()
898745Sgblack@eecs.umich.edu{
905647Sgblack@eecs.umich.edu    return new X86ISA::ACPI::XSDT(this);
916654Snate@binkert.org}
926023Snate@binkert.org