acpi.cc revision 8229
15369Ssaidi@eecs.umich.edu/*
23005Sstever@eecs.umich.edu * Copyright (c) 2008 The Hewlett-Packard Development Company
33005Sstever@eecs.umich.edu * All rights reserved.
43005Sstever@eecs.umich.edu *
53005Sstever@eecs.umich.edu * The license below extends only to copyright in the software and shall
63005Sstever@eecs.umich.edu * not be construed as granting a license to any other intellectual
73005Sstever@eecs.umich.edu * property including but not limited to intellectual property relating
83005Sstever@eecs.umich.edu * to a hardware implementation of the functionality of the software
93005Sstever@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
103005Sstever@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
113005Sstever@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
123005Sstever@eecs.umich.edu * modified or unmodified, in source code or in binary form.
133005Sstever@eecs.umich.edu *
143005Sstever@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
153005Sstever@eecs.umich.edu * modification, are permitted provided that the following conditions are
163005Sstever@eecs.umich.edu * met: redistributions of source code must retain the above copyright
173005Sstever@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
183005Sstever@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
193005Sstever@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
203005Sstever@eecs.umich.edu * documentation and/or other materials provided with the distribution;
213005Sstever@eecs.umich.edu * neither the name of the copyright holders nor the names of its
223005Sstever@eecs.umich.edu * contributors may be used to endorse or promote products derived from
233005Sstever@eecs.umich.edu * this software without specific prior written permission.
243005Sstever@eecs.umich.edu *
253005Sstever@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
263005Sstever@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
273005Sstever@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
283005Sstever@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
292710SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
302710SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
313005Sstever@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
322889SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
336654Snate@binkert.org * 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
356654Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
366654Snate@binkert.org *
376654Snate@binkert.org * Authors: Gabe Black
382667SN/A */
396654Snate@binkert.org
406654Snate@binkert.org#include "arch/x86/bios/acpi.hh"
416654Snate@binkert.org#include "mem/port.hh"
425457Ssaidi@eecs.umich.edu#include "params/X86ACPIRSDP.hh"
436654Snate@binkert.org#include "params/X86ACPIRSDT.hh"
446654Snate@binkert.org#include "params/X86ACPISysDescTable.hh"
455457Ssaidi@eecs.umich.edu#include "params/X86ACPIXSDT.hh"
466654Snate@binkert.org#include "sim/byteswap.hh"
476654Snate@binkert.org#include "sim/sim_object.hh"
483395Shsul@eecs.umich.edu
496981SLisa.Hsu@amd.comusing namespace std;
503448Shsul@eecs.umich.edu
515369Ssaidi@eecs.umich.educonst char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
523394Shsul@eecs.umich.edu
533444Sktlim@umich.eduX86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
543444Sktlim@umich.edu    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
553444Sktlim@umich.edu{}
563444Sktlim@umich.edu
572424SN/AX86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
582957SN/A        const char * _signature, uint8_t _revision) : SimObject(p),
592957SN/A    signature(_signature), revision(_revision),
603323Shsul@eecs.umich.edu    oemID(p->oem_id), oemTableID(p->oem_table_id),
613005Sstever@eecs.umich.edu    oemRevision(p->oem_revision),
627787SAli.Saidi@ARM.com    creatorID(p->creator_id), creatorRevision(p->creator_revision)
637787SAli.Saidi@ARM.com{}
645514SMichael.Adler@intel.com
652957SN/AX86ISA::ACPI::RSDT::RSDT(Params *p) :
665514SMichael.Adler@intel.com    SysDescTable(p, "RSDT", 1), entries(p->entries)
675514SMichael.Adler@intel.com{}
685514SMichael.Adler@intel.com
695514SMichael.Adler@intel.comX86ISA::ACPI::XSDT::XSDT(Params *p) :
703323Shsul@eecs.umich.edu    SysDescTable(p, "XSDT", 1), entries(p->entries)
713444Sktlim@umich.edu{}
722957SN/A
732957SN/AX86ISA::ACPI::RSDP *
742957SN/AX86ACPIRSDPParams::create()
752957SN/A{
762957SN/A    return new X86ISA::ACPI::RSDP(this);
772957SN/A}
782957SN/A
798167SLisa.Hsu@amd.comX86ISA::ACPI::RSDT *
808167SLisa.Hsu@amd.comX86ACPIRSDTParams::create()
818167SLisa.Hsu@amd.com{
825369Ssaidi@eecs.umich.edu    return new X86ISA::ACPI::RSDT(this);
838167SLisa.Hsu@amd.com}
848167SLisa.Hsu@amd.com
858167SLisa.Hsu@amd.comX86ISA::ACPI::XSDT *
868167SLisa.Hsu@amd.comX86ACPIXSDTParams::create()
878167SLisa.Hsu@amd.com{
888167SLisa.Hsu@amd.com    return new X86ISA::ACPI::XSDT(this);
898167SLisa.Hsu@amd.com}
908168SLisa.Hsu@amd.com