Subversion Repositories Kolibri OS

Rev

Rev 1498 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
1
/******************************************************************************
1
/******************************************************************************
2
 *
2
 *
3
 * Module Name: dmextern - Support for External() ASL statements
3
 * Module Name: dmextern - Support for External() ASL statements
4
 *
4
 *
5
 *****************************************************************************/
5
 *****************************************************************************/
6
 
6
 
7
/******************************************************************************
7
/******************************************************************************
8
 *
8
 *
9
 * 1. Copyright Notice
9
 * 1. Copyright Notice
10
 *
10
 *
11
 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
11
 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
12
 * All rights reserved.
12
 * All rights reserved.
13
 *
13
 *
14
 * 2. License
14
 * 2. License
15
 *
15
 *
16
 * 2.1. This is your license from Intel Corp. under its intellectual property
16
 * 2.1. This is your license from Intel Corp. under its intellectual property
17
 * rights.  You may have additional license terms from the party that provided
17
 * rights.  You may have additional license terms from the party that provided
18
 * you this software, covering your right to use that party's intellectual
18
 * you this software, covering your right to use that party's intellectual
19
 * property rights.
19
 * property rights.
20
 *
20
 *
21
 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
21
 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22
 * copy of the source code appearing in this file ("Covered Code") an
22
 * copy of the source code appearing in this file ("Covered Code") an
23
 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
23
 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24
 * base code distributed originally by Intel ("Original Intel Code") to copy,
24
 * base code distributed originally by Intel ("Original Intel Code") to copy,
25
 * make derivatives, distribute, use and display any portion of the Covered
25
 * make derivatives, distribute, use and display any portion of the Covered
26
 * Code in any form, with the right to sublicense such rights; and
26
 * Code in any form, with the right to sublicense such rights; and
27
 *
27
 *
28
 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
28
 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29
 * license (with the right to sublicense), under only those claims of Intel
29
 * license (with the right to sublicense), under only those claims of Intel
30
 * patents that are infringed by the Original Intel Code, to make, use, sell,
30
 * patents that are infringed by the Original Intel Code, to make, use, sell,
31
 * offer to sell, and import the Covered Code and derivative works thereof
31
 * offer to sell, and import the Covered Code and derivative works thereof
32
 * solely to the minimum extent necessary to exercise the above copyright
32
 * solely to the minimum extent necessary to exercise the above copyright
33
 * license, and in no event shall the patent license extend to any additions
33
 * license, and in no event shall the patent license extend to any additions
34
 * to or modifications of the Original Intel Code.  No other license or right
34
 * to or modifications of the Original Intel Code.  No other license or right
35
 * is granted directly or by implication, estoppel or otherwise;
35
 * is granted directly or by implication, estoppel or otherwise;
36
 *
36
 *
37
 * The above copyright and patent license is granted only if the following
37
 * The above copyright and patent license is granted only if the following
38
 * conditions are met:
38
 * conditions are met:
39
 *
39
 *
40
 * 3. Conditions
40
 * 3. Conditions
41
 *
41
 *
42
 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
42
 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43
 * Redistribution of source code of any substantial portion of the Covered
43
 * Redistribution of source code of any substantial portion of the Covered
44
 * Code or modification with rights to further distribute source must include
44
 * Code or modification with rights to further distribute source must include
45
 * the above Copyright Notice, the above License, this list of Conditions,
45
 * the above Copyright Notice, the above License, this list of Conditions,
46
 * and the following Disclaimer and Export Compliance provision.  In addition,
46
 * and the following Disclaimer and Export Compliance provision.  In addition,
47
 * Licensee must cause all Covered Code to which Licensee contributes to
47
 * Licensee must cause all Covered Code to which Licensee contributes to
48
 * contain a file documenting the changes Licensee made to create that Covered
48
 * contain a file documenting the changes Licensee made to create that Covered
49
 * Code and the date of any change.  Licensee must include in that file the
49
 * Code and the date of any change.  Licensee must include in that file the
50
 * documentation of any changes made by any predecessor Licensee.  Licensee
50
 * documentation of any changes made by any predecessor Licensee.  Licensee
51
 * must include a prominent statement that the modification is derived,
51
 * must include a prominent statement that the modification is derived,
52
 * directly or indirectly, from Original Intel Code.
52
 * directly or indirectly, from Original Intel Code.
53
 *
53
 *
54
 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
54
 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55
 * Redistribution of source code of any substantial portion of the Covered
55
 * Redistribution of source code of any substantial portion of the Covered
56
 * Code or modification without rights to further distribute source must
56
 * Code or modification without rights to further distribute source must
57
 * include the following Disclaimer and Export Compliance provision in the
57
 * include the following Disclaimer and Export Compliance provision in the
58
 * documentation and/or other materials provided with distribution.  In
58
 * documentation and/or other materials provided with distribution.  In
59
 * addition, Licensee may not authorize further sublicense of source of any
59
 * addition, Licensee may not authorize further sublicense of source of any
60
 * portion of the Covered Code, and must include terms to the effect that the
60
 * portion of the Covered Code, and must include terms to the effect that the
61
 * license from Licensee to its licensee is limited to the intellectual
61
 * license from Licensee to its licensee is limited to the intellectual
62
 * property embodied in the software Licensee provides to its licensee, and
62
 * property embodied in the software Licensee provides to its licensee, and
63
 * not to intellectual property embodied in modifications its licensee may
63
 * not to intellectual property embodied in modifications its licensee may
64
 * make.
64
 * make.
65
 *
65
 *
66
 * 3.3. Redistribution of Executable. Redistribution in executable form of any
66
 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67
 * substantial portion of the Covered Code or modification must reproduce the
67
 * substantial portion of the Covered Code or modification must reproduce the
68
 * above Copyright Notice, and the following Disclaimer and Export Compliance
68
 * above Copyright Notice, and the following Disclaimer and Export Compliance
69
 * provision in the documentation and/or other materials provided with the
69
 * provision in the documentation and/or other materials provided with the
70
 * distribution.
70
 * distribution.
71
 *
71
 *
72
 * 3.4. Intel retains all right, title, and interest in and to the Original
72
 * 3.4. Intel retains all right, title, and interest in and to the Original
73
 * Intel Code.
73
 * Intel Code.
74
 *
74
 *
75
 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
75
 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76
 * Intel shall be used in advertising or otherwise to promote the sale, use or
76
 * Intel shall be used in advertising or otherwise to promote the sale, use or
77
 * other dealings in products derived from or relating to the Covered Code
77
 * other dealings in products derived from or relating to the Covered Code
78
 * without prior written authorization from Intel.
78
 * without prior written authorization from Intel.
79
 *
79
 *
80
 * 4. Disclaimer and Export Compliance
80
 * 4. Disclaimer and Export Compliance
81
 *
81
 *
82
 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
82
 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83
 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
83
 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84
 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
84
 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
85
 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
85
 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
86
 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
86
 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
87
 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
87
 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88
 * PARTICULAR PURPOSE.
88
 * PARTICULAR PURPOSE.
89
 *
89
 *
90
 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
90
 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91
 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
91
 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92
 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
92
 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93
 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
93
 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94
 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
94
 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95
 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
95
 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
96
 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
96
 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97
 * LIMITED REMEDY.
97
 * LIMITED REMEDY.
98
 *
98
 *
99
 * 4.3. Licensee shall not export, either directly or indirectly, any of this
99
 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100
 * software or system incorporating such software without first obtaining any
100
 * software or system incorporating such software without first obtaining any
101
 * required license or other approval from the U. S. Department of Commerce or
101
 * required license or other approval from the U. S. Department of Commerce or
102
 * any other agency or department of the United States Government.  In the
102
 * any other agency or department of the United States Government.  In the
103
 * event Licensee exports any such software from the United States or
103
 * event Licensee exports any such software from the United States or
104
 * re-exports any such software from a foreign destination, Licensee shall
104
 * re-exports any such software from a foreign destination, Licensee shall
105
 * ensure that the distribution and export/re-export of the software is in
105
 * ensure that the distribution and export/re-export of the software is in
106
 * compliance with all laws, regulations, orders, or other restrictions of the
106
 * compliance with all laws, regulations, orders, or other restrictions of the
107
 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
107
 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108
 * any of its subsidiaries will export/re-export any technical data, process,
108
 * any of its subsidiaries will export/re-export any technical data, process,
109
 * software, or service, directly or indirectly, to any country for which the
109
 * software, or service, directly or indirectly, to any country for which the
110
 * United States government or any agency thereof requires an export license,
110
 * United States government or any agency thereof requires an export license,
111
 * other governmental approval, or letter of assurance, without first obtaining
111
 * other governmental approval, or letter of assurance, without first obtaining
112
 * such license, approval or letter.
112
 * such license, approval or letter.
113
 *
113
 *
114
 *****************************************************************************/
