167754Smsmith/*******************************************************************************
267754Smsmith *
377424Smsmith * Module Name: rsirq - IRQ resource descriptors
467754Smsmith *
567754Smsmith ******************************************************************************/
667754Smsmith
7316303Sjkim/******************************************************************************
8316303Sjkim *
9316303Sjkim * 1. Copyright Notice
10316303Sjkim *
11316303Sjkim * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
1270243Smsmith * All rights reserved.
1367754Smsmith *
14316303Sjkim * 2. License
15316303Sjkim *
16316303Sjkim * 2.1. This is your license from Intel Corp. under its intellectual property
17316303Sjkim * rights. You may have additional license terms from the party that provided
18316303Sjkim * you this software, covering your right to use that party's intellectual
19316303Sjkim * property rights.
20316303Sjkim *
21316303Sjkim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22316303Sjkim * copy of the source code appearing in this file ("Covered Code") an
23316303Sjkim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24316303Sjkim * base code distributed originally by Intel ("Original Intel Code") to copy,
25316303Sjkim * make derivatives, distribute, use and display any portion of the Covered
26316303Sjkim * Code in any form, with the right to sublicense such rights; and
27316303Sjkim *
28316303Sjkim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29316303Sjkim * license (with the right to sublicense), under only those claims of Intel
30316303Sjkim * patents that are infringed by the Original Intel Code, to make, use, sell,
31316303Sjkim * offer to sell, and import the Covered Code and derivative works thereof
32316303Sjkim * solely to the minimum extent necessary to exercise the above copyright
33316303Sjkim * license, and in no event shall the patent license extend to any additions
34316303Sjkim * to or modifications of the Original Intel Code. No other license or right
35316303Sjkim * is granted directly or by implication, estoppel or otherwise;
36316303Sjkim *
37316303Sjkim * The above copyright and patent license is granted only if the following
38316303Sjkim * conditions are met:
39316303Sjkim *
40316303Sjkim * 3. Conditions
41316303Sjkim *
42316303Sjkim * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43316303Sjkim * Redistribution of source code of any substantial portion of the Covered
44316303Sjkim * Code or modification with rights to further distribute source must include
45316303Sjkim * the above Copyright Notice, the above License, this list of Conditions,
46316303Sjkim * and the following Disclaimer and Export Compliance provision. In addition,
47316303Sjkim * Licensee must cause all Covered Code to which Licensee contributes to
48316303Sjkim * contain a file documenting the changes Licensee made to create that Covered
49316303Sjkim * Code and the date of any change. Licensee must include in that file the
50316303Sjkim * documentation of any changes made by any predecessor Licensee. Licensee
51316303Sjkim * must include a prominent statement that the modification is derived,
52316303Sjkim * directly or indirectly, from Original Intel Code.
53316303Sjkim *
54316303Sjkim * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55316303Sjkim * Redistribution of source code of any substantial portion of the Covered
56316303Sjkim * Code or modification without rights to further distribute source must
57316303Sjkim * include the following Disclaimer and Export Compliance provision in the
58316303Sjkim * documentation and/or other materials provided with distribution. In
59316303Sjkim * addition, Licensee may not authorize further sublicense of source of any
60316303Sjkim * portion of the Covered Code, and must include terms to the effect that the
61316303Sjkim * license from Licensee to its licensee is limited to the intellectual
62316303Sjkim * property embodied in the software Licensee provides to its licensee, and
63316303Sjkim * not to intellectual property embodied in modifications its licensee may
64316303Sjkim * make.
65316303Sjkim *
66316303Sjkim * 3.3. Redistribution of Executable. Redistribution in executable form of any
67316303Sjkim * substantial portion of the Covered Code or modification must reproduce the
68316303Sjkim * above Copyright Notice, and the following Disclaimer and Export Compliance
69316303Sjkim * provision in the documentation and/or other materials provided with the
70316303Sjkim * distribution.
71316303Sjkim *
72316303Sjkim * 3.4. Intel retains all right, title, and interest in and to the Original
73316303Sjkim * Intel Code.
74316303Sjkim *
75316303Sjkim * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76316303Sjkim * Intel shall be used in advertising or otherwise to promote the sale, use or
77316303Sjkim * other dealings in products derived from or relating to the Covered Code
78316303Sjkim * without prior written authorization from Intel.
79316303Sjkim *
80316303Sjkim * 4. Disclaimer and Export Compliance
81316303Sjkim *
82316303Sjkim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83316303Sjkim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84316303Sjkim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85316303Sjkim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86316303Sjkim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87316303Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88316303Sjkim * PARTICULAR PURPOSE.
89316303Sjkim *
90316303Sjkim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91316303Sjkim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92316303Sjkim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93316303Sjkim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94316303Sjkim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95316303Sjkim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96316303Sjkim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97316303Sjkim * LIMITED REMEDY.
98316303Sjkim *
99316303Sjkim * 4.3. Licensee shall not export, either directly or indirectly, any of this
100316303Sjkim * software or system incorporating such software without first obtaining any
101316303Sjkim * required license or other approval from the U. S. Department of Commerce or
102316303Sjkim * any other agency or department of the United States Government. In the
103316303Sjkim * event Licensee exports any such software from the United States or
104316303Sjkim * re-exports any such software from a foreign destination, Licensee shall
105316303Sjkim * ensure that the distribution and export/re-export of the software is in
106316303Sjkim * compliance with all laws, regulations, orders, or other restrictions of the
107316303Sjkim * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108316303Sjkim * any of its subsidiaries will export/re-export any technical data, process,
109316303Sjkim * software, or service, directly or indirectly, to any country for which the
110316303Sjkim * United States government or any agency thereof requires an export license,
111316303Sjkim * other governmental approval, or letter of assurance, without first obtaining
112316303Sjkim * such license, approval or letter.
113316303Sjkim *
114316303Sjkim *****************************************************************************
115316303Sjkim *
116316303Sjkim * Alternatively, you may choose to be licensed under the terms of the
117316303Sjkim * following license:
118316303Sjkim *
119217365Sjkim * Redistribution and use in source and binary forms, with or without
120217365Sjkim * modification, are permitted provided that the following conditions
121217365Sjkim * are met:
122217365Sjkim * 1. Redistributions of source code must retain the above copyright
123217365Sjkim *    notice, this list of conditions, and the following disclaimer,
124217365Sjkim *    without modification.
125217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126217365Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
127217365Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
128217365Sjkim *    including a substantially similar Disclaimer requirement for further
129217365Sjkim *    binary redistribution.
130217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
131217365Sjkim *    of any contributors may be used to endorse or promote products derived
132217365Sjkim *    from this software without specific prior written permission.
13367754Smsmith *
134316303Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135316303Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136316303Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137316303Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138316303Sjkim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139316303Sjkim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140316303Sjkim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141316303Sjkim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142316303Sjkim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143316303Sjkim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144316303Sjkim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145316303Sjkim *
146316303Sjkim * Alternatively, you may choose to be licensed under the terms of the
147217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
148217365Sjkim * Software Foundation.
14967754Smsmith *
150316303Sjkim *****************************************************************************/
15167754Smsmith
152193341Sjkim#include <contrib/dev/acpica/include/acpi.h>
153193341Sjkim#include <contrib/dev/acpica/include/accommon.h>
154193341Sjkim#include <contrib/dev/acpica/include/acresrc.h>
15567754Smsmith
15677424Smsmith#define _COMPONENT          ACPI_RESOURCES
15791116Smsmith        ACPI_MODULE_NAME    ("rsirq")
15867754Smsmith
15967754Smsmith
16067754Smsmith/*******************************************************************************
16167754Smsmith *
162151937Sjkim * AcpiRsGetIrq
16367754Smsmith *
16467754Smsmith ******************************************************************************/
16567754Smsmith
166245582SjkimACPI_RSCONVERT_INFO     AcpiRsGetIrq[9] =
16767754Smsmith{
168151937Sjkim    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_IRQ,
169151937Sjkim                        ACPI_RS_SIZE (ACPI_RESOURCE_IRQ),
170151937Sjkim                        ACPI_RSC_TABLE_SIZE (AcpiRsGetIrq)},
17167754Smsmith
172151937Sjkim    /* Get the IRQ mask (bytes 1:2) */
17367754Smsmith
174151937Sjkim    {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]),
175151937Sjkim                        AML_OFFSET (Irq.IrqMask),
176151937Sjkim                        ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
17767754Smsmith
178151937Sjkim    /* Set default flags (others are zero) */
17977424Smsmith
180151937Sjkim    {ACPI_RSC_SET8,     ACPI_RS_OFFSET (Data.Irq.Triggering),
181151937Sjkim                        ACPI_EDGE_SENSITIVE,
182151937Sjkim                        1},
18367754Smsmith
184193267Sjkim    /* Get the descriptor length (2 or 3 for IRQ descriptor) */
185193267Sjkim
186193267Sjkim    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Irq.DescriptorLength),
187193267Sjkim                        AML_OFFSET (Irq.DescriptorType),
188193267Sjkim                        0},
189193267Sjkim
190151937Sjkim    /* All done if no flag byte present in descriptor */
19167754Smsmith
192151937Sjkim    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
19367754Smsmith
194245582Sjkim    /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
19567754Smsmith
196151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering),
197151937Sjkim                        AML_OFFSET (Irq.Flags),
198151937Sjkim                        0},
19999679Siwasaki
200151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Polarity),
201151937Sjkim                        AML_OFFSET (Irq.Flags),
202151937Sjkim                        3},
203100966Siwasaki
204151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable),
205151937Sjkim                        AML_OFFSET (Irq.Flags),
206245582Sjkim                        4},
207245582Sjkim
208245582Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.WakeCapable),
209245582Sjkim                        AML_OFFSET (Irq.Flags),
210245582Sjkim                        5}
211151937Sjkim};
21267754Smsmith
21367754Smsmith
21467754Smsmith/*******************************************************************************
21567754Smsmith *
216151937Sjkim * AcpiRsSetIrq
21767754Smsmith *
21867754Smsmith ******************************************************************************/
21967754Smsmith
220245582SjkimACPI_RSCONVERT_INFO     AcpiRsSetIrq[14] =
22167754Smsmith{
222193267Sjkim    /* Start with a default descriptor of length 3 */
223193267Sjkim
224151937Sjkim    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_IRQ,
225151937Sjkim                        sizeof (AML_RESOURCE_IRQ),
226151937Sjkim                        ACPI_RSC_TABLE_SIZE (AcpiRsSetIrq)},
22767754Smsmith
228151937Sjkim    /* Convert interrupt list to 16-bit IRQ bitmask */
22967754Smsmith
230151937Sjkim    {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]),
231151937Sjkim                        AML_OFFSET (Irq.IrqMask),
232151937Sjkim                        ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
23367754Smsmith
234245582Sjkim    /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
23567754Smsmith
236151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering),
237151937Sjkim                        AML_OFFSET (Irq.Flags),
238151937Sjkim                        0},
23967754Smsmith
240151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Polarity),
241151937Sjkim                        AML_OFFSET (Irq.Flags),
242151937Sjkim                        3},
24367754Smsmith
244151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable),
245151937Sjkim                        AML_OFFSET (Irq.Flags),
246151937Sjkim                        4},
247193267Sjkim
248245582Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.WakeCapable),
249245582Sjkim                        AML_OFFSET (Irq.Flags),
250245582Sjkim                        5},
251245582Sjkim
25267754Smsmith    /*
253193267Sjkim     * All done if the output descriptor length is required to be 3
254193267Sjkim     * (i.e., optimization to 2 bytes cannot be attempted)
255193267Sjkim     */
256193267Sjkim    {ACPI_RSC_EXIT_EQ,  ACPI_RSC_COMPARE_VALUE,
257193267Sjkim                        ACPI_RS_OFFSET(Data.Irq.DescriptorLength),
258193267Sjkim                        3},
259193267Sjkim
260193267Sjkim    /* Set length to 2 bytes (no flags byte) */
261193267Sjkim
262193267Sjkim    {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)},
263193267Sjkim
264193267Sjkim    /*
265193267Sjkim     * All done if the output descriptor length is required to be 2.
266193267Sjkim     *
267193267Sjkim     * TBD: Perhaps we should check for error if input flags are not
268193267Sjkim     * compatible with a 2-byte descriptor.
269193267Sjkim     */
270193267Sjkim    {ACPI_RSC_EXIT_EQ,  ACPI_RSC_COMPARE_VALUE,
271193267Sjkim                        ACPI_RS_OFFSET(Data.Irq.DescriptorLength),
272193267Sjkim                        2},
273193267Sjkim
274193267Sjkim    /* Reset length to 3 bytes (descriptor with flags byte) */
275193267Sjkim
276193267Sjkim    {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_IRQ)},
277193267Sjkim
278193267Sjkim    /*
279151937Sjkim     * Check if the flags byte is necessary. Not needed if the flags are:
280151937Sjkim     * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE
28167754Smsmith     */
282151937Sjkim    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
283151937Sjkim                        ACPI_RS_OFFSET (Data.Irq.Triggering),
284151937Sjkim                        ACPI_EDGE_SENSITIVE},
28567754Smsmith
286151937Sjkim    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
287151937Sjkim                        ACPI_RS_OFFSET (Data.Irq.Polarity),
288151937Sjkim                        ACPI_ACTIVE_HIGH},
28967754Smsmith
290151937Sjkim    {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
291151937Sjkim                        ACPI_RS_OFFSET (Data.Irq.Sharable),
292151937Sjkim                        ACPI_EXCLUSIVE},
29367754Smsmith
294193267Sjkim    /* We can optimize to a 2-byte IrqNoFlags() descriptor */
29567754Smsmith
296151937Sjkim    {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)}
297151937Sjkim};
29867754Smsmith
29967754Smsmith
30067754Smsmith/*******************************************************************************
30167754Smsmith *
302151937Sjkim * AcpiRsConvertExtIrq
30367754Smsmith *
30467754Smsmith ******************************************************************************/
30567754Smsmith
306245582SjkimACPI_RSCONVERT_INFO     AcpiRsConvertExtIrq[10] =
30767754Smsmith{
308151937Sjkim    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
309151937Sjkim                        ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ),
310151937Sjkim                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertExtIrq)},
31167754Smsmith
312151937Sjkim    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_EXTENDED_IRQ,
313151937Sjkim                        sizeof (AML_RESOURCE_EXTENDED_IRQ),
314151937Sjkim                        0},
31567754Smsmith
316245582Sjkim    /*
317245582Sjkim     * Flags: Producer/Consumer[0], Triggering[1], Polarity[2],
318245582Sjkim     *        Sharing[3], Wake[4]
319245582Sjkim     */
320151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.ProducerConsumer),
321151937Sjkim                        AML_OFFSET (ExtendedIrq.Flags),
322151937Sjkim                        0},
32377424Smsmith
324151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Triggering),
325151937Sjkim                        AML_OFFSET (ExtendedIrq.Flags),
326151937Sjkim                        1},
32767754Smsmith
328151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Polarity),
329151937Sjkim                        AML_OFFSET (ExtendedIrq.Flags),
330151937Sjkim                        2},
331123315Snjl
332151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Sharable),
333151937Sjkim                        AML_OFFSET (ExtendedIrq.Flags),
334151937Sjkim                        3},
335123315Snjl
336245582Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.WakeCapable),
337245582Sjkim                        AML_OFFSET (ExtendedIrq.Flags),
338245582Sjkim                        4},
339245582Sjkim
340151937Sjkim    /* IRQ Table length (Byte4) */
34167754Smsmith
342151937Sjkim    {ACPI_RSC_COUNT,    ACPI_RS_OFFSET (Data.ExtendedIrq.InterruptCount),
343151937Sjkim                        AML_OFFSET (ExtendedIrq.InterruptCount),
344151937Sjkim                        sizeof (UINT32)},
34567754Smsmith
346151937Sjkim    /* Copy every IRQ in the table, each is 32 bits */
34767754Smsmith
348151937Sjkim    {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]),
349151937Sjkim                        AML_OFFSET (ExtendedIrq.Interrupts[0]),
350151937Sjkim                        0},
35167754Smsmith
352151937Sjkim    /* Optional ResourceSource (Index and String) */
35391116Smsmith
354151937Sjkim    {ACPI_RSC_SOURCEX,  ACPI_RS_OFFSET (Data.ExtendedIrq.ResourceSource),
355151937Sjkim                        ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]),
356151937Sjkim                        sizeof (AML_RESOURCE_EXTENDED_IRQ)}
357151937Sjkim};
35867754Smsmith
35967754Smsmith
36067754Smsmith/*******************************************************************************
36167754Smsmith *
362151937Sjkim * AcpiRsConvertDma
36367754Smsmith *
36467754Smsmith ******************************************************************************/
36567754Smsmith
366151937SjkimACPI_RSCONVERT_INFO     AcpiRsConvertDma[6] =
36767754Smsmith{
368151937Sjkim    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_DMA,
369151937Sjkim                        ACPI_RS_SIZE (ACPI_RESOURCE_DMA),
370151937Sjkim                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertDma)},
37167754Smsmith
372151937Sjkim    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_DMA,
373151937Sjkim                        sizeof (AML_RESOURCE_DMA),
374151937Sjkim                        0},
37567754Smsmith
376151937Sjkim    /* Flags: transfer preference, bus mastering, channel speed */
37767754Smsmith
378151937Sjkim    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Dma.Transfer),
379151937Sjkim                        AML_OFFSET (Dma.Flags),
380151937Sjkim                        0},
38167754Smsmith
382151937Sjkim    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Dma.BusMaster),
383151937Sjkim                        AML_OFFSET (Dma.Flags),
384151937Sjkim                        2},
38567754Smsmith
386151937Sjkim    {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Dma.Type),
387151937Sjkim                        AML_OFFSET (Dma.Flags),
388151937Sjkim                        5},
38967754Smsmith
390151937Sjkim    /* DMA channel mask bits */
39167754Smsmith
392151937Sjkim    {ACPI_RSC_BITMASK,  ACPI_RS_OFFSET (Data.Dma.Channels[0]),
393151937Sjkim                        AML_OFFSET (Dma.DmaChannelMask),
394151937Sjkim                        ACPI_RS_OFFSET (Data.Dma.ChannelCount)}
395151937Sjkim};
39667754Smsmith
397228110Sjkim
398228110Sjkim/*******************************************************************************
399228110Sjkim *
400228110Sjkim * AcpiRsConvertFixedDma
401228110Sjkim *
402228110Sjkim ******************************************************************************/
403228110Sjkim
404228110SjkimACPI_RSCONVERT_INFO     AcpiRsConvertFixedDma[4] =
405228110Sjkim{
406228110Sjkim    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_FIXED_DMA,
407228110Sjkim                        ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA),
408228110Sjkim                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedDma)},
409228110Sjkim
410228110Sjkim    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_FIXED_DMA,
411228110Sjkim                        sizeof (AML_RESOURCE_FIXED_DMA),
412228110Sjkim                        0},
413228110Sjkim
414228110Sjkim    /*
415228110Sjkim     * These fields are contiguous in both the source and destination:
416228110Sjkim     * RequestLines
417228110Sjkim     * Channels
418228110Sjkim     */
419228110Sjkim    {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.FixedDma.RequestLines),
420228110Sjkim                        AML_OFFSET (FixedDma.RequestLines),
421228110Sjkim                        2},
422228110Sjkim
423228110Sjkim    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.FixedDma.Width),
424228110Sjkim                        AML_OFFSET (FixedDma.Width),
425228110Sjkim                        1},
426228110Sjkim};
427