rsxface.c revision 117521
1292915Sdim/*******************************************************************************
2292915Sdim *
3353358Sdim * Module Name: rsxface - Public interfaces to the resource manager
4353358Sdim *              $Revision: 27 $
5353358Sdim *
6292915Sdim ******************************************************************************/
7292915Sdim
8292915Sdim/******************************************************************************
9292915Sdim *
10292915Sdim * 1. Copyright Notice
11292915Sdim *
12292915Sdim * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13292915Sdim * All rights reserved.
14292915Sdim *
15292915Sdim * 2. License
16292915Sdim *
17292915Sdim * 2.1. This is your license from Intel Corp. under its intellectual property
18327952Sdim * rights.  You may have additional license terms from the party that provided
19292915Sdim * you this software, covering your right to use that party's intellectual
20292915Sdim * property rights.
21292915Sdim *
22292915Sdim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23344779Sdim * copy of the source code appearing in this file ("Covered Code") an
24327952Sdim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25292915Sdim * base code distributed originally by Intel ("Original Intel Code") to copy,
26292915Sdim * make derivatives, distribute, use and display any portion of the Covered
27327952Sdim * Code in any form, with the right to sublicense such rights; and
28309124Sdim *
29344779Sdim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30327952Sdim * license (with the right to sublicense), under only those claims of Intel
31292915Sdim * patents that are infringed by the Original Intel Code, to make, use, sell,
32292915Sdim * offer to sell, and import the Covered Code and derivative works thereof
33292915Sdim * solely to the minimum extent necessary to exercise the above copyright
34292915Sdim * license, and in no event shall the patent license extend to any additions
35327952Sdim * to or modifications of the Original Intel Code.  No other license or right
36327952Sdim * is granted directly or by implication, estoppel or otherwise;
37327952Sdim *
38327952Sdim * The above copyright and patent license is granted only if the following
39327952Sdim * conditions are met:
40292915Sdim *
41292915Sdim * 3. Conditions
42292915Sdim *
43292915Sdim * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44341825Sdim * Redistribution of source code of any substantial portion of the Covered
45292915Sdim * Code or modification with rights to further distribute source must include
46292915Sdim * the above Copyright Notice, the above License, this list of Conditions,
47292915Sdim * and the following Disclaimer and Export Compliance provision.  In addition,
48292915Sdim * Licensee must cause all Covered Code to which Licensee contributes to
49292915Sdim * contain a file documenting the changes Licensee made to create that Covered
50292915Sdim * Code and the date of any change.  Licensee must include in that file the
51292915Sdim * documentation of any changes made by any predecessor Licensee.  Licensee
52292915Sdim * must include a prominent statement that the modification is derived,
53292915Sdim * directly or indirectly, from Original Intel Code.
54292915Sdim *
55292915Sdim * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56292915Sdim * Redistribution of source code of any substantial portion of the Covered
57292915Sdim * Code or modification without rights to further distribute source must
58292915Sdim * include the following Disclaimer and Export Compliance provision in the
59292915Sdim * documentation and/or other materials provided with distribution.  In
60327952Sdim * addition, Licensee may not authorize further sublicense of source of any
61327952Sdim * portion of the Covered Code, and must include terms to the effect that the
62292915Sdim * license from Licensee to its licensee is limited to the intellectual
63292915Sdim * property embodied in the software Licensee provides to its licensee, and
64292915Sdim * not to intellectual property embodied in modifications its licensee may
65292915Sdim * make.
66292915Sdim *
67292915Sdim * 3.3. Redistribution of Executable. Redistribution in executable form of any
68292915Sdim * substantial portion of the Covered Code or modification must reproduce the
69292915Sdim * above Copyright Notice, and the following Disclaimer and Export Compliance
70292915Sdim * provision in the documentation and/or other materials provided with the
71292915Sdim * distribution.
72292915Sdim *
73292915Sdim * 3.4. Intel retains all right, title, and interest in and to the Original
74292915Sdim * Intel Code.
75292915Sdim *
76292915Sdim * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77292915Sdim * Intel shall be used in advertising or otherwise to promote the sale, use or
78292915Sdim * other dealings in products derived from or relating to the Covered Code
79314564Sdim * without prior written authorization from Intel.
80292915Sdim *
81292915Sdim * 4. Disclaimer and Export Compliance
82292915Sdim *
83292915Sdim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84292915Sdim * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85292915Sdim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86292915Sdim * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87292915Sdim * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88292915Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89292915Sdim * PARTICULAR PURPOSE.
90292915Sdim *
91292915Sdim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92292915Sdim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93292915Sdim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94292915Sdim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95292915Sdim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96292915Sdim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97292915Sdim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98292915Sdim * LIMITED REMEDY.
99292915Sdim *
100341825Sdim * 4.3. Licensee shall not export, either directly or indirectly, any of this
101292915Sdim * software or system incorporating such software without first obtaining any
102341825Sdim * required license or other approval from the U. S. Department of Commerce or
103292915Sdim * any other agency or department of the United States Government.  In the
104292915Sdim * event Licensee exports any such software from the United States or
105292915Sdim * re-exports any such software from a foreign destination, Licensee shall
106341825Sdim * ensure that the distribution and export/re-export of the software is in
107292915Sdim * compliance with all laws, regulations, orders, or other restrictions of the
108292915Sdim * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109292915Sdim * any of its subsidiaries will export/re-export any technical data, process,
110314564Sdim * software, or service, directly or indirectly, to any country for which the
111292915Sdim * United States government or any agency thereof requires an export license,
112292915Sdim * other governmental approval, or letter of assurance, without first obtaining
113292915Sdim * such license, approval or letter.
114292915Sdim *
115292915Sdim *****************************************************************************/
116292915Sdim
117292915Sdim
118292915Sdim#define __RSXFACE_C__
119292915Sdim
120292915Sdim#include "acpi.h"
121292915Sdim#include "acresrc.h"
122292915Sdim
123341825Sdim#define _COMPONENT          ACPI_RESOURCES
124292915Sdim        ACPI_MODULE_NAME    ("rsxface")
125292915Sdim
126344779Sdim
127292915Sdim/*******************************************************************************
128292915Sdim *
129292915Sdim * FUNCTION:    AcpiGetIrqRoutingTable
130292915Sdim *
131292915Sdim * PARAMETERS:  DeviceHandle    - a handle to the Bus device we are querying
132292915Sdim *              RetBuffer       - a pointer to a buffer to receive the
133344779Sdim *                                current resources for the device
134344779Sdim *
135341825Sdim * RETURN:      Status
136292915Sdim *
137341825Sdim * DESCRIPTION: This function is called to get the IRQ routing table for a
138344779Sdim *              specific bus.  The caller must first acquire a handle for the
139292915Sdim *              desired bus.  The routine table is placed in the buffer pointed
140341825Sdim *              to by the RetBuffer variable parameter.
141344779Sdim *
142344779Sdim *              If the function fails an appropriate status will be returned
143344779Sdim *              and the value of RetBuffer is undefined.
144344779Sdim *
145344779Sdim *              This function attempts to execute the _PRT method contained in
146344779Sdim *              the object indicated by the passed DeviceHandle.
147344779Sdim *
148344779Sdim ******************************************************************************/
149344779Sdim
150344779SdimACPI_STATUS
151344779SdimAcpiGetIrqRoutingTable  (
152344779Sdim    ACPI_HANDLE             DeviceHandle,
153344779Sdim    ACPI_BUFFER             *RetBuffer)
154292915Sdim{
155341825Sdim    ACPI_STATUS             Status;
156292915Sdim
157292915Sdim
158292915Sdim    ACPI_FUNCTION_TRACE ("AcpiGetIrqRoutingTable ");
159292915Sdim
160292915Sdim
161292915Sdim    /*
162341825Sdim     * Must have a valid handle and buffer, So we have to have a handle
163292915Sdim     * and a return buffer structure, and if there is a non-zero buffer length
164292915Sdim     * we also need a valid pointer in the buffer. If it's a zero buffer length,
165341825Sdim     * we'll be returning the needed buffer size, so keep going.
166292915Sdim     */
167292915Sdim    if (!DeviceHandle)
168292915Sdim    {
169341825Sdim        return_ACPI_STATUS (AE_BAD_PARAMETER);
170292915Sdim    }
171292915Sdim
172292915Sdim    Status = AcpiUtValidateBuffer (RetBuffer);
173292915Sdim    if (ACPI_FAILURE (Status))
174292915Sdim    {
175292915Sdim        return_ACPI_STATUS (Status);
176292915Sdim    }
177292915Sdim
178292915Sdim    Status = AcpiRsGetPrtMethodData (DeviceHandle, RetBuffer);
179292915Sdim    return_ACPI_STATUS (Status);
180292915Sdim}
181341825Sdim
182292915Sdim
183292915Sdim/*******************************************************************************
184292915Sdim *
185341825Sdim * FUNCTION:    AcpiGetCurrentResources
186341825Sdim *
187292915Sdim * PARAMETERS:  DeviceHandle    - a handle to the device object for the
188292915Sdim *                                device we are querying
189292915Sdim *              RetBuffer       - a pointer to a buffer to receive the
190292915Sdim *                                current resources for the device
191292915Sdim *
192292915Sdim * RETURN:      Status
193292915Sdim *
194292915Sdim * DESCRIPTION: This function is called to get the current resources for a
195292915Sdim *              specific device.  The caller must first acquire a handle for
196292915Sdim *              the desired device.  The resource data is placed in the buffer
197292915Sdim *              pointed to by the RetBuffer variable parameter.
198292915Sdim *
199292915Sdim *              If the function fails an appropriate status will be returned
200292915Sdim *              and the value of RetBuffer is undefined.
201314564Sdim *
202314564Sdim *              This function attempts to execute the _CRS method contained in
203353358Sdim *              the object indicated by the passed DeviceHandle.
204292915Sdim *
205341825Sdim ******************************************************************************/
206341825Sdim
207341825SdimACPI_STATUS
208341825SdimAcpiGetCurrentResources (
209341825Sdim    ACPI_HANDLE             DeviceHandle,
210292915Sdim    ACPI_BUFFER             *RetBuffer)
211292915Sdim{
212341825Sdim    ACPI_STATUS             Status;
213292915Sdim
214292915Sdim
215292915Sdim    ACPI_FUNCTION_TRACE ("AcpiGetCurrentResources");
216292915Sdim
217292915Sdim
218292915Sdim    /*
219292915Sdim     * Must have a valid handle and buffer, So we have to have a handle
220341825Sdim     * and a return buffer structure, and if there is a non-zero buffer length
221292915Sdim     * we also need a valid pointer in the buffer. If it's a zero buffer length,
222292915Sdim     * we'll be returning the needed buffer size, so keep going.
223292915Sdim     */
224292915Sdim    if (!DeviceHandle)
225292915Sdim    {
226292915Sdim        return_ACPI_STATUS (AE_BAD_PARAMETER);
227341825Sdim    }
228292915Sdim
229292915Sdim    Status = AcpiUtValidateBuffer (RetBuffer);
230292915Sdim    if (ACPI_FAILURE (Status))
231321369Sdim    {
232353358Sdim        return_ACPI_STATUS (Status);
233292915Sdim    }
234292915Sdim
235292915Sdim    Status = AcpiRsGetCrsMethodData (DeviceHandle, RetBuffer);
236292915Sdim    return_ACPI_STATUS (Status);
237353358Sdim}
238292915Sdim
239292915Sdim
240341825Sdim/*******************************************************************************
241292915Sdim *
242292915Sdim * FUNCTION:    AcpiGetPossibleResources
243353358Sdim *
244353358Sdim * PARAMETERS:  DeviceHandle    - a handle to the device object for the
245353358Sdim *                                device we are querying
246353358Sdim *              RetBuffer       - a pointer to a buffer to receive the
247292915Sdim *                                resources for the device
248292915Sdim *
249341825Sdim * RETURN:      Status
250292915Sdim *
251292915Sdim * DESCRIPTION: This function is called to get a list of the possible resources
252292915Sdim *              for a specific device.  The caller must first acquire a handle
253341825Sdim *              for the desired device.  The resource data is placed in the
254292915Sdim *              buffer pointed to by the RetBuffer variable.
255341825Sdim *
256292915Sdim *              If the function fails an appropriate status will be returned
257292915Sdim *              and the value of RetBuffer is undefined.
258292915Sdim *
259292915Sdim ******************************************************************************/
260341825Sdim
261292915SdimACPI_STATUS
262292915SdimAcpiGetPossibleResources (
263292915Sdim    ACPI_HANDLE             DeviceHandle,
264292915Sdim    ACPI_BUFFER             *RetBuffer)
265292915Sdim{
266292915Sdim    ACPI_STATUS             Status;
267292915Sdim
268292915Sdim
269341825Sdim    ACPI_FUNCTION_TRACE ("AcpiGetPossibleResources");
270353358Sdim
271292915Sdim
272341825Sdim    /*
273353358Sdim     * Must have a valid handle and buffer, So we have to have a handle
274353358Sdim     * and a return buffer structure, and if there is a non-zero buffer length
275292915Sdim     * we also need a valid pointer in the buffer. If it's a zero buffer length,
276292915Sdim     * we'll be returning the needed buffer size, so keep going.
277353358Sdim     */
278292915Sdim    if (!DeviceHandle)
279292915Sdim    {
280292915Sdim        return_ACPI_STATUS (AE_BAD_PARAMETER);
281341825Sdim    }
282292915Sdim
283292915Sdim    Status = AcpiUtValidateBuffer (RetBuffer);
284292915Sdim    if (ACPI_FAILURE (Status))
285309124Sdim    {
286309124Sdim        return_ACPI_STATUS (Status);
287309124Sdim    }
288353358Sdim
289353358Sdim    Status = AcpiRsGetPrsMethodData (DeviceHandle, RetBuffer);
290353358Sdim    return_ACPI_STATUS (Status);
291353358Sdim}
292353358Sdim
293353358Sdim
294341825Sdim/*******************************************************************************
295292915Sdim *
296353358Sdim * FUNCTION:    AcpiWalkResources
297353358Sdim *
298353358Sdim * PARAMETERS:  DeviceHandle    - a handle to the device object for the
299353358Sdim *                                device we are querying
300292915Sdim *              Path            - method name of the resources we want
301292915Sdim *                                (METHOD_NAME__CRS or METHOD_NAME__PRS)
302353358Sdim *              UserFunction    - called for each resource
303353358Sdim *              Context         - passed to UserFunction
304341825Sdim *
305292915Sdim * RETURN:      Status
306353358Sdim *
307292915Sdim * DESCRIPTION: Retrieves the current or possible resource list for the
308341825Sdim *              specified device.  The UserFunction is called once for
309292915Sdim *              each resource in the list.
310292915Sdim *
311292915Sdim ******************************************************************************/
312292915Sdim
313292915SdimACPI_STATUS
314353358SdimAcpiWalkResources (
315292915Sdim    ACPI_HANDLE                     DeviceHandle,
316292915Sdim    char                            *Path,
317341825Sdim    ACPI_WALK_RESOURCE_CALLBACK     UserFunction,
318292915Sdim    void                            *Context)
319292915Sdim{
320341825Sdim    ACPI_STATUS                 Status;
321292915Sdim    ACPI_BUFFER                 Buffer = {ACPI_ALLOCATE_BUFFER, NULL};
322292915Sdim    ACPI_RESOURCE               *Resource;
323292915Sdim
324353358Sdim
325292915Sdim    ACPI_FUNCTION_TRACE ("AcpiWalkResources");
326292915Sdim
327292915Sdim
328292915Sdim    if (!DeviceHandle ||
329292915Sdim        (ACPI_STRNCMP (Path, METHOD_NAME__CRS, sizeof (METHOD_NAME__CRS)) &&
330341825Sdim         ACPI_STRNCMP (Path, METHOD_NAME__PRS, sizeof (METHOD_NAME__PRS))))
331341825Sdim    {
332292915Sdim        return_ACPI_STATUS (AE_BAD_PARAMETER);
333292915Sdim    }
334292915Sdim
335292915Sdim    Status = AcpiRsGetMethodData (DeviceHandle, Path, &Buffer);
336292915Sdim    if (ACPI_FAILURE (Status))
337292915Sdim    {
338353358Sdim        return_ACPI_STATUS (Status);
339292915Sdim    }
340292915Sdim
341292915Sdim    Resource = (ACPI_RESOURCE *) Buffer.Pointer;
342341825Sdim    for (;;)
343292915Sdim    {
344292915Sdim        if (!Resource || Resource->Id == ACPI_RSTYPE_END_TAG)
345292915Sdim        {
346292915Sdim            break;
347292915Sdim        }
348353358Sdim
349292915Sdim        Status = UserFunction (Resource, Context);
350292915Sdim
351292915Sdim        switch (Status)
352292915Sdim        {
353292915Sdim        case AE_OK:
354292915Sdim        case AE_CTRL_DEPTH:
355341825Sdim
356353358Sdim            /* Just keep going */
357292915Sdim            Status = AE_OK;
358292915Sdim            break;
359341825Sdim
360292915Sdim        case AE_CTRL_TERMINATE:
361292915Sdim
362292915Sdim            /* Exit now, with OK stats */
363292915Sdim
364292915Sdim            Status = AE_OK;
365292915Sdim            goto Cleanup;
366292915Sdim
367292915Sdim        default:
368292915Sdim
369292915Sdim            /* All others are valid exceptions */
370292915Sdim
371292915Sdim            goto Cleanup;
372292915Sdim        }
373341825Sdim
374292915Sdim        Resource = ACPI_NEXT_RESOURCE (Resource);
375321369Sdim    }
376321369Sdim
377292915SdimCleanup:
378353358Sdim
379341825Sdim    AcpiOsFree (Buffer.Pointer);
380292915Sdim    return_ACPI_STATUS (Status);
381292915Sdim}
382292915Sdim
383353358Sdim
384292915Sdim/*******************************************************************************
385292915Sdim *
386341825Sdim * FUNCTION:    AcpiSetCurrentResources
387341825Sdim *
388341825Sdim * PARAMETERS:  DeviceHandle    - a handle to the device object for the
389341825Sdim *                                device we are changing the resources of
390341825Sdim *              InBuffer        - a pointer to a buffer containing the
391341825Sdim *                                resources to be set for the device
392341825Sdim *
393341825Sdim * RETURN:      Status
394341825Sdim *
395292915Sdim * DESCRIPTION: This function is called to set the current resources for a
396292915Sdim *              specific device.  The caller must first acquire a handle for
397292915Sdim *              the desired device.  The resource data is passed to the routine
398292915Sdim *              the buffer pointed to by the InBuffer variable.
399292915Sdim *
400292915Sdim ******************************************************************************/
401292915Sdim
402292915SdimACPI_STATUS
403292915SdimAcpiSetCurrentResources (
404292915Sdim    ACPI_HANDLE             DeviceHandle,
405292915Sdim    ACPI_BUFFER             *InBuffer)
406341825Sdim{
407292915Sdim    ACPI_STATUS             Status;
408292915Sdim
409292915Sdim
410292915Sdim    ACPI_FUNCTION_TRACE ("AcpiSetCurrentResources");
411292915Sdim
412292915Sdim
413292915Sdim    /*
414292915Sdim     * Must have a valid handle and buffer
415292915Sdim     */
416292915Sdim    if ((!DeviceHandle)       ||
417292915Sdim        (!InBuffer)           ||
418292915Sdim        (!InBuffer->Pointer)  ||
419292915Sdim        (!InBuffer->Length))
420341825Sdim    {
421292915Sdim        return_ACPI_STATUS (AE_BAD_PARAMETER);
422292915Sdim    }
423292915Sdim
424292915Sdim    Status = AcpiRsSetSrsMethodData (DeviceHandle, InBuffer);
425292915Sdim    return_ACPI_STATUS (Status);
426292915Sdim}
427292915Sdim
428292915Sdim
429292915Sdim#define ACPI_COPY_FIELD(Out, In, Field)  ((Out)->Field = (In)->Field)
430292915Sdim#define ACPI_COPY_ADDRESS(Out, In)                      \
431292915Sdim    ACPI_COPY_FIELD(Out, In, ResourceType);              \
432292915Sdim    ACPI_COPY_FIELD(Out, In, ProducerConsumer);          \
433292915Sdim    ACPI_COPY_FIELD(Out, In, Decode);                    \
434292915Sdim    ACPI_COPY_FIELD(Out, In, MinAddressFixed);           \
435292915Sdim    ACPI_COPY_FIELD(Out, In, MaxAddressFixed);           \
436292915Sdim    ACPI_COPY_FIELD(Out, In, Attribute);                 \
437341825Sdim    ACPI_COPY_FIELD(Out, In, Granularity);               \
438292915Sdim    ACPI_COPY_FIELD(Out, In, MinAddressRange);           \
439341825Sdim    ACPI_COPY_FIELD(Out, In, MaxAddressRange);           \
440292915Sdim    ACPI_COPY_FIELD(Out, In, AddressTranslationOffset);  \
441292915Sdim    ACPI_COPY_FIELD(Out, In, AddressLength);             \
442292915Sdim    ACPI_COPY_FIELD(Out, In, ResourceSource);
443341825Sdim
444292915Sdim/******************************************************************************
445292915Sdim *
446292915Sdim * FUNCTION:    AcpiResourceToAddress64
447341825Sdim *
448341825Sdim * PARAMETERS:  resource                - Pointer to a resource
449292915Sdim *              out                     - Pointer to the users's return
450292915Sdim *                                        buffer (a struct
451292915Sdim *                                        acpi_resource_address64)
452292915Sdim *
453341825Sdim * RETURN:      Status
454292915Sdim *
455292915Sdim * DESCRIPTION: If the resource is an address16, address32, or address64,
456292915Sdim *              copy it to the address64 return buffer.  This saves the
457292915Sdim *              caller from having to duplicate code for different-sized
458292915Sdim *              addresses.
459292915Sdim *
460292915Sdim ******************************************************************************/
461292915Sdim
462292915SdimACPI_STATUS
463292915SdimAcpiResourceToAddress64 (
464292915Sdim    ACPI_RESOURCE               *Resource,
465292915Sdim    ACPI_RESOURCE_ADDRESS64     *Out)
466341825Sdim{
467292915Sdim    ACPI_RESOURCE_ADDRESS16     *Address16;
468292915Sdim    ACPI_RESOURCE_ADDRESS32     *Address32;
469292915Sdim
470309124Sdim
471292915Sdim    switch (Resource->Id) {
472292915Sdim    case ACPI_RSTYPE_ADDRESS16:
473292915Sdim
474292915Sdim        Address16 = (ACPI_RESOURCE_ADDRESS16 *) &Resource->Data;
475314564Sdim        ACPI_COPY_ADDRESS(Out, Address16);
476292915Sdim        break;
477292915Sdim
478292915Sdim
479292915Sdim    case ACPI_RSTYPE_ADDRESS32:
480292915Sdim
481292915Sdim        Address32 = (ACPI_RESOURCE_ADDRESS32 *) &Resource->Data;
482292915Sdim        ACPI_COPY_ADDRESS(Out, Address32);
483292915Sdim        break;
484292915Sdim
485292915Sdim
486292915Sdim    case ACPI_RSTYPE_ADDRESS64:
487292915Sdim
488292915Sdim        /* Simple copy for 64 bit source */
489292915Sdim
490292915Sdim        ACPI_MEMCPY (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64));
491292915Sdim        break;
492292915Sdim
493341825Sdim
494341825Sdim    default:
495341825Sdim        return (AE_BAD_PARAMETER);
496292915Sdim    }
497292915Sdim
498292915Sdim    return (AE_OK);
499341825Sdim}
500292915Sdim