114
 *****************************************************************************/
115
 
115
 
116
#include "acpi.h"
116
#include "acpi.h"
117
#include "accommon.h"
117
#include "accommon.h"
118
#include "amlcode.h"
118
#include "amlcode.h"
119
#include "acnamesp.h"
119
#include "acnamesp.h"
120
#include "acdisasm.h"
120
#include "acdisasm.h"
121
 
121
 
122
 
122
 
123
/*
123
/*
124
 * This module is used for application-level code (iASL disassembler) only.
124
 * This module is used for application-level code (iASL disassembler) only.
125
 *
125
 *
126
 * It contains the code to create and emit any necessary External() ASL
126
 * It contains the code to create and emit any necessary External() ASL
127
 * statements for the module being disassembled.
127
 * statements for the module being disassembled.
128
 */
128
 */
129
#define _COMPONENT          ACPI_CA_DISASSEMBLER
129
#define _COMPONENT          ACPI_CA_DISASSEMBLER
130
        ACPI_MODULE_NAME    ("dmextern")
130
        ACPI_MODULE_NAME    ("dmextern")
131
 
131
 
132
 
132
 
133
/*
133
/*
134
 * This table maps ACPI_OBJECT_TYPEs to the corresponding ASL
134
 * This table maps ACPI_OBJECT_TYPEs to the corresponding ASL
135
 * ObjectTypeKeyword. Used to generate typed external declarations
135
 * ObjectTypeKeyword. Used to generate typed external declarations
136
 */
136
 */
