acpi.cc revision 11793
14483Sgblack@eecs.umich.edu/*
24483Sgblack@eecs.umich.edu * Copyright (c) 2008 The Hewlett-Packard Development Company
34483Sgblack@eecs.umich.edu * All rights reserved.
44483Sgblack@eecs.umich.edu *
54483Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
64483Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
74483Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
84483Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
94483Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
104483Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
114483Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
124483Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
134483Sgblack@eecs.umich.edu *
144483Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
154483Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
164483Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
174483Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
184483Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
194483Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
204483Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
214483Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
224483Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
234483Sgblack@eecs.umich.edu * this software without specific prior written permission.
244483Sgblack@eecs.umich.edu *
254483Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
264483Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
274483Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
284483Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
294483Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
304483Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
314483Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
324483Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
334483Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
344483Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
354483Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
364483Sgblack@eecs.umich.edu *
374483Sgblack@eecs.umich.edu * Authors: Gabe Black
384483Sgblack@eecs.umich.edu */
394483Sgblack@eecs.umich.edu
404483Sgblack@eecs.umich.edu#include "arch/x86/bios/acpi.hh"
414483Sgblack@eecs.umich.edu
424483Sgblack@eecs.umich.edu#include "mem/port.hh"
434483Sgblack@eecs.umich.edu#include "params/X86ACPIRSDP.hh"
444483Sgblack@eecs.umich.edu#include "params/X86ACPIRSDT.hh"
454483Sgblack@eecs.umich.edu#include "params/X86ACPISysDescTable.hh"
464483Sgblack@eecs.umich.edu#include "params/X86ACPIXSDT.hh"
474483Sgblack@eecs.umich.edu#include "sim/byteswap.hh"
484483Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
494483Sgblack@eecs.umich.edu
504483Sgblack@eecs.umich.eduusing namespace std;
514483Sgblack@eecs.umich.edu
524483Sgblack@eecs.umich.educonst char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
534483Sgblack@eecs.umich.edu
544483Sgblack@eecs.umich.eduX86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
554483Sgblack@eecs.umich.edu    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
564483Sgblack@eecs.umich.edu{}
574483Sgblack@eecs.umich.edu
584483Sgblack@eecs.umich.eduX86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
594483Sgblack@eecs.umich.edu        const char * _signature, uint8_t _revision) : SimObject(p),
604503Sgblack@eecs.umich.edu    signature(_signature), revision(_revision),
614503Sgblack@eecs.umich.edu    oemID(p->oem_id), oemTableID(p->oem_table_id),
624483Sgblack@eecs.umich.edu    oemRevision(p->oem_revision),
634483Sgblack@eecs.umich.edu    creatorID(p->creator_id), creatorRevision(p->creator_revision)
644483Sgblack@eecs.umich.edu{}
654483Sgblack@eecs.umich.edu
664483Sgblack@eecs.umich.eduX86ISA::ACPI::RSDT::RSDT(Params *p) :
674503Sgblack@eecs.umich.edu    SysDescTable(p, "RSDT", 1), entries(p->entries)
684503Sgblack@eecs.umich.edu{}
694483Sgblack@eecs.umich.edu
704483Sgblack@eecs.umich.eduX86ISA::ACPI::XSDT::XSDT(Params *p) :
714483Sgblack@eecs.umich.edu    SysDescTable(p, "XSDT", 1), entries(p->entries)
724483Sgblack@eecs.umich.edu{}
734483Sgblack@eecs.umich.edu
744502Sgblack@eecs.umich.eduX86ISA::ACPI::RSDP *
754502Sgblack@eecs.umich.eduX86ACPIRSDPParams::create()
764483Sgblack@eecs.umich.edu{
774483Sgblack@eecs.umich.edu    return new X86ISA::ACPI::RSDP(this);
784483Sgblack@eecs.umich.edu}
794502Sgblack@eecs.umich.edu
804502Sgblack@eecs.umich.eduX86ISA::ACPI::RSDT *
814502Sgblack@eecs.umich.eduX86ACPIRSDTParams::create()
824502Sgblack@eecs.umich.edu{
834483Sgblack@eecs.umich.edu    return new X86ISA::ACPI::RSDT(this);
844483Sgblack@eecs.umich.edu}
854483Sgblack@eecs.umich.edu
864483Sgblack@eecs.umich.eduX86ISA::ACPI::XSDT *
874483Sgblack@eecs.umich.eduX86ACPIXSDTParams::create()
884503Sgblack@eecs.umich.edu{
894483Sgblack@eecs.umich.edu    return new X86ISA::ACPI::XSDT(this);
904502Sgblack@eecs.umich.edu}
914483Sgblack@eecs.umich.edu