ACPI.py revision 5825
15627Sgblack@eecs.umich.edu# Copyright (c) 2008 The Hewlett-Packard Development Company
25627Sgblack@eecs.umich.edu# All rights reserved.
35627Sgblack@eecs.umich.edu#
45627Sgblack@eecs.umich.edu# Redistribution and use of this software in source and binary forms,
55627Sgblack@eecs.umich.edu# with or without modification, are permitted provided that the
65627Sgblack@eecs.umich.edu# following conditions are met:
75627Sgblack@eecs.umich.edu#
85627Sgblack@eecs.umich.edu# The software must be used only for Non-Commercial Use which means any
95627Sgblack@eecs.umich.edu# use which is NOT directed to receiving any direct monetary
105627Sgblack@eecs.umich.edu# compensation for, or commercial advantage from such use.  Illustrative
115627Sgblack@eecs.umich.edu# examples of non-commercial use are academic research, personal study,
125627Sgblack@eecs.umich.edu# teaching, education and corporate research & development.
135627Sgblack@eecs.umich.edu# Illustrative examples of commercial use are distributing products for
145627Sgblack@eecs.umich.edu# commercial advantage and providing services using the software for
155627Sgblack@eecs.umich.edu# commercial advantage.
165627Sgblack@eecs.umich.edu#
175627Sgblack@eecs.umich.edu# If you wish to use this software or functionality therein that may be
185627Sgblack@eecs.umich.edu# covered by patents for commercial use, please contact:
195627Sgblack@eecs.umich.edu#     Director of Intellectual Property Licensing
205627Sgblack@eecs.umich.edu#     Office of Strategy and Technology
215627Sgblack@eecs.umich.edu#     Hewlett-Packard Company
225627Sgblack@eecs.umich.edu#     1501 Page Mill Road
235627Sgblack@eecs.umich.edu#     Palo Alto, California  94304
245627Sgblack@eecs.umich.edu#
255627Sgblack@eecs.umich.edu# Redistributions of source code must retain the above copyright notice,
265627Sgblack@eecs.umich.edu# this list of conditions and the following disclaimer.  Redistributions
275627Sgblack@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of
285627Sgblack@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or
295627Sgblack@eecs.umich.edu# other materials provided with the distribution.  Neither the name of
305627Sgblack@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
315627Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
325627Sgblack@eecs.umich.edu# this software without specific prior written permission.  No right of
335627Sgblack@eecs.umich.edu# sublicense is granted herewith.  Derivatives of the software and
345627Sgblack@eecs.umich.edu# output created using the software may be prepared, but only for
355627Sgblack@eecs.umich.edu# Non-Commercial Uses.  Derivatives of the software may be shared with
365627Sgblack@eecs.umich.edu# others provided: (i) the others agree to abide by the list of
375627Sgblack@eecs.umich.edu# conditions herein which includes the Non-Commercial Use restrictions;
385627Sgblack@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright
395627Sgblack@eecs.umich.edu# notice to acknowledge the contribution from this software where
405627Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below.
415627Sgblack@eecs.umich.edu#
425627Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
435627Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
445627Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
455627Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
465627Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
475627Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
485627Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
495627Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
505627Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
515627Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
525627Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
535627Sgblack@eecs.umich.edu#
545627Sgblack@eecs.umich.edu# Authors: Gabe Black
555627Sgblack@eecs.umich.edu
565627Sgblack@eecs.umich.edufrom m5.params import *
575627Sgblack@eecs.umich.edufrom m5.SimObject import SimObject
585627Sgblack@eecs.umich.edu
595627Sgblack@eecs.umich.edu# ACPI description table header. Subclasses contain and handle the actual
605627Sgblack@eecs.umich.edu# contents as appropriate for that type of table.
615627Sgblack@eecs.umich.educlass X86ACPISysDescTable(SimObject):
625627Sgblack@eecs.umich.edu    type = 'X86ACPISysDescTable'
635627Sgblack@eecs.umich.edu    cxx_class = 'X86ISA::ACPI::SysDescTable'
645627Sgblack@eecs.umich.edu    abstract = True
655627Sgblack@eecs.umich.edu
665627Sgblack@eecs.umich.edu    oem_id = Param.String('', 'string identifying the oem')
675627Sgblack@eecs.umich.edu    oem_table_id = Param.String('', 'oem table ID')
685627Sgblack@eecs.umich.edu    oem_revision = Param.UInt32(0, 'oem revision number for the table')
695627Sgblack@eecs.umich.edu
705627Sgblack@eecs.umich.edu    creator_id = Param.String('',
715627Sgblack@eecs.umich.edu            'string identifying the generator of the table')
725627Sgblack@eecs.umich.edu    creator_revision = Param.UInt32(0,
735627Sgblack@eecs.umich.edu            'revision number for the creator of the table')
745627Sgblack@eecs.umich.edu
755627Sgblack@eecs.umich.educlass X86ACPIRSDT(X86ACPISysDescTable):
765627Sgblack@eecs.umich.edu    type = 'X86ACPIRSDT'
775627Sgblack@eecs.umich.edu    cxx_class = 'X86ISA::ACPI::RSDT'
785627Sgblack@eecs.umich.edu
795627Sgblack@eecs.umich.edu    entries = VectorParam.X86ACPISysDescTable([], 'system description tables')
805627Sgblack@eecs.umich.edu
815627Sgblack@eecs.umich.educlass X86ACPIXSDT(X86ACPISysDescTable):
825627Sgblack@eecs.umich.edu    type = 'X86ACPIXSDT'
835627Sgblack@eecs.umich.edu    cxx_class = 'X86ISA::ACPI::XSDT'
845627Sgblack@eecs.umich.edu
855627Sgblack@eecs.umich.edu    entries = VectorParam.X86ACPISysDescTable([], 'system description tables')
865627Sgblack@eecs.umich.edu
875627Sgblack@eecs.umich.edu# Root System Description Pointer Structure
885627Sgblack@eecs.umich.educlass X86ACPIRSDP(SimObject):
895627Sgblack@eecs.umich.edu    type = 'X86ACPIRSDP'
905627Sgblack@eecs.umich.edu    cxx_class = 'X86ISA::ACPI::RSDP'
915627Sgblack@eecs.umich.edu
925627Sgblack@eecs.umich.edu    oem_id = Param.String('', 'string identifying the oem')
935627Sgblack@eecs.umich.edu    # Because 0 encodes ACPI 1.0, 2 encodes ACPI 3.0, the version implemented
945627Sgblack@eecs.umich.edu    # here.
955627Sgblack@eecs.umich.edu    revision = Param.UInt8(2, 'revision of ACPI being used, zero indexed')
965627Sgblack@eecs.umich.edu
975825Sgblack@eecs.umich.edu    rsdt = Param.X86ACPIRSDT(NULL, 'root system description table')
985627Sgblack@eecs.umich.edu    xsdt = Param.X86ACPIXSDT(X86ACPIXSDT(),
995627Sgblack@eecs.umich.edu            'extended system description table')
100