137
static const char           *AcpiGbl_DmTypeNames[] =
137
static const char           *AcpiGbl_DmTypeNames[] =
138
{
138
{
139
    /* 00 */ "",                    /* Type ANY */
139
    /* 00 */ "",                    /* Type ANY */
140
    /* 01 */ ", IntObj",
140
    /* 01 */ ", IntObj",
141
    /* 02 */ ", StrObj",
141
    /* 02 */ ", StrObj",
142
    /* 03 */ ", BuffObj",
142
    /* 03 */ ", BuffObj",
143
    /* 04 */ ", PkgObj",
143
    /* 04 */ ", PkgObj",
144
    /* 05 */ ", FieldUnitObj",
144
    /* 05 */ ", FieldUnitObj",
145
    /* 06 */ ", DeviceObj",
145
    /* 06 */ ", DeviceObj",
146
    /* 07 */ ", EventObj",
146
    /* 07 */ ", EventObj",
147
    /* 08 */ ", MethodObj",
147
    /* 08 */ ", MethodObj",
148
    /* 09 */ ", MutexObj",
148
    /* 09 */ ", MutexObj",
149
    /* 10 */ ", OpRegionObj",
149
    /* 10 */ ", OpRegionObj",
150
    /* 11 */ ", PowerResObj",
150
    /* 11 */ ", PowerResObj",
151
    /* 12 */ ", ProcessorObj",
151
    /* 12 */ ", ProcessorObj",
152
    /* 13 */ ", ThermalZoneObj",
152
    /* 13 */ ", ThermalZoneObj",
153
    /* 14 */ ", BuffFieldObj",
153
    /* 14 */ ", BuffFieldObj",
154
    /* 15 */ ", DDBHandleObj",
154
    /* 15 */ ", DDBHandleObj",
155
    /* 16 */ "",                    /* Debug object */
155
    /* 16 */ "",                    /* Debug object */
156
    /* 17 */ ", FieldUnitObj",
156
    /* 17 */ ", FieldUnitObj",
157
    /* 18 */ ", FieldUnitObj",
157
    /* 18 */ ", FieldUnitObj",
158
    /* 19 */ ", FieldUnitObj"
158
    /* 19 */ ", FieldUnitObj"
159
};
159
};
160
 
160
 
161
 
161
 
162
/* Local prototypes */
162
/* Local prototypes */
163
 
163
 
164
static const char *
164
static const char *
165
AcpiDmGetObjectTypeName (
165
AcpiDmGetObjectTypeName (
166
    ACPI_OBJECT_TYPE        Type);
166
    ACPI_OBJECT_TYPE        Type);
167
 
167
 
168
static char *
168
static char *
169
AcpiDmNormalizeParentPrefix (
169
AcpiDmNormalizeParentPrefix (
170
    ACPI_PARSE_OBJECT       *Op,
170
    ACPI_PARSE_OBJECT       *Op,
171
    char                    *Path);
171
    char                    *Path);
172
 
172
 
173
 
173
 
174
/*******************************************************************************
174
/*******************************************************************************
175
 *
175
 *
176
 * FUNCTION:    AcpiDmGetObjectTypeName
176
 * FUNCTION:    AcpiDmGetObjectTypeName
177
 *
177
 *
178
 * PARAMETERS:  Type                - An ACPI_OBJECT_TYPE
178
 * PARAMETERS:  Type                - An ACPI_OBJECT_TYPE
179
 *
179
 *
180
 * RETURN:      Pointer to a string
180
 * RETURN:      Pointer to a string
181
 *
181
 *
182
 * DESCRIPTION: Map an object type to the ASL object type string.
182
 * DESCRIPTION: Map an object type to the ASL object type string.
183
 *
183
 *
184
 ******************************************************************************/
184
 ******************************************************************************/
185
 
185
 
186
static const char *
186
static const char *
187
AcpiDmGetObjectTypeName (
187
AcpiDmGetObjectTypeName (
188
    ACPI_OBJECT_TYPE        Type)
188
    ACPI_OBJECT_TYPE        Type)
189
{
189
{
190
 
190
 
191
    if (Type == ACPI_TYPE_LOCAL_SCOPE)
191
    if (Type == ACPI_TYPE_LOCAL_SCOPE)
192
    {
192
    {
193
        Type = ACPI_TYPE_DEVICE;
193
        Type = ACPI_TYPE_DEVICE;
194
    }
194
    }
195
 
195
 
196
    else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD)
196
    else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD)
197
    {
197
    {
198
        return ("");
198
        return ("");
199
    }
199
    }
200
 
200
 
201
    return (AcpiGbl_DmTypeNames[Type]);
201
    return (AcpiGbl_DmTypeNames[Type]);
202
}
202
}
203
 
203
 
204
 
204
 
205
/*******************************************************************************
205
/*******************************************************************************
206
 *
206
 *
207
 * FUNCTION:    AcpiDmNormalizeParentPrefix
207
 * FUNCTION:    AcpiDmNormalizeParentPrefix
208
 *
208
 *
209
 * PARAMETERS:  Op                  - Parse op
209
 * PARAMETERS:  Op                  - Parse op
210
 *              Path                - Path with parent prefix
210
 *              Path                - Path with parent prefix
211
 *
211
 *
212
 * RETURN:      The full pathname to the object (from the namespace root)
212
 * RETURN:      The full pathname to the object (from the namespace root)
213
 *
213
 *
214
 * DESCRIPTION: Returns the full pathname of a path with parent prefix
214
 * DESCRIPTION: Returns the full pathname of a path with parent prefix
215
 *              The caller must free the fullpath returned.
215
 *              The caller must free the fullpath returned.
216
 *
216
 *
217
 ******************************************************************************/
217
 ******************************************************************************/
218
 
218
 
219
static char *
219
static char *
220
AcpiDmNormalizeParentPrefix (
220
AcpiDmNormalizeParentPrefix (
221
    ACPI_PARSE_OBJECT       *Op,
221
    ACPI_PARSE_OBJECT       *Op,
222
    char                    *Path)
222
    char                    *Path)
