utglobal.c revision 69746
1/******************************************************************************
2 *
3 * Module Name: cmglobal - Global variables for the ACPI subsystem
4 *              $Revision: 112 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, Intel Corp.  All rights
13 * reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights.  You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
21 *
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
28 *
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code.  No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision.  In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change.  Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee.  Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
54 *
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution.  In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
66 *
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government.  In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117#define __CMGLOBAL_C__
118#define DEFINE_ACPI_GLOBALS
119
120#include "acpi.h"
121#include "acevents.h"
122#include "acnamesp.h"
123#include "acinterp.h"
124#include "amlcode.h"
125
126
127#define _COMPONENT          MISCELLANEOUS
128        MODULE_NAME         ("cmglobal")
129
130
131/******************************************************************************
132 *
133 * Static global variable initialization.
134 *
135 ******************************************************************************/
136
137/*
138 * We want the debug switches statically initialized so they
139 * are already set when the debugger is entered.
140 */
141
142/* Debug switch - level and trace mask */
143
144#ifdef ACPI_DEBUG
145UINT32                      AcpiDbgLevel = DEBUG_DEFAULT;
146#else
147UINT32                      AcpiDbgLevel = NORMAL_DEFAULT;
148#endif
149
150/* Debug switch - layer (component) mask */
151
152UINT32                      AcpiDbgLayer = COMPONENT_DEFAULT;
153UINT32                      AcpiGbl_NestingLevel = 0;
154
155
156/* Debugger globals */
157
158BOOLEAN                     AcpiGbl_DbTerminateThreads = FALSE;
159BOOLEAN                     AcpiGbl_MethodExecuting = FALSE;
160
161/* System flags */
162
163UINT32                      AcpiGbl_SystemFlags = 0;
164UINT32                      AcpiGbl_StartupFlags = 0;
165
166/* System starts unitialized! */
167BOOLEAN                     AcpiGbl_Shutdown = TRUE;
168
169
170UINT8                       AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128};
171
172
173/******************************************************************************
174 *
175 * Namespace globals
176 *
177 ******************************************************************************/
178
179
180/*
181 * Names built-in to the interpreter
182 *
183 * Initial values are currently supported only for types String and Number.
184 * To avoid type punning, both are specified as strings in this table.
185 */
186
187PREDEFINED_NAMES            AcpiGbl_PreDefinedNames[] =
188{
189    {"_GPE",    INTERNAL_TYPE_DEF_ANY},
190    {"_PR_",    INTERNAL_TYPE_DEF_ANY},
191    {"_SB_",    INTERNAL_TYPE_DEF_ANY},
192    {"_SI_",    INTERNAL_TYPE_DEF_ANY},
193    {"_TZ_",    INTERNAL_TYPE_DEF_ANY},
194    {"_REV",    ACPI_TYPE_NUMBER, "2"},
195    {"_OS_",    ACPI_TYPE_STRING, ACPI_OS_NAME},
196    {"_GL_",    ACPI_TYPE_MUTEX, "0"},
197
198    /* Table terminator */
199
200    {NULL,      ACPI_TYPE_ANY}
201};
202
203
204/*
205 * Properties of the ACPI Object Types, both internal and external.
206 *
207 * Elements of AcpiNsProperties are bit significant
208 * and the table is indexed by values of ACPI_OBJECT_TYPE
209 */
210
211UINT8                       AcpiGbl_NsProperties[] =
212{
213    NSP_NORMAL,                 /* 00 Any              */
214    NSP_NORMAL,                 /* 01 Number           */
215    NSP_NORMAL,                 /* 02 String           */
216    NSP_NORMAL,                 /* 03 Buffer           */
217    NSP_LOCAL,                  /* 04 Package          */
218    NSP_NORMAL,                 /* 05 FieldUnit        */
219    NSP_NEWSCOPE | NSP_LOCAL,   /* 06 Device           */
220    NSP_LOCAL,                  /* 07 AcpiEvent        */
221    NSP_NEWSCOPE | NSP_LOCAL,   /* 08 Method           */
222    NSP_LOCAL,                  /* 09 Mutex            */
223    NSP_LOCAL,                  /* 10 Region           */
224    NSP_NEWSCOPE | NSP_LOCAL,   /* 11 Power            */
225    NSP_NEWSCOPE | NSP_LOCAL,   /* 12 Processor        */
226    NSP_NEWSCOPE | NSP_LOCAL,   /* 13 Thermal          */
227    NSP_NORMAL,                 /* 14 BufferField      */
228    NSP_NORMAL,                 /* 15 DdbHandle        */
229    NSP_NORMAL,                 /* 16 Debug Object     */
230    NSP_NORMAL,                 /* 17 DefField         */
231    NSP_NORMAL,                 /* 18 BankField        */
232    NSP_NORMAL,                 /* 19 IndexField       */
233    NSP_NORMAL,                 /* 20 Reference        */
234    NSP_NORMAL,                 /* 21 Alias            */
235    NSP_NORMAL,                 /* 22 Notify           */
236    NSP_NORMAL,                 /* 23 Address Handler  */
237    NSP_NEWSCOPE | NSP_LOCAL,   /* 24 Resource         */
238    NSP_NORMAL,                 /* 25 DefFieldDefn     */
239    NSP_NORMAL,                 /* 26 BankFieldDefn    */
240    NSP_NORMAL,                 /* 27 IndexFieldDefn   */
241    NSP_NORMAL,                 /* 28 If               */
242    NSP_NORMAL,                 /* 29 Else             */
243    NSP_NORMAL,                 /* 30 While            */
244    NSP_NEWSCOPE,               /* 31 Scope            */
245    NSP_LOCAL,                  /* 32 DefAny           */
246    NSP_NORMAL,                 /* 33 Extra            */
247    NSP_NORMAL                  /* 34 Invalid          */
248};
249
250
251/******************************************************************************
252 *
253 * Table globals
254 *
255 * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes.
256 * it is NOT an exhaustive list of all possible ACPI tables.  All ACPI tables
257 * that are not used by the subsystem are simply ignored.
258 *
259 ******************************************************************************/
260
261
262ACPI_TABLE_DESC             AcpiGbl_AcpiTables[NUM_ACPI_TABLES];
263
264
265ACPI_TABLE_SUPPORT          AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] =
266{
267    /***********    Name,    Signature,  Signature size,    How many allowed?,   Supported?  Global typed pointer */
268
269    /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE,   AE_OK,      NULL},
270    /* DSDT 1 */ {DSDT_SIG,  DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE,   AE_OK,      (void **) &AcpiGbl_DSDT},
271    /* FADT 2 */ {FADT_SIG,  FADT_SIG, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE,   AE_OK,      (void **) &AcpiGbl_FADT},
272    /* FACS 3 */ {FACS_SIG,  FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE,   AE_OK,      (void **) &AcpiGbl_FACS},
273    /* PSDT 4 */ {PSDT_SIG,  PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK,      NULL},
274    /* SSDT 5 */ {SSDT_SIG,  SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK,      NULL},
275    /* XSDT 6 */ {XSDT_SIG,  XSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE,   AE_OK,      NULL},
276};
277
278
279#ifdef ACPI_DEBUG
280
281/******************************************************************************
282 *
283 * Strings and procedures used for debug only
284 *
285 ******************************************************************************/
286
287NATIVE_CHAR                 *MsgAcpiErrorBreak = "*** Break on ACPI_ERROR ***\n";
288
289
290
291
292/*****************************************************************************
293 *
294 * FUNCTION:    AcpiCmGetMutexName
295 *
296 * PARAMETERS:  None.
297 *
298 * RETURN:      Status
299 *
300 * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
301 *
302 ****************************************************************************/
303
304NATIVE_CHAR *
305AcpiCmGetMutexName (
306    UINT32                  MutexId)
307{
308
309    if (MutexId > MAX_MTX)
310    {
311        return ("Invalid Mutex ID");
312    }
313
314    return (AcpiGbl_MutexNames[MutexId]);
315}
316
317
318/*
319 * Elements of AcpiGbl_NsTypeNames below must match
320 * one-to-one with values of ACPI_OBJECT_TYPE
321 *
322 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when
323 * stored in a table it really means that we have thus far seen no evidence to
324 * indicatewhat type is actually going to be stored for this entry.
325 */
326
327static NATIVE_CHAR          AcpiGbl_BadType[] = "UNDEFINED";
328#define TYPE_NAME_LENGTH    9                       /* Maximum length of each string */
329
330static NATIVE_CHAR          *AcpiGbl_NsTypeNames[] =    /* printable names of ACPI types */
331{
332    /* 00 */ "Untyped",
333    /* 01 */ "Number",
334    /* 02 */ "String",
335    /* 03 */ "Buffer",
336    /* 04 */ "Package",
337    /* 05 */ "FieldUnit",
338    /* 06 */ "Device",
339    /* 07 */ "Event",
340    /* 08 */ "Method",
341    /* 09 */ "Mutex",
342    /* 10 */ "Region",
343    /* 11 */ "Power",
344    /* 12 */ "Processor",
345    /* 13 */ "Thermal",
346    /* 14 */ "BufferFld",
347    /* 15 */ "DdbHandle",
348    /* 16 */ "DebugObj",
349    /* 17 */ "DefField",
350    /* 18 */ "BnkField",
351    /* 19 */ "IdxField",
352    /* 20 */ "Reference",
353    /* 21 */ "Alias",
354    /* 22 */ "Notify",
355    /* 23 */ "AddrHndlr",
356    /* 24 */ "Resource",
357    /* 25 */ "DefFldDfn",
358    /* 26 */ "BnkFldDfn",
359    /* 27 */ "IdxFldDfn",
360    /* 28 */ "If",
361    /* 29 */ "Else",
362    /* 30 */ "While",
363    /* 31 */ "Scope",
364    /* 32 */ "DefAny",
365    /* 33 */ "Extra",
366    /* 34 */ "Invalid"
367};
368
369
370/*****************************************************************************
371 *
372 * FUNCTION:    AcpiCmGetTypeName
373 *
374 * PARAMETERS:  None.
375 *
376 * RETURN:      Status
377 *
378 * DESCRIPTION: Translate a Type ID into a name string (Debug only)
379 *
380 ****************************************************************************/
381
382NATIVE_CHAR *
383AcpiCmGetTypeName (
384    UINT32                  Type)
385{
386
387    if (Type > INTERNAL_TYPE_INVALID)
388    {
389        return (AcpiGbl_BadType);
390    }
391
392    return (AcpiGbl_NsTypeNames[Type]);
393}
394
395
396
397
398
399/* Region type decoding */
400
401NATIVE_CHAR *AcpiGbl_RegionTypes[NUM_REGION_TYPES] =
402{
403    "SystemMemory",
404    "SystemIO",
405    "PCIConfig",
406    "EmbeddedControl",
407    "SMBus",
408    "CMOS",
409    "PCIBarTarget",
410};
411
412
413/*****************************************************************************
414 *
415 * FUNCTION:    AcpiCmGetRegionName
416 *
417 * PARAMETERS:  None.
418 *
419 * RETURN:      Status
420 *
421 * DESCRIPTION: Translate a Space ID into a name string (Debug only)
422 *
423 ****************************************************************************/
424
425NATIVE_CHAR *
426AcpiCmGetRegionName (
427    UINT8                   SpaceId)
428{
429
430    if (SpaceId >= USER_REGION_BEGIN)
431    {
432        return ("UserDefinedRegion");
433    }
434
435    else if (SpaceId >= NUM_REGION_TYPES)
436    {
437        return ("InvalidSpaceID");
438    }
439
440    return (AcpiGbl_RegionTypes[SpaceId]);
441}
442
443
444
445
446
447/* Data used in keeping track of fields */
448
449NATIVE_CHAR *AcpiGbl_FENames[NUM_FIELD_NAMES] =
450{
451    "skip",
452    "?access?"
453};              /* FE = Field Element */
454
455
456
457NATIVE_CHAR *AcpiGbl_MatchOps[NUM_MATCH_OPS] =
458{
459    "Error",
460    "MTR",
461    "MEQ",
462    "MLE",
463    "MLT",
464    "MGE",
465    "MGT"
466};
467
468
469/* Access type decoding */
470
471NATIVE_CHAR *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] =
472{
473    "AnyAcc",
474    "ByteAcc",
475    "WordAcc",
476    "DWordAcc",
477    "BlockAcc",
478    "SMBSendRecvAcc",
479    "SMBQuickAcc"
480};
481
482
483/* Update rule decoding */
484
485NATIVE_CHAR *AcpiGbl_UpdateRules[NUM_UPDATE_RULES] =
486{
487    "Preserve",
488    "WriteAsOnes",
489    "WriteAsZeros"
490};
491
492#endif
493
494
495
496/*****************************************************************************
497 *
498 * FUNCTION:    AcpiCmValidObjectType
499 *
500 * PARAMETERS:  None.
501 *
502 * RETURN:      TRUE if valid object type
503 *
504 * DESCRIPTION: Validate an object type
505 *
506 ****************************************************************************/
507
508BOOLEAN
509AcpiCmValidObjectType (
510    UINT32                  Type)
511{
512
513    if (Type > ACPI_TYPE_MAX)
514    {
515        if ((Type < INTERNAL_TYPE_BEGIN) ||
516            (Type > INTERNAL_TYPE_MAX))
517        {
518            return (FALSE);
519        }
520    }
521
522    return (TRUE);
523}
524
525
526/*****************************************************************************
527 *
528 * FUNCTION:    AcpiCmFormatException
529 *
530 * PARAMETERS:  Status              - Acpi status to be formatted
531 *
532 * RETURN:      Formatted status string
533 *
534 * DESCRIPTION: Convert an ACPI exception to a string
535 *
536 ****************************************************************************/
537
538NATIVE_CHAR *
539AcpiCmFormatException (
540    ACPI_STATUS             Status)
541{
542    NATIVE_CHAR             *Exception = "UNKNOWN_STATUS";
543    ACPI_STATUS             SubStatus;
544
545
546    SubStatus = (Status & ~AE_CODE_MASK);
547
548
549    switch (Status & AE_CODE_MASK)
550    {
551    case AE_CODE_ENVIRONMENTAL:
552
553        if (SubStatus <= AE_CODE_ENV_MAX)
554        {
555            Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
556        }
557        break;
558
559    case AE_CODE_PROGRAMMER:
560
561        if (SubStatus <= AE_CODE_PGM_MAX)
562        {
563            Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1];
564        }
565        break;
566
567    case AE_CODE_ACPI_TABLES:
568
569        if (SubStatus <= AE_CODE_TBL_MAX)
570        {
571            Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1];
572        }
573        break;
574
575    case AE_CODE_AML:
576
577        if (SubStatus <= AE_CODE_AML_MAX)
578        {
579            Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1];
580        }
581        break;
582
583    case AE_CODE_CONTROL:
584
585        if (SubStatus <= AE_CODE_CTRL_MAX)
586        {
587            Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1];
588        }
589        break;
590
591    default:
592        break;
593    }
594
595
596    return (Exception);
597}
598
599
600/****************************************************************************
601 *
602 * FUNCTION:    AcpiCmAllocateOwnerId
603 *
604 * PARAMETERS:  IdType          - Type of ID (method or table)
605 *
606 * DESCRIPTION: Allocate a table or method owner id
607 *
608 ***************************************************************************/
609
610ACPI_OWNER_ID
611AcpiCmAllocateOwnerId (
612    UINT32                  IdType)
613{
614    ACPI_OWNER_ID           OwnerId = 0xFFFF;
615
616
617    FUNCTION_TRACE ("CmAllocateOwnerId");
618
619
620    AcpiCmAcquireMutex (ACPI_MTX_CACHES);
621
622    switch (IdType)
623    {
624    case OWNER_TYPE_TABLE:
625
626        OwnerId = AcpiGbl_NextTableOwnerId;
627        AcpiGbl_NextTableOwnerId++;
628
629        if (AcpiGbl_NextTableOwnerId == FIRST_METHOD_ID)
630        {
631            AcpiGbl_NextTableOwnerId = FIRST_TABLE_ID;
632        }
633        break;
634
635
636    case OWNER_TYPE_METHOD:
637
638        OwnerId = AcpiGbl_NextMethodOwnerId;
639        AcpiGbl_NextMethodOwnerId++;
640
641        if (AcpiGbl_NextMethodOwnerId == FIRST_TABLE_ID)
642        {
643            AcpiGbl_NextMethodOwnerId = FIRST_METHOD_ID;
644        }
645        break;
646    }
647
648
649    AcpiCmReleaseMutex (ACPI_MTX_CACHES);
650
651    return_VALUE (OwnerId);
652}
653
654
655/****************************************************************************
656 *
657 * FUNCTION:    AcpiCmInitGlobals
658 *
659 * PARAMETERS:  none
660 *
661 * DESCRIPTION: Init library globals.  All globals that require specific
662 *              initialization should be initialized here!
663 *
664 ***************************************************************************/
665
666void
667AcpiCmInitGlobals (
668    void)
669{
670    UINT32                  i;
671
672
673    FUNCTION_TRACE ("CmInitGlobals");
674
675
676    /* ACPI table structure */
677
678    for (i = 0; i < NUM_ACPI_TABLES; i++)
679    {
680        AcpiGbl_AcpiTables[i].Prev          = &AcpiGbl_AcpiTables[i];
681        AcpiGbl_AcpiTables[i].Next          = &AcpiGbl_AcpiTables[i];
682        AcpiGbl_AcpiTables[i].Pointer       = NULL;
683        AcpiGbl_AcpiTables[i].Length        = 0;
684        AcpiGbl_AcpiTables[i].Allocation    = ACPI_MEM_NOT_ALLOCATED;
685        AcpiGbl_AcpiTables[i].Count         = 0;
686    }
687
688
689    /* Address Space handler array */
690
691    for (i = 0; i < ACPI_NUM_ADDRESS_SPACES; i++)
692    {
693        AcpiGbl_AddressSpaces[i].Handler    = NULL;
694        AcpiGbl_AddressSpaces[i].Context    = NULL;
695    }
696
697    /* Mutex locked flags */
698
699    for (i = 0; i < NUM_MTX; i++)
700    {
701        AcpiGbl_AcpiMutexInfo[i].Mutex      = NULL;
702        AcpiGbl_AcpiMutexInfo[i].Locked     = FALSE;
703        AcpiGbl_AcpiMutexInfo[i].UseCount   = 0;
704    }
705
706    /* Global notify handlers */
707
708    AcpiGbl_SysNotify.Handler           = NULL;
709    AcpiGbl_DrvNotify.Handler           = NULL;
710
711    /* Global "typed" ACPI table pointers */
712
713    AcpiGbl_RSDP                        = NULL;
714    AcpiGbl_XSDT                        = NULL;
715    AcpiGbl_FACS                        = NULL;
716    AcpiGbl_FADT                        = NULL;
717    AcpiGbl_DSDT                        = NULL;
718
719
720    /* Global Lock support */
721
722    AcpiGbl_GlobalLockAcquired          = FALSE;
723    AcpiGbl_GlobalLockThreadCount       = 0;
724
725    /* Miscellaneous variables */
726
727    AcpiGbl_SystemFlags                 = 0;
728    AcpiGbl_StartupFlags                = 0;
729    AcpiGbl_GlobalLockSet               = FALSE;
730    AcpiGbl_RsdpOriginalLocation        = 0;
731    AcpiGbl_CmSingleStep                = FALSE;
732    AcpiGbl_DbTerminateThreads          = FALSE;
733    AcpiGbl_Shutdown                    = FALSE;
734    AcpiGbl_NsLookupCount               = 0;
735    AcpiGbl_PsFindCount                 = 0;
736    AcpiGbl_AcpiHardwarePresent         = TRUE;
737    AcpiGbl_NextTableOwnerId            = FIRST_TABLE_ID;
738    AcpiGbl_NextMethodOwnerId           = FIRST_METHOD_ID;
739    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
740
741    /* Cache of small "state" objects */
742
743    AcpiGbl_GenericStateCache           = NULL;
744    AcpiGbl_GenericStateCacheDepth      = 0;
745    AcpiGbl_StateCacheRequests          = 0;
746    AcpiGbl_StateCacheHits              = 0;
747
748    AcpiGbl_ParseCache                  = NULL;
749    AcpiGbl_ParseCacheDepth             = 0;
750    AcpiGbl_ParseCacheRequests          = 0;
751    AcpiGbl_ParseCacheHits              = 0;
752
753    AcpiGbl_ExtParseCache               = NULL;
754    AcpiGbl_ExtParseCacheDepth          = 0;
755    AcpiGbl_ExtParseCacheRequests       = 0;
756    AcpiGbl_ExtParseCacheHits           = 0;
757
758    AcpiGbl_ObjectCache                 = NULL;
759    AcpiGbl_ObjectCacheDepth            = 0;
760    AcpiGbl_ObjectCacheRequests         = 0;
761    AcpiGbl_ObjectCacheHits             = 0;
762
763    AcpiGbl_WalkStateCache              = NULL;
764    AcpiGbl_WalkStateCacheDepth         = 0;
765    AcpiGbl_WalkStateCacheRequests      = 0;
766    AcpiGbl_WalkStateCacheHits          = 0;
767
768    /* Hardware oriented */
769
770    AcpiGbl_Gpe0EnableRegisterSave      = NULL;
771    AcpiGbl_Gpe1EnableRegisterSave      = NULL;
772    AcpiGbl_OriginalMode                = SYS_MODE_UNKNOWN;   /*  original ACPI/legacy mode   */
773    AcpiGbl_GpeRegisters                = NULL;
774    AcpiGbl_GpeInfo                     = NULL;
775
776    /* Namespace */
777
778    AcpiGbl_RootNode                    = NULL;
779
780    AcpiGbl_RootNodeStruct.Name         = ACPI_ROOT_NAME;
781    AcpiGbl_RootNodeStruct.DataType     = ACPI_DESC_TYPE_NAMED;
782    AcpiGbl_RootNodeStruct.Type         = ACPI_TYPE_ANY;
783    AcpiGbl_RootNodeStruct.Child        = NULL;
784    AcpiGbl_RootNodeStruct.Peer         = NULL;
785    AcpiGbl_RootNodeStruct.Object       = NULL;
786    AcpiGbl_RootNodeStruct.Flags        = ANOBJ_END_OF_PEER_LIST;
787
788    /* Memory allocation metrics - compiled out in non-debug mode. */
789
790    INITIALIZE_ALLOCATION_METRICS();
791
792    return_VOID;
793}
794
795
796