acpi.cc revision 11793
16184SN/A/*
26184SN/A * Copyright (c) 2008 The Hewlett-Packard Development Company
36184SN/A * All rights reserved.
46184SN/A *
56184SN/A * The license below extends only to copyright in the software and shall
66184SN/A * not be construed as granting a license to any other intellectual
76184SN/A * property including but not limited to intellectual property relating
86184SN/A * to a hardware implementation of the functionality of the software
96184SN/A * licensed hereunder.  You may use the software subject to the license
106184SN/A * terms below provided that you ensure that this notice is replicated
116184SN/A * unmodified and in its entirety in all distributions of the software,
126184SN/A * modified or unmodified, in source code or in binary form.
136184SN/A *
146184SN/A * Redistribution and use in source and binary forms, with or without
156184SN/A * modification, are permitted provided that the following conditions are
166184SN/A * met: redistributions of source code must retain the above copyright
176184SN/A * notice, this list of conditions and the following disclaimer;
186184SN/A * redistributions in binary form must reproduce the above copyright
196184SN/A * notice, this list of conditions and the following disclaimer in the
206184SN/A * documentation and/or other materials provided with the distribution;
216184SN/A * neither the name of the copyright holders nor the names of its
226184SN/A * contributors may be used to endorse or promote products derived from
236184SN/A * this software without specific prior written permission.
246184SN/A *
256184SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
266184SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
276184SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
286184SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
296184SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
306184SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3111793Sbrandon.potter@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3211793Sbrandon.potter@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
336184SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3412334Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
356184SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
368232Snate@binkert.org *
376184SN/A * Authors: Gabe Black
3810785Sgope@wisc.edu */
399480Snilay@cs.wisc.edu
409480Snilay@cs.wisc.edu#include "arch/x86/bios/acpi.hh"
4110785Sgope@wisc.edu
426184SN/A#include "mem/port.hh"
436184SN/A#include "params/X86ACPIRSDP.hh"
446184SN/A#include "params/X86ACPIRSDT.hh"
456184SN/A#include "params/X86ACPISysDescTable.hh"
466184SN/A#include "params/X86ACPIXSDT.hh"
476184SN/A#include "sim/byteswap.hh"
486184SN/A#include "sim/sim_object.hh"
496184SN/A
506184SN/Ausing namespace std;
516184SN/A
526184SN/Aconst char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
536184SN/A
546184SN/AX86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
556184SN/A    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
569480Snilay@cs.wisc.edu{}
576184SN/A
586184SN/AX86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
596184SN/A        const char * _signature, uint8_t _revision) : SimObject(p),
606184SN/A    signature(_signature), revision(_revision),
616227Snate@binkert.org    oemID(p->oem_id), oemTableID(p->oem_table_id),
629480Snilay@cs.wisc.edu    oemRevision(p->oem_revision),
636184SN/A    creatorID(p->creator_id), creatorRevision(p->creator_revision)
649480Snilay@cs.wisc.edu{}
656184SN/A
666184SN/AX86ISA::ACPI::RSDT::RSDT(Params *p) :
679480Snilay@cs.wisc.edu    SysDescTable(p, "RSDT", 1), entries(p->entries)
686184SN/A{}
699480Snilay@cs.wisc.edu
706184SN/AX86ISA::ACPI::XSDT::XSDT(Params *p) :
716184SN/A    SysDescTable(p, "XSDT", 1), entries(p->entries)
726184SN/A{}
736184SN/A
746184SN/AX86ISA::ACPI::RSDP *
756184SN/AX86ACPIRSDPParams::create()
766227Snate@binkert.org{
776184SN/A    return new X86ISA::ACPI::RSDP(this);
786184SN/A}
796184SN/A
806184SN/AX86ISA::ACPI::RSDT *
818842Smrinmoy.ghosh@arm.comX86ACPIRSDTParams::create()
8211434Smitch.hayenga@arm.com{
838842Smrinmoy.ghosh@arm.com    return new X86ISA::ACPI::RSDT(this);
848842Smrinmoy.ghosh@arm.com}
858842Smrinmoy.ghosh@arm.com
868842Smrinmoy.ghosh@arm.comX86ISA::ACPI::XSDT *
878842Smrinmoy.ghosh@arm.comX86ACPIXSDTParams::create()
888842Smrinmoy.ghosh@arm.com{
896184SN/A    return new X86ISA::ACPI::XSDT(this);
9011434Smitch.hayenga@arm.com}
916184SN/A