223
{
223
{
224
    ACPI_NAMESPACE_NODE     *Node;
224
    ACPI_NAMESPACE_NODE     *Node;
225
    char                    *Fullpath;
225
    char                    *Fullpath;
226
    char                    *ParentPath;
226
    char                    *ParentPath;
227
    ACPI_SIZE               Length;
227
    ACPI_SIZE               Length;
228
 
228
 
229
 
229
 
230
    /* Search upwards in the parse tree until we reach a namespace node */
230
    /* Search upwards in the parse tree until we reach a namespace node */
231
 
231
 
232
    while (Op)
232
    while (Op)
233
    {
233
    {
234
        if (Op->Common.Node)
234
        if (Op->Common.Node)
235
        {
235
        {
236
            break;
236
            break;
237
        }
237
        }
238
 
238
 
239
        Op = Op->Common.Parent;
239
        Op = Op->Common.Parent;
240
    }
240
    }
241
 
241
 
242
    if (!Op)
242
    if (!Op)
243
    {
243
    {
244
        return (NULL);
244
        return (NULL);
245
    }
245
    }
246
 
246
 
247
    /*
247
    /*
248
     * Find the actual parent node for the reference:
248
     * Find the actual parent node for the reference:
249
     * Remove all carat prefixes from the input path.
249
     * Remove all carat prefixes from the input path.
250
     * There may be multiple parent prefixes (For example, ^^^M000)
250
     * There may be multiple parent prefixes (For example, ^^^M000)
251
     */
251
     */
252
    Node = Op->Common.Node;
252
    Node = Op->Common.Node;
253
    while (Node && (*Path == (UINT8) AML_PARENT_PREFIX))
253
    while (Node && (*Path == (UINT8) AML_PARENT_PREFIX))
254
    {
254
    {
255
        Node = Node->Parent;
255
        Node = Node->Parent;
256
        Path++;
256
        Path++;
257
    }
257
    }
258
 
258
 
259
    if (!Node)
259
    if (!Node)
260
    {
260
    {
261
        return (NULL);
261
        return (NULL);
262
    }
262
    }
263
 
263
 
264
    /* Get the full pathname for the parent node */
264
    /* Get the full pathname for the parent node */
265
 
265
 
266
    ParentPath = AcpiNsGetExternalPathname (Node);
266
    ParentPath = AcpiNsGetExternalPathname (Node);
267
    if (!ParentPath)
267
    if (!ParentPath)
268
    {
268
    {
269
        return (NULL);
269
        return (NULL);
270
    }
270
    }
271
 
271
 
272
    Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1);
272
    Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1);
273
    if (ParentPath[1])
273
    if (ParentPath[1])
274
    {
274
    {
275
        /*
275
        /*
276
         * If ParentPath is not just a simple '\', increment the length
276
         * If ParentPath is not just a simple '\', increment the length
277
         * for the required dot separator (ParentPath.Path)
277
         * for the required dot separator (ParentPath.Path)
278
         */
278
         */
279
        Length++;
279
        Length++;
280
    }
280
    }
281
 
281
 
282
    Fullpath = ACPI_ALLOCATE_ZEROED (Length);
282
    Fullpath = ACPI_ALLOCATE_ZEROED (Length);
283
    if (!Fullpath)
283
    if (!Fullpath)
284
    {
284
    {
285
        goto Cleanup;
285
        goto Cleanup;
286
    }
286
    }
287
 
287
 
288
    /*
288
    /*
289
     * Concatenate parent fullpath and path. For example,
289
     * Concatenate parent fullpath and path. For example,
290
     * parent fullpath "\_SB_", Path "^INIT", Fullpath "\_SB_.INIT"
290
     * parent fullpath "\_SB_", Path "^INIT", Fullpath "\_SB_.INIT"
291
     *
291
     *
292
     * Copy the parent path
292
     * Copy the parent path
293
     */
293
     */
294
    ACPI_STRCAT (Fullpath, ParentPath);
294
    ACPI_STRCAT (Fullpath, ParentPath);
295
 
295
 
296
    /* Add dot separator (don't need dot if parent fullpath is a single "\") */
296
    /* Add dot separator (don't need dot if parent fullpath is a single "\") */
297
 
297
 
298
    if (ParentPath[1])
298
    if (ParentPath[1])
299
    {
299
    {
300
        ACPI_STRCAT (Fullpath, ".");
300
        ACPI_STRCAT (Fullpath, ".");
301
    }
301
    }
302
 
302
 
303
    /* Copy child path (carat parent prefix(es) were skipped above) */
303
    /* Copy child path (carat parent prefix(es) were skipped above) */
304
 
304
 
305
    ACPI_STRCAT (Fullpath, Path);
305
    ACPI_STRCAT (Fullpath, Path);
306
 
306
 
307
Cleanup:
307
Cleanup:
308
    ACPI_FREE (ParentPath);
308
    ACPI_FREE (ParentPath);
309
    return (Fullpath);
309
    return (Fullpath);
310
}
310
}
-
 
311
 
-
 
312
 
-
 
313
/*******************************************************************************
-
 
314
 *
-
 
315
 * FUNCTION:    AcpiDmAddToExternalFileList
-
 
316
 *
-
 
317
 * PARAMETERS:  PathList            - Single path or list separated by comma
-
 
318
 *
-
 
319
 * RETURN:      None
-
 
320
 *
-
 
321
 * DESCRIPTION: Add external files to global list
-
 
322
 *
-
 
323
 ******************************************************************************/
-
 
324
 
-
 
325
ACPI_STATUS
-
 
326
AcpiDmAddToExternalFileList (
-
 
327
    char                    *PathList)
-
 
