acpi.cc revision 5627
15627Sgblack@eecs.umich.edu/*
25627Sgblack@eecs.umich.edu * Copyright (c) 2008 The Hewlett-Packard Development Company
35627Sgblack@eecs.umich.edu * All rights reserved.
45627Sgblack@eecs.umich.edu *
55627Sgblack@eecs.umich.edu * Redistribution and use of this software in source and binary forms,
65627Sgblack@eecs.umich.edu * with or without modification, are permitted provided that the
75627Sgblack@eecs.umich.edu * following conditions are met:
85627Sgblack@eecs.umich.edu *
95627Sgblack@eecs.umich.edu * The software must be used only for Non-Commercial Use which means any
105627Sgblack@eecs.umich.edu * use which is NOT directed to receiving any direct monetary
115627Sgblack@eecs.umich.edu * compensation for, or commercial advantage from such use.  Illustrative
125627Sgblack@eecs.umich.edu * examples of non-commercial use are academic research, personal study,
135627Sgblack@eecs.umich.edu * teaching, education and corporate research & development.
145627Sgblack@eecs.umich.edu * Illustrative examples of commercial use are distributing products for
155627Sgblack@eecs.umich.edu * commercial advantage and providing services using the software for
165627Sgblack@eecs.umich.edu * commercial advantage.
175627Sgblack@eecs.umich.edu *
185627Sgblack@eecs.umich.edu * If you wish to use this software or functionality therein that may be
195627Sgblack@eecs.umich.edu * covered by patents for commercial use, please contact:
205627Sgblack@eecs.umich.edu *     Director of Intellectual Property Licensing
215627Sgblack@eecs.umich.edu *     Office of Strategy and Technology
225627Sgblack@eecs.umich.edu *     Hewlett-Packard Company
235627Sgblack@eecs.umich.edu *     1501 Page Mill Road
245627Sgblack@eecs.umich.edu *     Palo Alto, California  94304
255627Sgblack@eecs.umich.edu *
265627Sgblack@eecs.umich.edu * Redistributions of source code must retain the above copyright notice,
275627Sgblack@eecs.umich.edu * this list of conditions and the following disclaimer.  Redistributions
285627Sgblack@eecs.umich.edu * in binary form must reproduce the above copyright notice, this list of
295627Sgblack@eecs.umich.edu * conditions and the following disclaimer in the documentation and/or
305627Sgblack@eecs.umich.edu * other materials provided with the distribution.  Neither the name of
315627Sgblack@eecs.umich.edu * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
325627Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
335627Sgblack@eecs.umich.edu * this software without specific prior written permission.  No right of
345627Sgblack@eecs.umich.edu * sublicense is granted herewith.  Derivatives of the software and
355627Sgblack@eecs.umich.edu * output created using the software may be prepared, but only for
365627Sgblack@eecs.umich.edu * Non-Commercial Uses.  Derivatives of the software may be shared with
375627Sgblack@eecs.umich.edu * others provided: (i) the others agree to abide by the list of
385627Sgblack@eecs.umich.edu * conditions herein which includes the Non-Commercial Use restrictions;
395627Sgblack@eecs.umich.edu * and (ii) such Derivatives of the software include the above copyright
405627Sgblack@eecs.umich.edu * notice to acknowledge the contribution from this software where
415627Sgblack@eecs.umich.edu * applicable, this list of conditions and the disclaimer below.
425627Sgblack@eecs.umich.edu *
435627Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
445627Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
455627Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
465627Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
475627Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
485627Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
495627Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
505627Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
515627Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
525627Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
535627Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
545627Sgblack@eecs.umich.edu *
555627Sgblack@eecs.umich.edu * Authors: Gabe Black
565627Sgblack@eecs.umich.edu */
575627Sgblack@eecs.umich.edu
585627Sgblack@eecs.umich.edu#include "arch/x86/bios/acpi.hh"
595627Sgblack@eecs.umich.edu#include "mem/port.hh"
605627Sgblack@eecs.umich.edu#include "sim/byteswap.hh"
615627Sgblack@eecs.umich.edu#include "sim/sim_object.hh"
625627Sgblack@eecs.umich.edu
635627Sgblack@eecs.umich.edu#include "params/X86ACPIRSDP.hh"
645627Sgblack@eecs.umich.edu
655627Sgblack@eecs.umich.edu#include "params/X86ACPISysDescTable.hh"
665627Sgblack@eecs.umich.edu#include "params/X86ACPIRSDT.hh"
675627Sgblack@eecs.umich.edu#include "params/X86ACPIXSDT.hh"
685627Sgblack@eecs.umich.edu
695627Sgblack@eecs.umich.eduusing namespace std;
705627Sgblack@eecs.umich.edu
715627Sgblack@eecs.umich.educonst char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
725627Sgblack@eecs.umich.edu
735627Sgblack@eecs.umich.eduX86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
745627Sgblack@eecs.umich.edu    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
755627Sgblack@eecs.umich.edu{}
765627Sgblack@eecs.umich.edu
775627Sgblack@eecs.umich.eduX86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
785627Sgblack@eecs.umich.edu        const char * _signature, uint8_t _revision) : SimObject(p),
795627Sgblack@eecs.umich.edu    signature(_signature), revision(_revision),
805627Sgblack@eecs.umich.edu    oemID(p->oem_id), oemTableID(p->oem_table_id),
815627Sgblack@eecs.umich.edu    oemRevision(p->oem_revision),
825627Sgblack@eecs.umich.edu    creatorID(p->creator_id), creatorRevision(p->creator_revision)
835627Sgblack@eecs.umich.edu{}
845627Sgblack@eecs.umich.edu
855627Sgblack@eecs.umich.eduX86ISA::ACPI::RSDT::RSDT(Params *p) :
865627Sgblack@eecs.umich.edu    SysDescTable(p, "RSDT", 1), entries(p->entries)
875627Sgblack@eecs.umich.edu{}
885627Sgblack@eecs.umich.edu
895627Sgblack@eecs.umich.eduX86ISA::ACPI::XSDT::XSDT(Params *p) :
905627Sgblack@eecs.umich.edu    SysDescTable(p, "XSDT", 1), entries(p->entries)
915627Sgblack@eecs.umich.edu{}
925627Sgblack@eecs.umich.edu
935627Sgblack@eecs.umich.eduX86ISA::ACPI::RSDP *
945627Sgblack@eecs.umich.eduX86ACPIRSDPParams::create()
955627Sgblack@eecs.umich.edu{
965627Sgblack@eecs.umich.edu    return new X86ISA::ACPI::RSDP(this);
975627Sgblack@eecs.umich.edu}
985627Sgblack@eecs.umich.edu
995627Sgblack@eecs.umich.eduX86ISA::ACPI::RSDT *
1005627Sgblack@eecs.umich.eduX86ACPIRSDTParams::create()
1015627Sgblack@eecs.umich.edu{
1025627Sgblack@eecs.umich.edu    return new X86ISA::ACPI::RSDT(this);
1035627Sgblack@eecs.umich.edu}
1045627Sgblack@eecs.umich.edu
1055627Sgblack@eecs.umich.eduX86ISA::ACPI::XSDT *
1065627Sgblack@eecs.umich.eduX86ACPIXSDTParams::create()
1075627Sgblack@eecs.umich.edu{
1085627Sgblack@eecs.umich.edu    return new X86ISA::ACPI::XSDT(this);
1095627Sgblack@eecs.umich.edu}
110