dmresrcs.c revision 100966
1100966Siwasaki/*******************************************************************************
2100966Siwasaki *
3100966Siwasaki * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
4100966Siwasaki *              $Revision: 2 $
5100966Siwasaki *
6100966Siwasaki ******************************************************************************/
7217365Sjkim
8217365Sjkim/******************************************************************************
9100966Siwasaki *
10100966Siwasaki * 1. Copyright Notice
11217365Sjkim *
12217365Sjkim * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
13217365Sjkim * All rights reserved.
14217365Sjkim *
15217365Sjkim * 2. License
16217365Sjkim *
17217365Sjkim * 2.1. This is your license from Intel Corp. under its intellectual property
18217365Sjkim * rights.  You may have additional license terms from the party that provided
19217365Sjkim * you this software, covering your right to use that party's intellectual
20217365Sjkim * property rights.
21217365Sjkim *
22217365Sjkim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23217365Sjkim * copy of the source code appearing in this file ("Covered Code") an
24217365Sjkim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25100966Siwasaki * base code distributed originally by Intel ("Original Intel Code") to copy,
26217365Sjkim * make derivatives, distribute, use and display any portion of the Covered
27217365Sjkim * Code in any form, with the right to sublicense such rights; and
28217365Sjkim *
29100966Siwasaki * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30217365Sjkim * license (with the right to sublicense), under only those claims of Intel
31217365Sjkim * patents that are infringed by the Original Intel Code, to make, use, sell,
32217365Sjkim * offer to sell, and import the Covered Code and derivative works thereof
33217365Sjkim * solely to the minimum extent necessary to exercise the above copyright
34217365Sjkim * license, and in no event shall the patent license extend to any additions
35217365Sjkim * to or modifications of the Original Intel Code.  No other license or right
36217365Sjkim * is granted directly or by implication, estoppel or otherwise;
37217365Sjkim *
38217365Sjkim * The above copyright and patent license is granted only if the following
39217365Sjkim * conditions are met:
40217365Sjkim *
41217365Sjkim * 3. Conditions
42217365Sjkim *
43100966Siwasaki * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44100966Siwasaki * Redistribution of source code of any substantial portion of the Covered
45193341Sjkim * Code or modification with rights to further distribute source must include
46193341Sjkim * the above Copyright Notice, the above License, this list of Conditions,
47193341Sjkim * and the following Disclaimer and Export Compliance provision.  In addition,
48100966Siwasaki * Licensee must cause all Covered Code to which Licensee contributes to
49100966Siwasaki * contain a file documenting the changes Licensee made to create that Covered
50100966Siwasaki * Code and the date of any change.  Licensee must include in that file the
51100966Siwasaki * documentation of any changes made by any predecessor Licensee.  Licensee
52102550Siwasaki * must include a prominent statement that the modification is derived,
53100966Siwasaki * directly or indirectly, from Original Intel Code.
54100966Siwasaki *
55100966Siwasaki * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56100966Siwasaki * Redistribution of source code of any substantial portion of the Covered
57100966Siwasaki * Code or modification without rights to further distribute source must
58100966Siwasaki * include the following Disclaimer and Export Compliance provision in the
59100966Siwasaki * documentation and/or other materials provided with distribution.  In
60100966Siwasaki * addition, Licensee may not authorize further sublicense of source of any
61100966Siwasaki * portion of the Covered Code, and must include terms to the effect that the
62100966Siwasaki * license from Licensee to its licensee is limited to the intellectual
63100966Siwasaki * property embodied in the software Licensee provides to its licensee, and
64100966Siwasaki * not to intellectual property embodied in modifications its licensee may
65100966Siwasaki * make.
66151937Sjkim *
67100966Siwasaki * 3.3. Redistribution of Executable. Redistribution in executable form of any
68100966Siwasaki * substantial portion of the Covered Code or modification must reproduce the
69100966Siwasaki * above Copyright Notice, and the following Disclaimer and Export Compliance
70100966Siwasaki * provision in the documentation and/or other materials provided with the
71100966Siwasaki * distribution.
72151937Sjkim *
73100966Siwasaki * 3.4. Intel retains all right, title, and interest in and to the Original
74100966Siwasaki * Intel Code.
75100966Siwasaki *
76100966Siwasaki * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77100966Siwasaki * Intel shall be used in advertising or otherwise to promote the sale, use or
78100966Siwasaki * other dealings in products derived from or relating to the Covered Code
79100966Siwasaki * without prior written authorization from Intel.
80100966Siwasaki *
81151937Sjkim * 4. Disclaimer and Export Compliance
82151937Sjkim *
83100966Siwasaki * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84100966Siwasaki * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85167802Sjkim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86167802Sjkim * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87167802Sjkim * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88167802Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89100966Siwasaki * PARTICULAR PURPOSE.
90167802Sjkim *
91167802Sjkim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92167802Sjkim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93167802Sjkim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94151937Sjkim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95100966Siwasaki * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96151937Sjkim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97151937Sjkim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98100966Siwasaki * LIMITED REMEDY.
99100966Siwasaki *
100100966Siwasaki * 4.3. Licensee shall not export, either directly or indirectly, any of this
101100966Siwasaki * software or system incorporating such software without first obtaining any
102100966Siwasaki * required license or other approval from the U. S. Department of Commerce or
103100966Siwasaki * any other agency or department of the United States Government.  In the
104100966Siwasaki * event Licensee exports any such software from the United States or
105100966Siwasaki * re-exports any such software from a foreign destination, Licensee shall
106100966Siwasaki * ensure that the distribution and export/re-export of the software is in
107100966Siwasaki * compliance with all laws, regulations, orders, or other restrictions of the
108100966Siwasaki * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109100966Siwasaki * any of its subsidiaries will export/re-export any technical data, process,
110100966Siwasaki * software, or service, directly or indirectly, to any country for which the
111100966Siwasaki * United States government or any agency thereof requires an export license,
112100966Siwasaki * other governmental approval, or letter of assurance, without first obtaining
113100966Siwasaki * such license, approval or letter.
114100966Siwasaki *
115100966Siwasaki *****************************************************************************/
116100966Siwasaki
117151937Sjkim
118100966Siwasaki#include "acpi.h"
119100966Siwasaki#include "acdisasm.h"
120100966Siwasaki
121100966Siwasaki
122100966Siwasaki#ifdef ACPI_DISASSEMBLER
123167802Sjkim
124228110Sjkim#define _COMPONENT          ACPI_DEBUGGER
125228110Sjkim        ACPI_MODULE_NAME    ("dbresrcs")
126228110Sjkim
127100966Siwasaki
128167802Sjkim/*******************************************************************************
129167802Sjkim *
130167802Sjkim * FUNCTION:    AcpiDmIrqDescriptor
131167802Sjkim *
132167802Sjkim * PARAMETERS:  Resource            - Pointer to the resource descriptor
133151937Sjkim *              Length              - Length of the descriptor in bytes
134151937Sjkim *              Level               - Current source code indentation level
135100966Siwasaki *
136100966Siwasaki * RETURN:      None
137100966Siwasaki *
138100966Siwasaki * DESCRIPTION: Decode a IRQ descriptor
139100966Siwasaki *
140228110Sjkim ******************************************************************************/
141228110Sjkim
142228110Sjkimvoid
143228110SjkimAcpiDmIrqDescriptor (
144228110Sjkim    ASL_IRQ_FORMAT_DESC     *Resource,
145228110Sjkim    UINT32                  Length,
146228110Sjkim    UINT32                  Level)
147228110Sjkim{
148228110Sjkim
149228110Sjkim    AcpiDmIndent (Level);
150228110Sjkim    AcpiOsPrintf ("%s (",
151228110Sjkim        AcpiGbl_IrqDecode [Length & 1]);
152228110Sjkim
153228110Sjkim    if (Length & 1)
154228110Sjkim    {
155228110Sjkim        AcpiOsPrintf ("%s, %s, %s",
156228110Sjkim            AcpiGbl_HEDecode [Resource->Flags & 1],
157228110Sjkim            AcpiGbl_LLDecode [(Resource->Flags >> 3) & 1],
158228110Sjkim            AcpiGbl_SHRDecode [(Resource->Flags >> 4) & 1]);
159228110Sjkim    }
160228110Sjkim
161228110Sjkim    AcpiDmBitList (Resource->IrqMask);
162228110Sjkim}
163228110Sjkim
164228110Sjkim
165228110Sjkim/*******************************************************************************
166228110Sjkim *
167228110Sjkim * FUNCTION:    AcpiDmDmaDescriptor
168228110Sjkim *
169228110Sjkim * PARAMETERS:  Resource            - Pointer to the resource descriptor
170228110Sjkim *              Length              - Length of the descriptor in bytes
171228110Sjkim *              Level               - Current source code indentation level
172228110Sjkim *
173228110Sjkim * RETURN:      None
174228110Sjkim *
175228110Sjkim * DESCRIPTION: Decode a DMA descriptor
176228110Sjkim *
177228110Sjkim ******************************************************************************/
178228110Sjkim
179228110Sjkimvoid
180228110SjkimAcpiDmDmaDescriptor (
181228110Sjkim    ASL_DMA_FORMAT_DESC     *Resource,
182228110Sjkim    UINT32                  Length,
183100966Siwasaki    UINT32                  Level)
184100966Siwasaki{
185100966Siwasaki
186100966Siwasaki    AcpiDmIndent (Level);
187100966Siwasaki    AcpiOsPrintf ("DMA (%s, %s, %s",
188100966Siwasaki            AcpiGbl_TYPDecode [(Resource->Flags >> 5) & 3],
189100966Siwasaki            AcpiGbl_BMDecode  [(Resource->Flags >> 2) & 1],
190100966Siwasaki            AcpiGbl_SIZDecode [(Resource->Flags >> 0) & 3]);
191100966Siwasaki
192100966Siwasaki    AcpiDmBitList (Resource->DmaChannelMask);
193100966Siwasaki}
194100966Siwasaki
195100966Siwasaki
196100966Siwasaki/*******************************************************************************
197151937Sjkim *
198100966Siwasaki * FUNCTION:    AcpiDmIoDescriptor
199100966Siwasaki *
200100966Siwasaki * PARAMETERS:  Resource            - Pointer to the resource descriptor
201100966Siwasaki *              Length              - Length of the descriptor in bytes
202100966Siwasaki *              Level               - Current source code indentation level
203151937Sjkim *
204151937Sjkim * RETURN:      None
205151937Sjkim *
206151937Sjkim * DESCRIPTION: Decode an IO descriptor
207167802Sjkim *
208151937Sjkim ******************************************************************************/
209151937Sjkim
210167802Sjkimvoid
211151937SjkimAcpiDmIoDescriptor (
212151937Sjkim    ASL_IO_PORT_DESC        *Resource,
213167802Sjkim    UINT32                  Length,
214151937Sjkim    UINT32                  Level)
215151937Sjkim{
216167802Sjkim
217151937Sjkim    AcpiDmIndent (Level);
218167802Sjkim    AcpiOsPrintf ("IO (%s, 0x%4.4X, 0x%4.4X, 0x%2.2X, 0x%2.2X)\n",
219167802Sjkim        AcpiGbl_IoDecode [(Resource->Information & 1)],
220151937Sjkim        (UINT32) Resource->AddressMin,
221167802Sjkim        (UINT32) Resource->AddressMax,
222151937Sjkim        (UINT32) Resource->Alignment,
223100966Siwasaki        (UINT32) Resource->Length);
224100966Siwasaki}
225100966Siwasaki
226100966Siwasaki
227100966Siwasaki/*******************************************************************************
228100966Siwasaki *
229100966Siwasaki * FUNCTION:    AcpiDmFixedIoDescriptor
230100966Siwasaki *
231100966Siwasaki * PARAMETERS:  Resource            - Pointer to the resource descriptor
232100966Siwasaki *              Length              - Length of the descriptor in bytes
233100966Siwasaki *              Level               - Current source code indentation level
234100966Siwasaki *
235100966Siwasaki * RETURN:      None
236100966Siwasaki *
237100966Siwasaki * DESCRIPTION: Decode a Fixed IO descriptor
238100966Siwasaki *
239100966Siwasaki ******************************************************************************/
240100966Siwasaki
241100966Siwasakivoid
242151937SjkimAcpiDmFixedIoDescriptor (
243100966Siwasaki    ASL_FIXED_IO_PORT_DESC  *Resource,
244100966Siwasaki    UINT32                  Length,
245100966Siwasaki    UINT32                  Level)
246100966Siwasaki{
247100966Siwasaki
248151937Sjkim    AcpiDmIndent (Level);
249151937Sjkim    AcpiOsPrintf ("FixedIO (0x%4.4X, 0x%2.2X)\n",
250151937Sjkim        (UINT32) Resource->BaseAddress,
251167802Sjkim        (UINT32) Resource->Length);
252151937Sjkim}
253151937Sjkim
254167802Sjkim
255151937Sjkim/*******************************************************************************
256167802Sjkim *
257167802Sjkim * FUNCTION:    AcpiDmStartDependentDescriptor
258151937Sjkim *
259167802Sjkim * PARAMETERS:  Resource            - Pointer to the resource descriptor
260151937Sjkim *              Length              - Length of the descriptor in bytes
261100966Siwasaki *              Level               - Current source code indentation level
262100966Siwasaki *
263100966Siwasaki * RETURN:      None
264100966Siwasaki *
265100966Siwasaki * DESCRIPTION: Decode a Start Dependendent functions descriptor
266100966Siwasaki *
267100966Siwasaki ******************************************************************************/
268100966Siwasaki
269100966Siwasakivoid
270100966SiwasakiAcpiDmStartDependentDescriptor (
271100966Siwasaki    ASL_START_DEPENDENT_DESC *Resource,
272100966Siwasaki    UINT32                  Length,
273100966Siwasaki    UINT32                  Level)
274100966Siwasaki{
275100966Siwasaki
276100966Siwasaki    AcpiDmIndent (Level);
277100966Siwasaki
278100966Siwasaki    if (Length & 1)
279100966Siwasaki    {
280151937Sjkim        AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
281100966Siwasaki            (UINT32) Resource->Flags & 3,
282100966Siwasaki            (UINT32) (Resource->Flags >> 2) & 3);
283100966Siwasaki    }
284100966Siwasaki    else
285100966Siwasaki    {
286100966Siwasaki        AcpiOsPrintf ("StartDependentFnNoPri ()\n");
287100966Siwasaki    }
288100966Siwasaki
289100966Siwasaki    AcpiDmIndent (Level);
290151937Sjkim    AcpiOsPrintf ("{\n");
291151937Sjkim}
292100966Siwasaki
293100966Siwasaki
294100966Siwasaki/*******************************************************************************
295100966Siwasaki *
296100966Siwasaki * FUNCTION:    AcpiDmEndDependentDescriptor
297100966Siwasaki *
298100966Siwasaki * PARAMETERS:  Resource            - Pointer to the resource descriptor
299100966Siwasaki *              Length              - Length of the descriptor in bytes
300100966Siwasaki *              Level               - Current source code indentation level
301100966Siwasaki *
302100966Siwasaki * RETURN:      None
303100966Siwasaki *
304100966Siwasaki * DESCRIPTION: Decode an End Dependent functions descriptor
305100966Siwasaki *
306100966Siwasaki ******************************************************************************/
307100966Siwasaki
308100966Siwasakivoid
309100966SiwasakiAcpiDmEndDependentDescriptor (
310100966Siwasaki    ASL_START_DEPENDENT_DESC *Resource,
311100966Siwasaki    UINT32                  Length,
312100966Siwasaki    UINT32                  Level)
313100966Siwasaki{
314100966Siwasaki
315100966Siwasaki    AcpiDmIndent (Level);
316100966Siwasaki    AcpiOsPrintf ("}\n");
317100966Siwasaki    AcpiDmIndent (Level);
318100966Siwasaki    AcpiOsPrintf ("EndDependentFn ()\n");
319151937Sjkim}
320100966Siwasaki
321100966Siwasaki
322100966Siwasaki/*******************************************************************************
323100966Siwasaki *
324100966Siwasaki * FUNCTION:    AcpiDmVendorSmallDescriptor
325100966Siwasaki *
326100966Siwasaki * PARAMETERS:  Resource            - Pointer to the resource descriptor
327100966Siwasaki *              Length              - Length of the descriptor in bytes
328100966Siwasaki *              Level               - Current source code indentation level
329100966Siwasaki *
330100966Siwasaki * RETURN:      None
331100966Siwasaki *
332100966Siwasaki * DESCRIPTION: Decode a Vendor Small Descriptor
333100966Siwasaki *
334100966Siwasaki ******************************************************************************/
335100966Siwasaki
336100966Siwasakivoid
337100966SiwasakiAcpiDmVendorSmallDescriptor (
338100966Siwasaki    ASL_SMALL_VENDOR_DESC   *Resource,
339100966Siwasaki    UINT32                  Length,
340100966Siwasaki    UINT32                  Level)
341100966Siwasaki{
342100966Siwasaki
343100966Siwasaki    AcpiDmIndent (Level);
344100966Siwasaki    AcpiOsPrintf ("VendorShort () {");
345100966Siwasaki
346100966Siwasaki    AcpiDmDisasmByteList (0, (UINT8 *) Resource->VendorDefined, Length);
347151937Sjkim    AcpiOsPrintf ("}\n");
348100966Siwasaki}
349100966Siwasaki
350100966Siwasaki#endif
351100966Siwasaki
352167802Sjkim
353167802Sjkim