328
{
-
 
329
    ACPI_EXTERNAL_FILE      *ExternalFile;
-
 
330
    char                    *Path;
-
 
331
    char                    *TmpPath;
-
 
332
 
-
 
333
 
-
 
334
    if (!PathList)
-
 
335
    {
-
 
336
        return (AE_OK);
-
 
337
    }
-
 
338
 
-
 
339
    Path = strtok (PathList, ",");
-
 
340
 
-
 
341
    while (Path)
-
 
342
    {
-
 
343
        TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1);
-
 
344
        if (!TmpPath)
-
 
345
        {
-
 
346
            return (AE_NO_MEMORY);
-
 
347
        }
-
 
348
 
-
 
349
        ACPI_STRCPY (TmpPath, Path);
-
 
350
 
-
 
351
        ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
-
 
352
        if (!ExternalFile)
-
 
353
        {
-
 
354
            ACPI_FREE (TmpPath);
-
 
355
            return (AE_NO_MEMORY);
-
 
356
        }
-
 
357
 
-
 
358
        ExternalFile->Path = TmpPath;
-
 
359
 
-
 
360
        if (AcpiGbl_ExternalFileList)
-
 
361
        {
-
 
362
            ExternalFile->Next = AcpiGbl_ExternalFileList;
-
 
363
        }
-
 
364
 
-
 
365
        AcpiGbl_ExternalFileList = ExternalFile;
-
 
366
        Path = strtok (NULL, ",");
-
 
367
    }
-
 
368
 
-
 
369
    return (AE_OK);
-
 
370
}
-
 
371
 
-
 
372
 
-
 
373
/*******************************************************************************
-
 
374
 *
-
 
375
 * FUNCTION:    AcpiDmClearExternalFileList
-
 
376
 *
-
 
377
 * PARAMETERS:  None
-
 
378
 *
-
 
379
 * RETURN:      None
-
 
380
 *
-
 
381
 * DESCRIPTION: Clear the external file list
-
 
382
 *
-
 
383
 ******************************************************************************/
-
 
384
 
-
 
385
void
-
 
386
AcpiDmClearExternalFileList (
-
 
387
    void)
-
 
388
{
-
 
389
    ACPI_EXTERNAL_FILE      *NextExternal;
-
 
390
 
-
 
391
 
-
 
392
    while (AcpiGbl_ExternalFileList)
-
 
393
    {
-
 
394
        NextExternal = AcpiGbl_ExternalFileList->Next;
-
 
395
        ACPI_FREE (AcpiGbl_ExternalFileList->Path);
-
 
396
        ACPI_FREE (AcpiGbl_ExternalFileList);
-
 
397
        AcpiGbl_ExternalFileList = NextExternal;
-
 
398
    }
-
 
399
}
311
 
400
 
312
 
401
 
313
/*******************************************************************************
402
/*******************************************************************************
314
 *
403
 *
315
 * FUNCTION:    AcpiDmAddToExternalList
404
 * FUNCTION:    AcpiDmAddToExternalList
316
 *
405
 *
317
 * PARAMETERS:  Op                  - Current parser Op
406
 * PARAMETERS:  Op                  - Current parser Op
318
 *              Path                - Internal (AML) path to the object
407
 *              Path                - Internal (AML) path to the object
319
 *              Type                - ACPI object type to be added
408
 *              Type                - ACPI object type to be added
320
 *              Value               - Arg count if adding a Method object
409
 *              Value               - Arg count if adding a Method object
321
 *
410
 *
322
 * RETURN:      None
411
 * RETURN:      None
323
 *
412
 *
324
 * DESCRIPTION: Insert a new name into the global list of Externals which
413
 * DESCRIPTION: Insert a new name into the global list of Externals which
325
 *              will in turn be later emitted as an External() declaration
414
 *              will in turn be later emitted as an External() declaration
326
 *              in the disassembled output.
415
 *              in the disassembled output.
327
 *
416
 *
328
 ******************************************************************************/
417
 ******************************************************************************/
329
 
418
 
330
void
419
void
331
AcpiDmAddToExternalList (
420
AcpiDmAddToExternalList (
332
    ACPI_PARSE_OBJECT       *Op,
421
    ACPI_PARSE_OBJECT       *Op,
333
    char                    *Path,
422
    char                    *Path,
334
    UINT8                   Type,
423
    UINT8                   Type,
335
    UINT32                  Value)
424
    UINT32                  Value)
336
{
425
{
337
    char                    *ExternalPath;
426
    char                    *ExternalPath;
338
    char                    *Fullpath = NULL;
427
    char                    *Fullpath = NULL;
339
    ACPI_EXTERNAL_LIST      *NewExternal;
428
    ACPI_EXTERNAL_LIST      *NewExternal;
340
    ACPI_EXTERNAL_LIST      *NextExternal;
429
    ACPI_EXTERNAL_LIST      *NextExternal;
341
    ACPI_EXTERNAL_LIST      *PrevExternal = NULL;
430
    ACPI_EXTERNAL_LIST      *PrevExternal = NULL;
342
    ACPI_STATUS             Status;
431
    ACPI_STATUS             Status;
343
 
432
 
344
 
433
 
345
    if (!Path)
434
    if (!Path)
346
    {
435
    {
347
        return;
436
        return;
348
    }
437
    }
349
 
438
 
350
    /* Externalize the ACPI path */
439
    /* Externalize the ACPI path */
351
 
440
 
352
    Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
441
    Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
353
                NULL, &ExternalPath);
442
                NULL, &ExternalPath);
354
    if (ACPI_FAILURE (Status))
443
    if (ACPI_FAILURE (Status))
355
    {
444
    {
356
        return;
445
        return;
357
    }
446
    }
358
 
447
 
359
    /* Get the full pathname from root if "Path" has a parent prefix */
448
    /* Get the full pathname from root if "Path" has a parent prefix */
360
 
449
 
361
    if (*Path == (UINT8) AML_PARENT_PREFIX)
