1ddbd7b91SNathan Whitehorn/*******************************************************************************
2ddbd7b91SNathan Whitehorn *
3ddbd7b91SNathan Whitehorn * Module Name: rsio - IO and DMA resource descriptors
4ddbd7b91SNathan Whitehorn *
5ddbd7b91SNathan Whitehorn ******************************************************************************/
6ddbd7b91SNathan Whitehorn
7ddbd7b91SNathan Whitehorn/******************************************************************************
8ddbd7b91SNathan Whitehorn *
9ddbd7b91SNathan Whitehorn * 1. Copyright Notice
10ddbd7b91SNathan Whitehorn *
11ff2e2f81SFredrik Holmqvist * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12ddbd7b91SNathan Whitehorn * All rights reserved.
13ddbd7b91SNathan Whitehorn *
14ddbd7b91SNathan Whitehorn * 2. License
15ddbd7b91SNathan Whitehorn *
16ddbd7b91SNathan Whitehorn * 2.1. This is your license from Intel Corp. under its intellectual property
179b0d045cSFredrik Holmqvist * rights. You may have additional license terms from the party that provided
18ddbd7b91SNathan Whitehorn * you this software, covering your right to use that party's intellectual
19ddbd7b91SNathan Whitehorn * property rights.
20ddbd7b91SNathan Whitehorn *
21ddbd7b91SNathan Whitehorn * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22ddbd7b91SNathan Whitehorn * copy of the source code appearing in this file ("Covered Code") an
23ddbd7b91SNathan Whitehorn * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24ddbd7b91SNathan Whitehorn * base code distributed originally by Intel ("Original Intel Code") to copy,
25ddbd7b91SNathan Whitehorn * make derivatives, distribute, use and display any portion of the Covered
26ddbd7b91SNathan Whitehorn * Code in any form, with the right to sublicense such rights; and
27ddbd7b91SNathan Whitehorn *
28ddbd7b91SNathan Whitehorn * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29ddbd7b91SNathan Whitehorn * license (with the right to sublicense), under only those claims of Intel
30ddbd7b91SNathan Whitehorn * patents that are infringed by the Original Intel Code, to make, use, sell,
31ddbd7b91SNathan Whitehorn * offer to sell, and import the Covered Code and derivative works thereof
32ddbd7b91SNathan Whitehorn * solely to the minimum extent necessary to exercise the above copyright
33ddbd7b91SNathan Whitehorn * license, and in no event shall the patent license extend to any additions
349b0d045cSFredrik Holmqvist * to or modifications of the Original Intel Code. No other license or right
35ddbd7b91SNathan Whitehorn * is granted directly or by implication, estoppel or otherwise;
36ddbd7b91SNathan Whitehorn *
37ddbd7b91SNathan Whitehorn * The above copyright and patent license is granted only if the following
38ddbd7b91SNathan Whitehorn * conditions are met:
39ddbd7b91SNathan Whitehorn *
40ddbd7b91SNathan Whitehorn * 3. Conditions
41ddbd7b91SNathan Whitehorn *
42ddbd7b91SNathan Whitehorn * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43ddbd7b91SNathan Whitehorn * Redistribution of source code of any substantial portion of the Covered
44ddbd7b91SNathan Whitehorn * Code or modification with rights to further distribute source must include
45ddbd7b91SNathan Whitehorn * the above Copyright Notice, the above License, this list of Conditions,
469b0d045cSFredrik Holmqvist * and the following Disclaimer and Export Compliance provision. In addition,
47ddbd7b91SNathan Whitehorn * Licensee must cause all Covered Code to which Licensee contributes to
48ddbd7b91SNathan Whitehorn * contain a file documenting the changes Licensee made to create that Covered
499b0d045cSFredrik Holmqvist * Code and the date of any change. Licensee must include in that file the
509b0d045cSFredrik Holmqvist * documentation of any changes made by any predecessor Licensee. Licensee
51ddbd7b91SNathan Whitehorn * must include a prominent statement that the modification is derived,
52ddbd7b91SNathan Whitehorn * directly or indirectly, from Original Intel Code.
53ddbd7b91SNathan Whitehorn *
54ddbd7b91SNathan Whitehorn * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55ddbd7b91SNathan Whitehorn * Redistribution of source code of any substantial portion of the Covered
56ddbd7b91SNathan Whitehorn * Code or modification without rights to further distribute source must
57ddbd7b91SNathan Whitehorn * include the following Disclaimer and Export Compliance provision in the
589b0d045cSFredrik Holmqvist * documentation and/or other materials provided with distribution. In
59ddbd7b91SNathan Whitehorn * addition, Licensee may not authorize further sublicense of source of any
60ddbd7b91SNathan Whitehorn * portion of the Covered Code, and must include terms to the effect that the
61ddbd7b91SNathan Whitehorn * license from Licensee to its licensee is limited to the intellectual
62ddbd7b91SNathan Whitehorn * property embodied in the software Licensee provides to its licensee, and
63ddbd7b91SNathan Whitehorn * not to intellectual property embodied in modifications its licensee may
64ddbd7b91SNathan Whitehorn * make.
65ddbd7b91SNathan Whitehorn *
66ddbd7b91SNathan Whitehorn * 3.3. Redistribution of Executable. Redistribution in executable form of any
67ddbd7b91SNathan Whitehorn * substantial portion of the Covered Code or modification must reproduce the
68ddbd7b91SNathan Whitehorn * above Copyright Notice, and the following Disclaimer and Export Compliance
69ddbd7b91SNathan Whitehorn * provision in the documentation and/or other materials provided with the
70ddbd7b91SNathan Whitehorn * distribution.
71ddbd7b91SNathan Whitehorn *
72ddbd7b91SNathan Whitehorn * 3.4. Intel retains all right, title, and interest in and to the Original
73ddbd7b91SNathan Whitehorn * Intel Code.
74ddbd7b91SNathan Whitehorn *
75ddbd7b91SNathan Whitehorn * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76ddbd7b91SNathan Whitehorn * Intel shall be used in advertising or otherwise to promote the sale, use or
77ddbd7b91SNathan Whitehorn * other dealings in products derived from or relating to the Covered Code
78ddbd7b91SNathan Whitehorn * without prior written authorization from Intel.
79ddbd7b91SNathan Whitehorn *
80ddbd7b91SNathan Whitehorn * 4. Disclaimer and Export Compliance
81ddbd7b91SNathan Whitehorn *
82ddbd7b91SNathan Whitehorn * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
839b0d045cSFredrik Holmqvist * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
849b0d045cSFredrik Holmqvist * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
859b0d045cSFredrik Holmqvist * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
869b0d045cSFredrik Holmqvist * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87ddbd7b91SNathan Whitehorn * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88ddbd7b91SNathan Whitehorn * PARTICULAR PURPOSE.
89ddbd7b91SNathan Whitehorn *
90ddbd7b91SNathan Whitehorn * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91ddbd7b91SNathan Whitehorn * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92ddbd7b91SNathan Whitehorn * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93ddbd7b91SNathan Whitehorn * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94ddbd7b91SNathan Whitehorn * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
959b0d045cSFredrik Holmqvist * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96ddbd7b91SNathan Whitehorn * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97ddbd7b91SNathan Whitehorn * LIMITED REMEDY.
98ddbd7b91SNathan Whitehorn *
99ddbd7b91SNathan Whitehorn * 4.3. Licensee shall not export, either directly or indirectly, any of this
100ddbd7b91SNathan Whitehorn * software or system incorporating such software without first obtaining any
101ddbd7b91SNathan Whitehorn * required license or other approval from the U. S. Department of Commerce or
1029b0d045cSFredrik Holmqvist * any other agency or department of the United States Government. In the
103ddbd7b91SNathan Whitehorn * event Licensee exports any such software from the United States or
104ddbd7b91SNathan Whitehorn * re-exports any such software from a foreign destination, Licensee shall
105ddbd7b91SNathan Whitehorn * ensure that the distribution and export/re-export of the software is in
106ddbd7b91SNathan Whitehorn * compliance with all laws, regulations, orders, or other restrictions of the
107ddbd7b91SNathan Whitehorn * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108ddbd7b91SNathan Whitehorn * any of its subsidiaries will export/re-export any technical data, process,
109ddbd7b91SNathan Whitehorn * software, or service, directly or indirectly, to any country for which the
110ddbd7b91SNathan Whitehorn * United States government or any agency thereof requires an export license,
111ddbd7b91SNathan Whitehorn * other governmental approval, or letter of assurance, without first obtaining
112ddbd7b91SNathan Whitehorn * such license, approval or letter.
113ddbd7b91SNathan Whitehorn *
114ff2e2f81SFredrik Holmqvist *****************************************************************************
115ff2e2f81SFredrik Holmqvist *
116ff2e2f81SFredrik Holmqvist * Alternatively, you may choose to be licensed under the terms of the
117ff2e2f81SFredrik Holmqvist * following license:
118ff2e2f81SFredrik Holmqvist *
119ff2e2f81SFredrik Holmqvist * Redistribution and use in source and binary forms, with or without
120ff2e2f81SFredrik Holmqvist * modification, are permitted provided that the following conditions
121ff2e2f81SFredrik Holmqvist * are met:
122ff2e2f81SFredrik Holmqvist * 1. Redistributions of source code must retain the above copyright
123ff2e2f81SFredrik Holmqvist *    notice, this list of conditions, and the following disclaimer,
124ff2e2f81SFredrik Holmqvist *    without modification.
125ff2e2f81SFredrik Holmqvist * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126ff2e2f81SFredrik Holmqvist *    substantially similar to the "NO WARRANTY" disclaimer below
127ff2e2f81SFredrik Holmqvist *    ("Disclaimer") and any redistribution must be conditioned upon
128ff2e2f81SFredrik Holmqvist *    including a substantially similar Disclaimer requirement for further
129ff2e2f81SFredrik Holmqvist *    binary redistribution.
130ff2e2f81SFredrik Holmqvist * 3. Neither the names of the above-listed copyright holders nor the names
131ff2e2f81SFredrik Holmqvist *    of any contributors may be used to endorse or promote products derived
132ff2e2f81SFredrik Holmqvist *    from this software without specific prior written permission.
133ff2e2f81SFredrik Holmqvist *
134ff2e2f81SFredrik Holmqvist * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135ff2e2f81SFredrik Holmqvist * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136ff2e2f81SFredrik Holmqvist * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137ff2e2f81SFredrik Holmqvist * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138ff2e2f81SFredrik Holmqvist * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139ff2e2f81SFredrik Holmqvist * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140ff2e2f81SFredrik Holmqvist * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141ff2e2f81SFredrik Holmqvist * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142ff2e2f81SFredrik Holmqvist * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143ff2e2f81SFredrik Holmqvist * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144ff2e2f81SFredrik Holmqvist * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145ff2e2f81SFredrik Holmqvist *
146ff2e2f81SFredrik Holmqvist * Alternatively, you may choose to be licensed under the terms of the
147ff2e2f81SFredrik Holmqvist * GNU General Public License ("GPL") version 2 as published by the Free
148ff2e2f81SFredrik Holmqvist * Software Foundation.
149ff2e2f81SFredrik Holmqvist *
150ddbd7b91SNathan Whitehorn *****************************************************************************/
151ddbd7b91SNathan Whitehorn
152ddbd7b91SNathan Whitehorn#include "acpi.h"
15380377d9aSJérôme Duval#include "accommon.h"
154ddbd7b91SNathan Whitehorn#include "acresrc.h"
155ddbd7b91SNathan Whitehorn
156ddbd7b91SNathan Whitehorn#define _COMPONENT          ACPI_RESOURCES
157ddbd7b91SNathan Whitehorn        ACPI_MODULE_NAME    ("rsio")
158ddbd7b91SNathan Whitehorn
159ddbd7b91SNathan Whitehorn
160ddbd7b91SNathan Whitehorn/*******************************************************************************
161ddbd7b91SNathan Whitehorn *
16243547dbeSJérôme Duval * AcpiRsConvertIo
163ddbd7b91SNathan Whitehorn *
164ddbd7b91SNathan Whitehorn ******************************************************************************/
165ddbd7b91SNathan Whitehorn
16643547dbeSJérôme DuvalACPI_RSCONVERT_INFO     AcpiRsConvertIo[5] =
167ddbd7b91SNathan Whitehorn{
16843547dbeSJérôme Duval    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_IO,
16943547dbeSJérôme Duval                        ACPI_RS_SIZE (ACPI_RESOURCE_IO),
17043547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertIo)},
171ddbd7b91SNathan Whitehorn
17243547dbeSJérôme Duval    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_IO,
17343547dbeSJérôme Duval                        sizeof (AML_RESOURCE_IO),
17443547dbeSJérôme Duval                        0},
175ddbd7b91SNathan Whitehorn
17643547dbeSJérôme Duval    /* Decode flag */
177ddbd7b91SNathan Whitehorn
17843547dbeSJérôme Duval    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Io.IoDecode),
17943547dbeSJérôme Duval                        AML_OFFSET (Io.Flags),
18043547dbeSJérôme Duval                        0},
181ddbd7b91SNathan Whitehorn    /*
18243547dbeSJérôme Duval     * These fields are contiguous in both the source and destination:
18343547dbeSJérôme Duval     * Address Alignment
18443547dbeSJérôme Duval     * Length
18543547dbeSJérôme Duval     * Minimum Base Address
18643547dbeSJérôme Duval     * Maximum Base Address
187ddbd7b91SNathan Whitehorn     */
18843547dbeSJérôme Duval    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Io.Alignment),
18943547dbeSJérôme Duval                        AML_OFFSET (Io.Alignment),
19043547dbeSJérôme Duval                        2},
191ddbd7b91SNathan Whitehorn
19243547dbeSJérôme Duval    {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.Io.Minimum),
19343547dbeSJérôme Duval                        AML_OFFSET (Io.Minimum),
19443547dbeSJérôme Duval                        2}
19543547dbeSJérôme Duval};
196ddbd7b91SNathan Whitehorn
197ddbd7b91SNathan Whitehorn
198ddbd7b91SNathan Whitehorn/*******************************************************************************
199ddbd7b91SNathan Whitehorn *
20043547dbeSJérôme Duval * AcpiRsConvertFixedIo
201ddbd7b91SNathan Whitehorn *
202ddbd7b91SNathan Whitehorn ******************************************************************************/
203ddbd7b91SNathan Whitehorn
20443547dbeSJérôme DuvalACPI_RSCONVERT_INFO     AcpiRsConvertFixedIo[4] =
205ddbd7b91SNathan Whitehorn{
20643547dbeSJérôme Duval    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_FIXED_IO,
20743547dbeSJérôme Duval                        ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_IO),
20843547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedIo)},
209ddbd7b91SNathan Whitehorn
21043547dbeSJérôme Duval    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_FIXED_IO,
21143547dbeSJérôme Duval                        sizeof (AML_RESOURCE_FIXED_IO),
21243547dbeSJérôme Duval                        0},
213ddbd7b91SNathan Whitehorn    /*
21443547dbeSJérôme Duval     * These fields are contiguous in both the source and destination:
21543547dbeSJérôme Duval     * Base Address
21643547dbeSJérôme Duval     * Length
217ddbd7b91SNathan Whitehorn     */
21843547dbeSJérôme Duval    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.FixedIo.AddressLength),
21943547dbeSJérôme Duval                        AML_OFFSET (FixedIo.AddressLength),
22043547dbeSJérôme Duval                        1},
221ddbd7b91SNathan Whitehorn
22243547dbeSJérôme Duval    {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.FixedIo.Address),
22343547dbeSJérôme Duval                        AML_OFFSET (FixedIo.Address),
22443547dbeSJérôme Duval                        1}
22543547dbeSJérôme Duval};
226ddbd7b91SNathan Whitehorn
227ddbd7b91SNathan Whitehorn
228ddbd7b91SNathan Whitehorn/*******************************************************************************
229ddbd7b91SNathan Whitehorn *
23043547dbeSJérôme Duval * AcpiRsConvertGenericReg
231ddbd7b91SNathan Whitehorn *
232ddbd7b91SNathan Whitehorn ******************************************************************************/
233ddbd7b91SNathan Whitehorn
23443547dbeSJérôme DuvalACPI_RSCONVERT_INFO     AcpiRsConvertGenericReg[4] =
235ddbd7b91SNathan Whitehorn{
23643547dbeSJérôme Duval    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_GENERIC_REGISTER,
23743547dbeSJérôme Duval                        ACPI_RS_SIZE (ACPI_RESOURCE_GENERIC_REGISTER),
23843547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertGenericReg)},
239ddbd7b91SNathan Whitehorn
24043547dbeSJérôme Duval    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_GENERIC_REGISTER,
24143547dbeSJérôme Duval                        sizeof (AML_RESOURCE_GENERIC_REGISTER),
24243547dbeSJérôme Duval                        0},
243ddbd7b91SNathan Whitehorn    /*
24443547dbeSJérôme Duval     * These fields are contiguous in both the source and destination:
24543547dbeSJérôme Duval     * Address Space ID
24643547dbeSJérôme Duval     * Register Bit Width
24743547dbeSJérôme Duval     * Register Bit Offset
24843547dbeSJérôme Duval     * Access Size
249ddbd7b91SNathan Whitehorn     */
25043547dbeSJérôme Duval    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.GenericReg.SpaceId),
25143547dbeSJérôme Duval                        AML_OFFSET (GenericReg.AddressSpaceId),
25243547dbeSJérôme Duval                        4},
253ddbd7b91SNathan Whitehorn
25443547dbeSJérôme Duval    /* Get the Register Address */
255ddbd7b91SNathan Whitehorn
25643547dbeSJérôme Duval    {ACPI_RSC_MOVE64,   ACPI_RS_OFFSET (Data.GenericReg.Address),
25743547dbeSJérôme Duval                        AML_OFFSET (GenericReg.Address),
25843547dbeSJérôme Duval                        1}
25943547dbeSJérôme Duval};
260ddbd7b91SNathan Whitehorn
261ddbd7b91SNathan Whitehorn
262ddbd7b91SNathan Whitehorn/*******************************************************************************
263ddbd7b91SNathan Whitehorn *
26443547dbeSJérôme Duval * AcpiRsConvertEndDpf
265ddbd7b91SNathan Whitehorn *
266ddbd7b91SNathan Whitehorn ******************************************************************************/
267ddbd7b91SNathan Whitehorn
26843547dbeSJérôme DuvalACPI_RSCONVERT_INFO   AcpiRsConvertEndDpf[2] =
269ddbd7b91SNathan Whitehorn{
27043547dbeSJérôme Duval    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_END_DEPENDENT,
27143547dbeSJérôme Duval                        ACPI_RS_SIZE_MIN,
27243547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertEndDpf)},
273ddbd7b91SNathan Whitehorn
27443547dbeSJérôme Duval    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_END_DEPENDENT,
27543547dbeSJérôme Duval                        sizeof (AML_RESOURCE_END_DEPENDENT),
27643547dbeSJérôme Duval                        0}
27743547dbeSJérôme Duval};
278ddbd7b91SNathan Whitehorn
279ddbd7b91SNathan Whitehorn
28043547dbeSJérôme Duval/*******************************************************************************
28143547dbeSJérôme Duval *
28243547dbeSJérôme Duval * AcpiRsConvertEndTag
28343547dbeSJérôme Duval *
28443547dbeSJérôme Duval ******************************************************************************/
285ddbd7b91SNathan Whitehorn
28643547dbeSJérôme DuvalACPI_RSCONVERT_INFO   AcpiRsConvertEndTag[2] =
28743547dbeSJérôme Duval{
28843547dbeSJérôme Duval    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_END_TAG,
28943547dbeSJérôme Duval                        ACPI_RS_SIZE_MIN,
29043547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertEndTag)},
291ddbd7b91SNathan Whitehorn
292ddbd7b91SNathan Whitehorn    /*
29343547dbeSJérôme Duval     * Note: The checksum field is set to zero, meaning that the resource
29443547dbeSJérôme Duval     * data is treated as if the checksum operation succeeded.
29543547dbeSJérôme Duval     * (ACPI Spec 1.0b Section 6.4.2.8)
296ddbd7b91SNathan Whitehorn     */
29743547dbeSJérôme Duval    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_END_TAG,
29843547dbeSJérôme Duval                        sizeof (AML_RESOURCE_END_TAG),
29943547dbeSJérôme Duval                        0}
30043547dbeSJérôme Duval};
301ddbd7b91SNathan Whitehorn
302ddbd7b91SNathan Whitehorn
303ddbd7b91SNathan Whitehorn/*******************************************************************************
304ddbd7b91SNathan Whitehorn *
30543547dbeSJérôme Duval * AcpiRsGetStartDpf
306ddbd7b91SNathan Whitehorn *
307ddbd7b91SNathan Whitehorn ******************************************************************************/
308ddbd7b91SNathan Whitehorn
3092608583eSJérôme DuvalACPI_RSCONVERT_INFO   AcpiRsGetStartDpf[6] =
310ddbd7b91SNathan Whitehorn{
31143547dbeSJérôme Duval    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_START_DEPENDENT,
31243547dbeSJérôme Duval                        ACPI_RS_SIZE (ACPI_RESOURCE_START_DEPENDENT),
31343547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsGetStartDpf)},
314ddbd7b91SNathan Whitehorn
31543547dbeSJérôme Duval    /* Defaults for Compatibility and Performance priorities */
316ddbd7b91SNathan Whitehorn
31743547dbeSJérôme Duval    {ACPI_RSC_SET8,     ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
31843547dbeSJérôme Duval                        ACPI_ACCEPTABLE_CONFIGURATION,
31943547dbeSJérôme Duval                        2},
320ddbd7b91SNathan Whitehorn
3212608583eSJérôme Duval    /* Get the descriptor length (0 or 1 for Start Dpf descriptor) */
3222608583eSJérôme Duval
3232608583eSJérôme Duval    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.DescriptorLength),
3242608583eSJérôme Duval                        AML_OFFSET (StartDpf.DescriptorType),
3252608583eSJérôme Duval                        0},
3262608583eSJérôme Duval
32743547dbeSJérôme Duval    /* All done if there is no flag byte present in the descriptor */
328ddbd7b91SNathan Whitehorn
32943547dbeSJérôme Duval    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_AML_LENGTH, 0, 1},
330ddbd7b91SNathan Whitehorn
33143547dbeSJérôme Duval    /* Flag byte is present, get the flags */
332ddbd7b91SNathan Whitehorn
33343547dbeSJérôme Duval    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
33443547dbeSJérôme Duval                        AML_OFFSET (StartDpf.Flags),
33543547dbeSJérôme Duval                        0},
336ddbd7b91SNathan Whitehorn
33743547dbeSJérôme Duval    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.PerformanceRobustness),
33843547dbeSJérôme Duval                        AML_OFFSET (StartDpf.Flags),
33943547dbeSJérôme Duval                        2}
34043547dbeSJérôme Duval};
341ddbd7b91SNathan Whitehorn
342ddbd7b91SNathan Whitehorn
343ddbd7b91SNathan Whitehorn/*******************************************************************************
344ddbd7b91SNathan Whitehorn *
34543547dbeSJérôme Duval * AcpiRsSetStartDpf
346ddbd7b91SNathan Whitehorn *
347ddbd7b91SNathan Whitehorn ******************************************************************************/
348ddbd7b91SNathan Whitehorn
3492608583eSJérôme DuvalACPI_RSCONVERT_INFO   AcpiRsSetStartDpf[10] =
350ddbd7b91SNathan Whitehorn{
3512608583eSJérôme Duval    /* Start with a default descriptor of length 1 */
3522608583eSJérôme Duval
35343547dbeSJérôme Duval    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_START_DEPENDENT,
35443547dbeSJérôme Duval                        sizeof (AML_RESOURCE_START_DEPENDENT),
35543547dbeSJérôme Duval                        ACPI_RSC_TABLE_SIZE (AcpiRsSetStartDpf)},
356ddbd7b91SNathan Whitehorn
35743547dbeSJérôme Duval    /* Set the default flag values */
358ddbd7b91SNathan Whitehorn
35943547dbeSJérôme Duval    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
36043547dbeSJérôme Duval                        AML_OFFSET (StartDpf.Flags),
36143547dbeSJérôme Duval                        0},
362ddbd7b91SNathan Whitehorn
36343547dbeSJérôme Duval    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.PerformanceRobustness),
36443547dbeSJérôme Duval                        AML_OFFSET (StartDpf.Flags),
36543547dbeSJérôme Duval                        2},
3662608583eSJérôme Duval    /*
3672608583eSJérôme Duval     * All done if the output descriptor length is required to be 1
3682608583eSJérôme Duval     * (i.e., optimization to 0 bytes cannot be attempted)
3692608583eSJérôme Duval     */
3702608583eSJérôme Duval    {ACPI_RSC_EXIT_EQ,  ACPI_RSC_COMPARE_VALUE,
3712608583eSJérôme Duval                        ACPI_RS_OFFSET(Data.StartDpf.DescriptorLength),
3722608583eSJérôme Duval                        1},
3732608583eSJérôme Duval
3742608583eSJérôme Duval    /* Set length to 0 bytes (no flags byte) */
3752608583eSJérôme Duval
3762608583eSJérôme Duval    {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)},
3772608583eSJérôme Duval
3782608583eSJérôme Duval    /*
3792608583eSJérôme Duval     * All done if the output descriptor length is required to be 0.
3802608583eSJérôme Duval     *
3812608583eSJérôme Duval     * TBD: Perhaps we should check for error if input flags are not
3822608583eSJérôme Duval     * compatible with a 0-byte descriptor.
3832608583eSJérôme Duval     */
3842608583eSJérôme Duval    {ACPI_RSC_EXIT_EQ,  ACPI_RSC_COMPARE_VALUE,
3852608583eSJérôme Duval                        ACPI_RS_OFFSET(Data.StartDpf.DescriptorLength),
3862608583eSJérôme Duval                        0},
3872608583eSJérôme Duval
3882608583eSJérôme Duval    /* Reset length to 1 byte (descriptor with flags byte) */
3892608583eSJérôme Duval
3902608583eSJérôme Duval    {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_START_DEPENDENT)},
3912608583eSJérôme Duval
3922608583eSJérôme Duval
393ddbd7b91SNathan Whitehorn    /*
39443547dbeSJérôme Duval     * All done if flags byte is necessary -- if either priority value
39543547dbeSJérôme Duval     * is not ACPI_ACCEPTABLE_CONFIGURATION
396ddbd7b91SNathan Whitehorn     */
39743547dbeSJérôme Duval    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
39843547dbeSJérôme Duval                        ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
39943547dbeSJérôme Duval                        ACPI_ACCEPTABLE_CONFIGURATION},
400ddbd7b91SNathan Whitehorn
40143547dbeSJérôme Duval    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
40243547dbeSJérôme Duval                        ACPI_RS_OFFSET (Data.StartDpf.PerformanceRobustness),
40343547dbeSJérôme Duval                        ACPI_ACCEPTABLE_CONFIGURATION},
404ddbd7b91SNathan Whitehorn
40543547dbeSJérôme Duval    /* Flag byte is not necessary */
406ddbd7b91SNathan Whitehorn
40743547dbeSJérôme Duval    {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)}
40843547dbeSJérôme Duval};
409