450
    if (*Path == (UINT8) AML_PARENT_PREFIX)
362
    {
451
    {
363
        Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
452
        Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
364
        if (Fullpath)
453
        if (Fullpath)
365
        {
454
        {
366
            /* Set new external path */
455
            /* Set new external path */
367
 
456
 
368
            ACPI_FREE (ExternalPath);
457
            ACPI_FREE (ExternalPath);
369
            ExternalPath = Fullpath;
458
            ExternalPath = Fullpath;
370
        }
459
        }
371
    }
460
    }
372
 
461
 
373
    /* Check all existing externals to ensure no duplicates */
462
    /* Check all existing externals to ensure no duplicates */
374
 
463
 
375
    NextExternal = AcpiGbl_ExternalList;
464
    NextExternal = AcpiGbl_ExternalList;
376
    while (NextExternal)
465
    while (NextExternal)
377
    {
466
    {
378
        if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
467
        if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
379
        {
468
        {
380
            /* Duplicate method, check that the Value (ArgCount) is the same */
469
            /* Duplicate method, check that the Value (ArgCount) is the same */
381
 
470
 
382
            if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
471
            if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
383
                (NextExternal->Value != Value))
472
                (NextExternal->Value != Value))
384
            {
473
            {
385
                ACPI_ERROR ((AE_INFO,
474
                ACPI_ERROR ((AE_INFO,
386
                    "Argument count mismatch for method %s %u %u",
475
                    "Argument count mismatch for method %s %u %u",
387
                    NextExternal->Path, NextExternal->Value, Value));
476
                    NextExternal->Path, NextExternal->Value, Value));
388
            }
477
            }
389
 
478
 
390
            /* Allow upgrade of type from ANY */
479
            /* Allow upgrade of type from ANY */
391
 
480
 
392
            else if (NextExternal->Type == ACPI_TYPE_ANY)
481
            else if (NextExternal->Type == ACPI_TYPE_ANY)
393
            {
482
            {
394
                NextExternal->Type = Type;
483
                NextExternal->Type = Type;
395
                NextExternal->Value = Value;
484
                NextExternal->Value = Value;
396
            }
485
            }
397
 
486
 
398
            ACPI_FREE (ExternalPath);
487
            ACPI_FREE (ExternalPath);
399
            return;
488
            return;
400
        }
489
        }
401
 
490
 
402
        NextExternal = NextExternal->Next;
491
        NextExternal = NextExternal->Next;
403
    }
492
    }
404
 
493
 
405
    /* Allocate and init a new External() descriptor */
494
    /* Allocate and init a new External() descriptor */
406
 
495
 
407
    NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
496
    NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
408
    if (!NewExternal)
497
    if (!NewExternal)
409
    {
498
    {
410
        ACPI_FREE (ExternalPath);
499
        ACPI_FREE (ExternalPath);
411
        return;
500
        return;
412
    }
501
    }
413
 
502
 
414
    NewExternal->Path = ExternalPath;
503
    NewExternal->Path = ExternalPath;
415
    NewExternal->Type = Type;
504
    NewExternal->Type = Type;
416
    NewExternal->Value = Value;
505
    NewExternal->Value = Value;
417
    NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
506
    NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
418
 
507
 
419
    /* Was the external path with parent prefix normalized to a fullpath? */
508
    /* Was the external path with parent prefix normalized to a fullpath? */
420
 
509
 
421
    if (Fullpath == ExternalPath)
510
    if (Fullpath == ExternalPath)
422
    {
511
    {
423
        /* Get new internal path */
512
        /* Get new internal path */
424
 
513
 
425
        Status = AcpiNsInternalizeName (ExternalPath, &Path);
514
        Status = AcpiNsInternalizeName (ExternalPath, &Path);
426
        if (ACPI_FAILURE (Status))
515
        if (ACPI_FAILURE (Status))
427
        {
516
        {
428
            ACPI_FREE (ExternalPath);
517
            ACPI_FREE (ExternalPath);
429
            ACPI_FREE (NewExternal);
518
            ACPI_FREE (NewExternal);
430
            return;
519
            return;
431
        }
520
        }
432
 
521
 
433
        /* Set flag to indicate External->InternalPath need to be freed */
522
        /* Set flag to indicate External->InternalPath need to be freed */
434
 
523
 
435
        NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
524
        NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
436
    }
525
    }
437
 
526
 
438
    NewExternal->InternalPath = Path;
527
    NewExternal->InternalPath = Path;
439
 
528
 
440
    /* Link the new descriptor into the global list, ordered by string length */
529
    /* Link the new descriptor into the global list, ordered by string length */
441
 
530
 
442
    NextExternal = AcpiGbl_ExternalList;
531
    NextExternal = AcpiGbl_ExternalList;
443
    while (NextExternal)
532
    while (NextExternal)
444
    {
533
    {
445
        if (NewExternal->Length <= NextExternal->Length)
534
        if (NewExternal->Length <= NextExternal->Length)
446
        {
535
        {
447
            if (PrevExternal)
536
            if (PrevExternal)
448
            {
537
            {
449
                PrevExternal->Next = NewExternal;
538
                PrevExternal->Next = NewExternal;
450
            }
539
            }
451
            else
540
            else
452
            {
541
            {
453
                AcpiGbl_ExternalList = NewExternal;
542
                AcpiGbl_ExternalList = NewExternal;
454
            }
543
            }
455
 
544
 
456
            NewExternal->Next = NextExternal;
545
            NewExternal->Next = NextExternal;
457
            return;
546
            return;
458
        }
547
        }
459
 
548
 
460
        PrevExternal = NextExternal;
549
        PrevExternal = NextExternal;
461
        NextExternal = NextExternal->Next;
550
        NextExternal = NextExternal->Next;
462
    }
551
    }
463
 
552
 
464
    if (PrevExternal)
553
    if (PrevExternal)
465
    {
554
    {
466
        PrevExternal->Next = NewExternal;
555
        PrevExternal->Next = NewExternal;
467
    }
556
    }
468
    else
557
    else
469
    {
558
    {
470
        AcpiGbl_ExternalList = NewExternal;
559
        AcpiGbl_ExternalList = NewExternal;
471
    }
560
    }
472
}
561
}
473
 
562
 
474
 
563
 
475
/*******************************************************************************
564
/*******************************************************************************
476
 *
565
 *
477
 * FUNCTION:    AcpiDmAddExternalsToNamespace
566
 * FUNCTION:    AcpiDmAddExternalsToNamespace
478
 *
567
 *
479
 * PARAMETERS:  None
568
 * PARAMETERS:  None
480
 *
569
 *
481
 * RETURN:      None
570
 * RETURN:      None
482
 *
571
 *
483
 * DESCRIPTION: Add all externals to the namespace. Allows externals to be
572
 * DESCRIPTION: Add all externals to the namespace. Allows externals to be
484
 *              "resolved".
573
 *              "resolved".
485
 *
574
 *
486
 ******************************************************************************/
575
 ******************************************************************************/
487
 
576
 
488
void
577
void
489
AcpiDmAddExternalsToNamespace (
578
AcpiDmAddExternalsToNamespace (
490
    void)
579
    void)
491
{
580
{
492
    ACPI_STATUS             Status;
581
    ACPI_STATUS             Status;
493
    ACPI_NAMESPACE_NODE     *Node;
582
    ACPI_NAMESPACE_NODE     *Node;
494
    ACPI_OPERAND_OBJECT     *MethodDesc;
583
    ACPI_OPERAND_OBJECT     *MethodDesc;
495
    ACPI_EXTERNAL_LIST      *External = AcpiGbl_ExternalList;
584
    ACPI_EXTERNAL_LIST      *External = AcpiGbl_ExternalList;
496
 
585
 
497
 
586
 
498
    while (External)
587
    while (External)
499
    {
588
    {
500
        /* Add the external name (object) into the namespace */
589
        /* Add the external name (object) into the namespace */
501
 
590
 
502
        Status = AcpiNsLookup (NULL, External->InternalPath, External->Type,
591
        Status = AcpiNsLookup (NULL, External->InternalPath, External->Type,
503
                   ACPI_IMODE_LOAD_PASS1,
592
                   ACPI_IMODE_LOAD_PASS1,
504
                   ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
593
                   ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
505
                   NULL, &Node);
594
                   NULL, &Node);
506
 
595
 
507
        if (ACPI_FAILURE (Status))
596
        if (ACPI_FAILURE (Status))
508
        {
597
        {
509
            ACPI_EXCEPTION ((AE_INFO, Status,
598
            ACPI_EXCEPTION ((AE_INFO, Status,
510
                "while adding external to namespace [%s]",
599
                "while adding external to namespace [%s]",
511
                External->Path));
600
                External->Path));
512
        }
601
        }
513
        else if (External->Type == ACPI_TYPE_METHOD)
602
        else if (External->Type == ACPI_TYPE_METHOD)
514
        {
603
        {
515
            /* For methods, we need to save the argument count */
604
            /* For methods, we need to save the argument count */
516
 
605
 
517
            MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
606
            MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
518
            MethodDesc->Method.ParamCount = (UINT8) External->Value;
607
            MethodDesc->Method.ParamCount = (UINT8) External->Value;
519
            Node->Object = MethodDesc;
608
            Node->Object = MethodDesc;
520
        }
609
        }
521
 
610
 
522
        External = External->Next;
611
        External = External->Next;
523
    }
612
    }
524
}
613
}
525
 
614
 
526
 
615
 
527
/*******************************************************************************
616
/*******************************************************************************
528
 *
617
 *
529
 * FUNCTION:    AcpiDmGetExternalMethodCount
618
 * FUNCTION:    AcpiDmGetExternalMethodCount
530
 *
619
 *
531
 * PARAMETERS:  None
620
 * PARAMETERS:  None
532
 *
621
 *
533
 * RETURN:      The number of control method externals in the external list
622
 * RETURN:      The number of control method externals in the external list
534
 *
623
 *
535
 * DESCRIPTION: Return the number of method externals that have been generated.
624
 * DESCRIPTION: Return the number of method externals that have been generated.
536
 *              If any control method externals have been found, we must
625
 *              If any control method externals have been found, we must
537
 *              re-parse the entire definition block with the new information
626
 *              re-parse the entire definition block with the new information
538
 *              (number of arguments for the methods.) This is limitation of
627
 *              (number of arguments for the methods.) This is limitation of
539
 *              AML, we don't know the number of arguments from the control
628
 *              AML, we don't know the number of arguments from the control
540
 *              method invocation itself.
629
 *              method invocation itself.
541
 *
630
 *
542
 ******************************************************************************/
631
 ******************************************************************************/
543
 
632
 
544
UINT32
633
UINT32
545
AcpiDmGetExternalMethodCount (
634
AcpiDmGetExternalMethodCount (
546
    void)
635
    void)
547
{
636
{
548
    ACPI_EXTERNAL_LIST      *External = AcpiGbl_ExternalList;
637
    ACPI_EXTERNAL_LIST      *External = AcpiGbl_ExternalList;
549
    UINT32                  Count = 0;
638
    UINT32                  Count = 0;
550
 
639
 
551
 
640
 
552
    while (External)
641
    while (External)
553
    {
642
    {
554
        if (External->Type == ACPI_TYPE_METHOD)
643
        if (External->Type == ACPI_TYPE_METHOD)
555
        {
644
        {
556
            Count++;
645
            Count++;
557
        }
646
        }
558
 
647
 
559
        External = External->Next;
648
        External = External->Next;
560
    }
649
    }
561
 
650
 
562
    return (Count);
651
    return (Count);
563
}
652
}
564
 
653
 
565
 
654
 
566
/*******************************************************************************
655
/*******************************************************************************
567
 *
656
 *
568
 * FUNCTION:    AcpiDmClearExternalList
657
 * FUNCTION:    AcpiDmClearExternalList
569
 *
658
 *
570
 * PARAMETERS:  None
659
 * PARAMETERS:  None
571
 *
660
 *
572
 * RETURN:      None
661
 * RETURN:      None
573
 *
662
 *
574
 * DESCRIPTION: Free the entire External info list
663
 * DESCRIPTION: Free the entire External info list
575
 *
664
 *
576
 ******************************************************************************/
665
 ******************************************************************************/
577
 
666
 
578
void
667
void
579
AcpiDmClearExternalList (
668
AcpiDmClearExternalList (
580
    void)
669
    void)
581
{
670
{
582
    ACPI_EXTERNAL_LIST      *NextExternal;
671
    ACPI_EXTERNAL_LIST      *NextExternal;
583
 
672
 
584
 
673
 
585
    while (AcpiGbl_ExternalList)
674
    while (AcpiGbl_ExternalList)
586
    {
675
    {
587
        NextExternal = AcpiGbl_ExternalList->Next;
676
        NextExternal = AcpiGbl_ExternalList->Next;
588
        ACPI_FREE (AcpiGbl_ExternalList->Path);
677
        ACPI_FREE (AcpiGbl_ExternalList->Path);
589
        ACPI_FREE (AcpiGbl_ExternalList);
678
        ACPI_FREE (AcpiGbl_ExternalList);
590
        AcpiGbl_ExternalList = NextExternal;
679
        AcpiGbl_ExternalList = NextExternal;
591
    }
680
    }
592
}
681
}
593
 
682
 
594
 
683
 
595
/*******************************************************************************
684
/*******************************************************************************
596
 *
685
 *
597
 * FUNCTION:    AcpiDmEmitExternals
686
 * FUNCTION:    AcpiDmEmitExternals
598
 *
687
 *
599
 * PARAMETERS:  None
688
 * PARAMETERS:  None
600
 *
689
 *
601
 * RETURN:      None
690
 * RETURN:      None
602
 *
691
 *
603
 * DESCRIPTION: Emit an External() ASL statement for each of the externals in
692
 * DESCRIPTION: Emit an External() ASL statement for each of the externals in
604
 *              the global external info list.
693
 *              the global external info list.
605
 *
694
 *
606
 ******************************************************************************/
695
 ******************************************************************************/
607
 
696
 
608
void
697
void
609
AcpiDmEmitExternals (
698
AcpiDmEmitExternals (
610
    void)
699
    void)
611
{
700
{
612
    ACPI_EXTERNAL_LIST      *NextExternal;
701
    ACPI_EXTERNAL_LIST      *NextExternal;
613
 
702
 
614
 
703
 
615
    if (!AcpiGbl_ExternalList)
704
    if (!AcpiGbl_ExternalList)
616
    {
705
    {
617
        return;
706
        return;
618
    }
707
    }
619
 
708
 
620
    /*
709
    /*
621
     * Walk the list of externals (unresolved references)
710
     * Walk the list of externals (unresolved references)
622
     * found during the AML parsing
711
     * found during the AML parsing
623
     */
712
     */
624
    while (AcpiGbl_ExternalList)
713
    while (AcpiGbl_ExternalList)
625
    {
714
    {
626
        AcpiOsPrintf ("    External (%s%s",
715
        AcpiOsPrintf ("    External (%s%s",
627
            AcpiGbl_ExternalList->Path,
716
            AcpiGbl_ExternalList->Path,
628
            AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
717
            AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
629
 
718
 
630
        if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
719
        if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
631
        {
720
        {
632
            AcpiOsPrintf (")    // %u Arguments\n",
721
            AcpiOsPrintf (")    // %u Arguments\n",
633
                AcpiGbl_ExternalList->Value);
722
                AcpiGbl_ExternalList->Value);
634
        }
723
        }
635
        else
724
        else
636
        {
725
        {
637
            AcpiOsPrintf (")\n");
726
            AcpiOsPrintf (")\n");
638
        }
727
        }
639
 
728
 
640
        /* Free this external info block and move on to next external */
729
        /* Free this external info block and move on to next external */
641
 
730
 
642
        NextExternal = AcpiGbl_ExternalList->Next;
731
        NextExternal = AcpiGbl_ExternalList->Next;
643
        if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
732
        if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
644
        {
733
        {
645
            ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
734
            ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
646
        }
735
        }
647
 
736
 
648
        ACPI_FREE (AcpiGbl_ExternalList->Path);
737
        ACPI_FREE (AcpiGbl_ExternalList->Path);
649
        ACPI_FREE (AcpiGbl_ExternalList);
738
        ACPI_FREE (AcpiGbl_ExternalList);
650
        AcpiGbl_ExternalList = NextExternal;
739
        AcpiGbl_ExternalList = NextExternal;
651
    }
740
    }
652
 
741
 
653
    AcpiOsPrintf ("\n");
742
    AcpiOsPrintf ("\n");
654
}
743
}