Subversion Repositories Kolibri OS

Rev

Rev 1498 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
Line 6... Line 6...
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
 *
Line 116... Line 116...
116
#define __UTGLOBAL_C__
116
#define __UTGLOBAL_C__
117
#define DEFINE_ACPI_GLOBALS
117
#define DEFINE_ACPI_GLOBALS
Line 118... Line 118...
118
 
118
 
119
#include "acpi.h"
119
#include "acpi.h"
120
#include "accommon.h"
-
 
Line 121... Line 120...
121
#include "acnamesp.h"
120
#include "accommon.h"
122
 
121
 
Line 190... Line 189...
190
};
189
};
Line 191... Line 190...
191
 
190
 
192
 
191
 
193
/*******************************************************************************
-
 
194
 *
-
 
195
 * FUNCTION:    AcpiFormatException
-
 
196
 *
-
 
197
 * PARAMETERS:  Status       - The ACPI_STATUS code to be formatted
-
 
198
 *
-
 
199
 * RETURN:      A string containing the exception text. A valid pointer is
-
 
200
 *              always returned.
-
 
201
 *
-
 
202
 * DESCRIPTION: This function translates an ACPI exception into an ASCII string
-
 
203
 *              It is here instead of utxface.c so it is always present.
-
 
204
 *
-
 
205
 ******************************************************************************/
-
 
206
 
-
 
207
const char *
-
 
208
AcpiFormatException (
-
 
209
    ACPI_STATUS             Status)
-
 
210
{
-
 
211
    const char              *Exception = NULL;
-
 
212
 
-
 
213
 
-
 
214
    ACPI_FUNCTION_ENTRY ();
-
 
215
 
-
 
216
 
-
 
217
    Exception = AcpiUtValidateException (Status);
-
 
218
    if (!Exception)
-
 
219
    {
-
 
220
        /* Exception code was not recognized */
-
 
221
 
-
 
222
        ACPI_ERROR ((AE_INFO,
-
 
223
            "Unknown exception code: 0x%8.8X", Status));
-
 
224
 
-
 
225
        Exception = "UNKNOWN_STATUS_CODE";
-
 
226
    }
-
 
227
 
-
 
228
    return (ACPI_CAST_PTR (const char, Exception));
-
 
229
}
-
 
230
 
-
 
231
ACPI_EXPORT_SYMBOL (AcpiFormatException)
-
 
232
 
-
 
233
 
-
 
234
/*******************************************************************************
192
/*******************************************************************************
235
 *
193
 *
236
 * Namespace globals
194
 * Namespace globals
Line 237... Line 195...
237
 *
195
 *
Line 242... Line 200...
242
 *
200
 *
243
 * NOTES:
201
 * NOTES:
244
 * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
202
 * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
245
 *    during the initialization sequence.
203
 *    during the initialization sequence.
246
 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
204
 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
247
 *    perform a Notify() operation on it.
205
 *    perform a Notify() operation on it. 09/2010: Changed to type Device.
-
 
206
 *    This still allows notifies, but does not confuse host code that
-
 
207
 *    searches for valid ThermalZone objects.
248
 */
208
 */
249
const ACPI_PREDEFINED_NAMES     AcpiGbl_PreDefinedNames[] =
209
const ACPI_PREDEFINED_NAMES     AcpiGbl_PreDefinedNames[] =
250
{
210
{
251
    {"_GPE",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
211
    {"_GPE",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
252
    {"_PR_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
212
    {"_PR_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
253
    {"_SB_",    ACPI_TYPE_DEVICE,           NULL},
213
    {"_SB_",    ACPI_TYPE_DEVICE,           NULL},
254
    {"_SI_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
214
    {"_SI_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
255
    {"_TZ_",    ACPI_TYPE_THERMAL,          NULL},
215
    {"_TZ_",    ACPI_TYPE_DEVICE,           NULL},
256
    {"_REV",    ACPI_TYPE_INTEGER,          (char *) ACPI_CA_SUPPORT_LEVEL},
216
    {"_REV",    ACPI_TYPE_INTEGER,          (char *) ACPI_CA_SUPPORT_LEVEL},
257
    {"_OS_",    ACPI_TYPE_STRING,           ACPI_OS_NAME},
217
    {"_OS_",    ACPI_TYPE_STRING,           ACPI_OS_NAME},
258
    {"_GL_",    ACPI_TYPE_MUTEX,            (char *) 1},
218
    {"_GL_",    ACPI_TYPE_MUTEX,            (char *) 1},
Line 259... Line 219...
259
 
219
 
Line 264... Line 224...
264
    /* Table terminator */
224
    /* Table terminator */
Line 265... Line 225...
265
 
225
 
266
    {NULL,      ACPI_TYPE_ANY,              NULL}
226
    {NULL,      ACPI_TYPE_ANY,              NULL}
Line 267... Line -...
267
};
-
 
268
 
-
 
269
/*
-
 
270
 * Properties of the ACPI Object Types, both internal and external.
-
 
271
 * The table is indexed by values of ACPI_OBJECT_TYPE
-
 
272
 */
-
 
273
const UINT8                     AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
-
 
274
{
-
 
275
    ACPI_NS_NORMAL,                     /* 00 Any              */
-
 
276
    ACPI_NS_NORMAL,                     /* 01 Number           */
-
 
277
    ACPI_NS_NORMAL,                     /* 02 String           */
-
 
278
    ACPI_NS_NORMAL,                     /* 03 Buffer           */
-
 
279
    ACPI_NS_NORMAL,                     /* 04 Package          */
-
 
280
    ACPI_NS_NORMAL,                     /* 05 FieldUnit        */
-
 
281
    ACPI_NS_NEWSCOPE,                   /* 06 Device           */
-
 
282
    ACPI_NS_NORMAL,                     /* 07 Event            */
-
 
283
    ACPI_NS_NEWSCOPE,                   /* 08 Method           */
-
 
284
    ACPI_NS_NORMAL,                     /* 09 Mutex            */
-
 
285
    ACPI_NS_NORMAL,                     /* 10 Region           */
-
 
286
    ACPI_NS_NEWSCOPE,                   /* 11 Power            */
-
 
287
    ACPI_NS_NEWSCOPE,                   /* 12 Processor        */
-
 
288
    ACPI_NS_NEWSCOPE,                   /* 13 Thermal          */
-
 
289
    ACPI_NS_NORMAL,                     /* 14 BufferField      */
-
 
290
    ACPI_NS_NORMAL,                     /* 15 DdbHandle        */
-
 
291
    ACPI_NS_NORMAL,                     /* 16 Debug Object     */
-
 
292
    ACPI_NS_NORMAL,                     /* 17 DefField         */
-
 
293
    ACPI_NS_NORMAL,                     /* 18 BankField        */
-
 
294
    ACPI_NS_NORMAL,                     /* 19 IndexField       */
-
 
295
    ACPI_NS_NORMAL,                     /* 20 Reference        */
-
 
296
    ACPI_NS_NORMAL,                     /* 21 Alias            */
-
 
297
    ACPI_NS_NORMAL,                     /* 22 MethodAlias      */
-
 
298
    ACPI_NS_NORMAL,                     /* 23 Notify           */
-
 
299
    ACPI_NS_NORMAL,                     /* 24 Address Handler  */
-
 
300
    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 25 Resource Desc    */
-
 
301
    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 26 Resource Field   */
-
 
302
    ACPI_NS_NEWSCOPE,                   /* 27 Scope            */
-
 
303
    ACPI_NS_NORMAL,                     /* 28 Extra            */
-
 
304
    ACPI_NS_NORMAL,                     /* 29 Data             */
-
 
305
    ACPI_NS_NORMAL                      /* 30 Invalid          */
-
 
306
};
-
 
307
 
-
 
308
 
-
 
309
/* Hex to ASCII conversion table */
-
 
310
 
-
 
311
static const char           AcpiGbl_HexToAscii[] =
-
 
312
{
-
 
313
    '0','1','2','3','4','5','6','7',
-
 
314
    '8','9','A','B','C','D','E','F'
-
 
315
};
-
 
316
 
-
 
317
 
-
 
318
/*******************************************************************************
-
 
319
 *
-
 
320
 * FUNCTION:    AcpiUtHexToAsciiChar
-
 
321
 *
-
 
322
 * PARAMETERS:  Integer             - Contains the hex digit
-
 
323
 *              Position            - bit position of the digit within the
-
 
324
 *                                    integer (multiple of 4)
-
 
325
 *
-
 
326
 * RETURN:      The converted Ascii character
-
 
327
 *
-
 
328
 * DESCRIPTION: Convert a hex digit to an Ascii character
-
 
329
 *
-
 
330
 ******************************************************************************/
-
 
331
 
-
 
332
char
-
 
333
AcpiUtHexToAsciiChar (
-
 
334
    UINT64                  Integer,
-
 
335
    UINT32                  Position)
-
 
336
{
-
 
337
 
-
 
338
    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
-
 
Line 339... Line 227...
339
}
227
};
340
 
228
 
341
 
229
 
342
/******************************************************************************
230
/******************************************************************************
Line 382... Line 270...
382
    /* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
270
    /* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
383
    /* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
271
    /* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
384
    /* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     ACPI_BITMASK_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_ENABLE},
272
    /* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     ACPI_BITMASK_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_ENABLE},
385
};
273
};
Line 386... Line -...
386
 
-
 
387
/*******************************************************************************
-
 
388
 *
-
 
389
 * FUNCTION:    AcpiUtGetRegionName
-
 
390
 *
-
 
391
 * PARAMETERS:  None.
-
 
392
 *
-
 
393
 * RETURN:      Status
-
 
394
 *
-
 
395
 * DESCRIPTION: Translate a Space ID into a name string (Debug only)
-
 
396
 *
-
 
397
 ******************************************************************************/
-
 
398
 
-
 
399
/* Region type decoding */
-
 
400
 
-
 
401
const char        *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
-
 
402
{
-
 
403
    "SystemMemory",
-
 
404
    "SystemIO",
-
 
405
    "PCI_Config",
-
 
406
    "EmbeddedControl",
-
 
407
    "SMBus",
-
 
408
    "SystemCMOS",
-
 
409
    "PCIBARTarget",
-
 
410
    "IPMI",
-
 
411
    "DataTable"
-
 
412
};
-
 
413
 
-
 
414
 
-
 
415
char *
-
 
416
AcpiUtGetRegionName (
-
 
417
    UINT8                   SpaceId)
-
 
418
{
-
 
419
 
-
 
420
    if (SpaceId >= ACPI_USER_REGION_BEGIN)
-
 
421
    {
-
 
422
        return ("UserDefinedRegion");
-
 
423
    }
-
 
424
    else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
-
 
425
    {
-
 
426
        return ("InvalidSpaceId");
-
 
427
    }
-
 
428
 
-
 
429
    return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
-
 
430
}
-
 
431
 
-
 
432
 
-
 
433
/*******************************************************************************
-
 
434
 *
-
 
435
 * FUNCTION:    AcpiUtGetEventName
-
 
436
 *
-
 
437
 * PARAMETERS:  None.
-
 
438
 *
-
 
439
 * RETURN:      Status
-
 
440
 *
-
 
441
 * DESCRIPTION: Translate a Event ID into a name string (Debug only)
-
 
442
 *
-
 
443
 ******************************************************************************/
-
 
444
 
-
 
445
/* Event type decoding */
-
 
446
 
-
 
447
static const char        *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
-
 
448
{
-
 
449
    "PM_Timer",
-
 
450
    "GlobalLock",
-
 
451
    "PowerButton",
-
 
452
    "SleepButton",
-
 
453
    "RealTimeClock",
-
 
454
};
-
 
455
 
-
 
456
 
-
 
457
char *
-
 
458
AcpiUtGetEventName (
-
 
459
    UINT32                  EventId)
-
 
460
{
-
 
461
 
-
 
462
    if (EventId > ACPI_EVENT_MAX)
-
 
463
    {
-
 
464
        return ("InvalidEventID");
-
 
465
    }
-
 
466
 
-
 
467
    return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
-
 
468
}
-
 
469
 
-
 
470
 
-
 
471
/*******************************************************************************
-
 
472
 *
-
 
473
 * FUNCTION:    AcpiUtGetTypeName
-
 
474
 *
-
 
475
 * PARAMETERS:  None.
-
 
476
 *
-
 
477
 * RETURN:      Status
-
 
478
 *
-
 
479
 * DESCRIPTION: Translate a Type ID into a name string (Debug only)
-
 
480
 *
-
 
481
 ******************************************************************************/
-
 
482
 
-
 
483
/*
-
 
484
 * Elements of AcpiGbl_NsTypeNames below must match
-
 
485
 * one-to-one with values of ACPI_OBJECT_TYPE
-
 
486
 *
-
 
487
 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
-
 
488
 * when stored in a table it really means that we have thus far seen no
-
 
489
 * evidence to indicate what type is actually going to be stored for this entry.
-
 
490
 */
-
 
491
static const char           AcpiGbl_BadType[] = "UNDEFINED";
-
 
492
 
-
 
493
/* Printable names of the ACPI object types */
-
 
494
 
-
 
495
static const char           *AcpiGbl_NsTypeNames[] =
-
 
496
{
-
 
497
    /* 00 */ "Untyped",
-
 
498
    /* 01 */ "Integer",
-
 
499
    /* 02 */ "String",
-
 
500
    /* 03 */ "Buffer",
-
 
501
    /* 04 */ "Package",
-
 
502
    /* 05 */ "FieldUnit",
-
 
503
    /* 06 */ "Device",
-
 
504
    /* 07 */ "Event",
-
 
505
    /* 08 */ "Method",
-
 
506
    /* 09 */ "Mutex",
-
 
507
    /* 10 */ "Region",
-
 
508
    /* 11 */ "Power",
-
 
509
    /* 12 */ "Processor",
-
 
510
    /* 13 */ "Thermal",
-
 
511
    /* 14 */ "BufferField",
-
 
512
    /* 15 */ "DdbHandle",
-
 
513
    /* 16 */ "DebugObject",
-
 
514
    /* 17 */ "RegionField",
-
 
515
    /* 18 */ "BankField",
-
 
516
    /* 19 */ "IndexField",
-
 
517
    /* 20 */ "Reference",
-
 
518
    /* 21 */ "Alias",
-
 
519
    /* 22 */ "MethodAlias",
-
 
520
    /* 23 */ "Notify",
-
 
521
    /* 24 */ "AddrHandler",
-
 
522
    /* 25 */ "ResourceDesc",
-
 
523
    /* 26 */ "ResourceFld",
-
 
524
    /* 27 */ "Scope",
-
 
525
    /* 28 */ "Extra",
-
 
526
    /* 29 */ "Data",
-
 
527
    /* 30 */ "Invalid"
-
 
528
};
-
 
529
 
-
 
530
 
-
 
531
char *
-
 
532
AcpiUtGetTypeName (
-
 
533
    ACPI_OBJECT_TYPE        Type)
-
 
534
{
-
 
535
 
-
 
536
    if (Type > ACPI_TYPE_INVALID)
-
 
537
    {
-
 
538
        return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
-
 
539
    }
-
 
540
 
-
 
541
    return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
-
 
542
}
-
 
543
 
-
 
544
 
-
 
545
char *
-
 
546
AcpiUtGetObjectTypeName (
-
 
547
    ACPI_OPERAND_OBJECT     *ObjDesc)
-
 
548
{
-
 
549
 
-
 
550
    if (!ObjDesc)
-
 
551
    {
-
 
552
        return ("[NULL Object Descriptor]");
-
 
553
    }
-
 
554
 
-
 
555
    return (AcpiUtGetTypeName (ObjDesc->Common.Type));
-
 
556
}
-
 
557
 
-
 
558
 
-
 
559
/*******************************************************************************
-
 
560
 *
-
 
561
 * FUNCTION:    AcpiUtGetNodeName
-
 
562
 *
-
 
563
 * PARAMETERS:  Object               - A namespace node
-
 
564
 *
-
 
565
 * RETURN:      Pointer to a string
-
 
566
 *
-
 
567
 * DESCRIPTION: Validate the node and return the node's ACPI name.
-
 
568
 *
-
 
569
 ******************************************************************************/
-
 
570
 
-
 
571
char *
-
 
572
AcpiUtGetNodeName (
-
 
573
    void                    *Object)
-
 
574
{
-
 
575
    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) Object;
-
 
576
 
-
 
577
 
-
 
578
    /* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
-
 
579
 
-
 
580
    if (!Object)
-
 
581
    {
-
 
582
        return ("NULL");
-
 
583
    }
-
 
584
 
-
 
585
    /* Check for Root node */
-
 
586
 
-
 
587
    if ((Object == ACPI_ROOT_OBJECT) ||
-
 
588
        (Object == AcpiGbl_RootNode))
-
 
589
    {
-
 
590
        return ("\"\\\" ");
-
 
591
    }
-
 
592
 
-
 
593
    /* Descriptor must be a namespace node */
-
 
594
 
-
 
595
    if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
-
 
596
    {
-
 
597
        return ("####");
-
 
598
    }
-
 
599
 
-
 
600
    /*
-
 
601
     * Ensure name is valid. The name was validated/repaired when the node
-
 
602
     * was created, but make sure it has not been corrupted.
-
 
603
     */
-
 
604
    AcpiUtRepairName (Node->Name.Ascii);
-
 
605
 
-
 
606
    /* Return the name */
-
 
607
 
-
 
608
    return (Node->Name.Ascii);
-
 
609
}
-
 
610
 
-
 
611
 
-
 
612
/*******************************************************************************
-
 
613
 *
-
 
614
 * FUNCTION:    AcpiUtGetDescriptorName
-
 
615
 *
-
 
616
 * PARAMETERS:  Object               - An ACPI object
-
 
617
 *
-
 
618
 * RETURN:      Pointer to a string
-
 
619
 *
-
 
620
 * DESCRIPTION: Validate object and return the descriptor type
-
 
621
 *
-
 
622
 ******************************************************************************/
-
 
623
 
-
 
624
/* Printable names of object descriptor types */
-
 
625
 
-
 
626
static const char           *AcpiGbl_DescTypeNames[] =
-
 
627
{
-
 
628
    /* 00 */ "Not a Descriptor",
-
 
629
    /* 01 */ "Cached",
-
 
630
    /* 02 */ "State-Generic",
-
 
631
    /* 03 */ "State-Update",
-
 
632
    /* 04 */ "State-Package",
-
 
633
    /* 05 */ "State-Control",
-
 
634
    /* 06 */ "State-RootParseScope",
-
 
635
    /* 07 */ "State-ParseScope",
-
 
636
    /* 08 */ "State-WalkScope",
-
 
637
    /* 09 */ "State-Result",
-
 
638
    /* 10 */ "State-Notify",
-
 
639
    /* 11 */ "State-Thread",
-
 
640
    /* 12 */ "Walk",
-
 
641
    /* 13 */ "Parser",
-
 
642
    /* 14 */ "Operand",
-
 
643
    /* 15 */ "Node"
-
 
644
};
-
 
645
 
-
 
646
 
-
 
647
char *
-
 
648
AcpiUtGetDescriptorName (
-
 
649
    void                    *Object)
-
 
650
{
-
 
651
 
-
 
652
    if (!Object)
-
 
653
    {
-
 
654
        return ("NULL OBJECT");
-
 
655
    }
-
 
656
 
-
 
657
    if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
-
 
658
    {
-
 
659
        return ("Not a Descriptor");
-
 
660
    }
-
 
661
 
-
 
662
    return (ACPI_CAST_PTR (char,
-
 
663
        AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
-
 
664
 
-
 
665
}
-
 
666
 
-
 
667
 
-
 
668
/*******************************************************************************
-
 
669
 *
-
 
670
 * FUNCTION:    AcpiUtGetReferenceName
-
 
671
 *
-
 
672
 * PARAMETERS:  Object               - An ACPI reference object
-
 
673
 *
-
 
674
 * RETURN:      Pointer to a string
-
 
675
 *
-
 
676
 * DESCRIPTION: Decode a reference object sub-type to a string.
-
 
677
 *
-
 
678
 ******************************************************************************/
-
 
679
 
-
 
680
/* Printable names of reference object sub-types */
-
 
681
 
-
 
682
static const char           *AcpiGbl_RefClassNames[] =
-
 
683
{
-
 
684
    /* 00 */ "Local",
-
 
685
    /* 01 */ "Argument",
-
 
686
    /* 02 */ "RefOf",
-
 
687
    /* 03 */ "Index",
-
 
688
    /* 04 */ "DdbHandle",
-
 
689
    /* 05 */ "Named Object",
-
 
690
    /* 06 */ "Debug"
-
 
691
};
-
 
692
 
-
 
693
const char *
-
 
694
AcpiUtGetReferenceName (
-
 
695
    ACPI_OPERAND_OBJECT     *Object)
-
 
696
{
-
 
697
 
-
 
698
    if (!Object)
-
 
699
    {
-
 
700
        return ("NULL Object");
-
 
701
    }
-
 
702
 
-
 
703
    if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
-
 
704
    {
-
 
705
        return ("Not an Operand object");
-
 
706
    }
-
 
707
 
-
 
708
    if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
-
 
709
    {
-
 
710
        return ("Not a Reference object");
-
 
711
    }
-
 
712
 
-
 
713
    if (Object->Reference.Class > ACPI_REFCLASS_MAX)
-
 
714
    {
-
 
715
        return ("Unknown Reference class");
-
 
716
    }
-
 
717
 
-
 
718
    return (AcpiGbl_RefClassNames[Object->Reference.Class]);
-
 
719
}
-
 
720
 
-
 
721
 
-
 
722
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
-
 
723
/*
-
 
724
 * Strings and procedures used for debug only
-
 
725
 */
-
 
726
 
-
 
727
/*******************************************************************************
-
 
728
 *
-
 
729
 * FUNCTION:    AcpiUtGetMutexName
-
 
730
 *
-
 
731
 * PARAMETERS:  MutexId         - The predefined ID for this mutex.
-
 
732
 *
-
 
733
 * RETURN:      String containing the name of the mutex. Always returns a valid
-
 
734
 *              pointer.
-
 
735
 *
-
 
736
 * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
-
 
737
 *
-
 
738
 ******************************************************************************/
-
 
739
 
-
 
740
char *
-
 
741
AcpiUtGetMutexName (
-
 
742
    UINT32                  MutexId)
-
 
743
{
-
 
744
 
-
 
745
    if (MutexId > ACPI_MAX_MUTEX)
-
 
746
    {
-
 
747
        return ("Invalid Mutex ID");
-
 
748
    }
-
 
749
 
-
 
750
    return (AcpiGbl_MutexNames[MutexId]);
-
 
751
}
-
 
752
 
-
 
753
 
-
 
754
/*******************************************************************************
-
 
755
 *
-
 
756
 * FUNCTION:    AcpiUtGetNotifyName
-
 
757
 *
-
 
758
 * PARAMETERS:  NotifyValue     - Value from the Notify() request
-
 
759
 *
-
 
760
 * RETURN:      String corresponding to the Notify Value.
-
 
761
 *
-
 
762
 * DESCRIPTION: Translate a Notify Value to a notify namestring.
-
 
763
 *
-
 
764
 ******************************************************************************/
-
 
765
 
-
 
766
/* Names for Notify() values, used for debug output */
-
 
767
 
-
 
768
static const char        *AcpiGbl_NotifyValueNames[] =
-
 
769
{
-
 
770
    "Bus Check",
-
 
771
    "Device Check",
-
 
772
    "Device Wake",
-
 
773
    "Eject Request",
-
 
774
    "Device Check Light",
-
 
775
    "Frequency Mismatch",
-
 
776
    "Bus Mode Mismatch",
-
 
777
    "Power Fault",
-
 
778
    "Capabilities Check",
-
 
779
    "Device PLD Check",
-
 
780
    "Reserved",
-
 
781
    "System Locality Update"
-
 
782
};
-
 
783
 
-
 
784
const char *
-
 
785
AcpiUtGetNotifyName (
-
 
786
    UINT32                  NotifyValue)
-
 
787
{
-
 
788
 
-
 
789
    if (NotifyValue <= ACPI_NOTIFY_MAX)
-
 
790
    {
-
 
791
        return (AcpiGbl_NotifyValueNames[NotifyValue]);
-
 
792
    }
-
 
793
    else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
-
 
794
    {
-
 
795
        return ("Reserved");
-
 
796
    }
-
 
797
    else /* Greater or equal to 0x80 */
-
 
798
    {
-
 
799
        return ("**Device Specific**");
-
 
800
    }
-
 
801
}
-
 
802
#endif
-
 
803
 
-
 
804
 
-
 
805
/*******************************************************************************
-
 
806
 *
-
 
807
 * FUNCTION:    AcpiUtValidObjectType
-
 
808
 *
-
 
809
 * PARAMETERS:  Type            - Object type to be validated
-
 
810
 *
-
 
811
 * RETURN:      TRUE if valid object type, FALSE otherwise
-
 
812
 *
-
 
813
 * DESCRIPTION: Validate an object type
-
 
814
 *
-
 
815
 ******************************************************************************/
-
 
816
 
-
 
817
BOOLEAN
-
 
818
AcpiUtValidObjectType (
-
 
819
    ACPI_OBJECT_TYPE        Type)
-
 
820
{
-
 
821
 
-
 
822
    if (Type > ACPI_TYPE_LOCAL_MAX)
-
 
823
    {
-
 
824
        /* Note: Assumes all TYPEs are contiguous (external/local) */
-
 
825
 
-
 
826
        return (FALSE);
-
 
827
    }
-
 
828
 
-
 
829
    return (TRUE);
-
 
830
}
-
 
Line 831... Line 274...
831
 
274
 
832
 
275
 
833
/*******************************************************************************
276
/*******************************************************************************
834
 *
277
 *
835
 * FUNCTION:    AcpiUtInitGlobals
278
 * FUNCTION:    AcpiUtInitGlobals
836
 *
279
 *
837
 * PARAMETERS:  None
280
 * PARAMETERS:  None
838
 *
281
 *
839
 * RETURN:      Status
282
 * RETURN:      Status
840
 *
283
 *
841
 * DESCRIPTION: Init library globals.  All globals that require specific
284
 * DESCRIPTION: Init ACPICA globals.  All globals that require specific
842
 *              initialization should be initialized here!
285
 *              initialization should be initialized here!
Line 843... Line 286...
843
 *
286
 *
Line 891... Line 334...
891
        AcpiFixedEventCount[i]              = 0;
334
        AcpiFixedEventCount[i]              = 0;
892
    }
335
    }
Line 893... Line 336...
893
 
336
 
Line -... Line 337...
-
 
337
    /* GPE support */
894
    /* GPE support */
338
 
895
 
339
    AcpiGbl_AllGpesInitialized          = FALSE;
896
    AcpiGbl_GpeXruptListHead            = NULL;
340
    AcpiGbl_GpeXruptListHead            = NULL;
897
    AcpiGbl_GpeFadtBlocks[0]            = NULL;
341
    AcpiGbl_GpeFadtBlocks[0]            = NULL;
Line 903... Line 347...
903
    AcpiGbl_SystemNotify.Handler        = NULL;
347
    AcpiGbl_SystemNotify.Handler        = NULL;
904
    AcpiGbl_DeviceNotify.Handler        = NULL;
348
    AcpiGbl_DeviceNotify.Handler        = NULL;
905
    AcpiGbl_ExceptionHandler            = NULL;
349
    AcpiGbl_ExceptionHandler            = NULL;
906
    AcpiGbl_InitHandler                 = NULL;
350
    AcpiGbl_InitHandler                 = NULL;
907
    AcpiGbl_TableHandler                = NULL;
351
    AcpiGbl_TableHandler                = NULL;
-
 
352
    AcpiGbl_InterfaceHandler            = NULL;
-
 
353
    AcpiGbl_GlobalEventHandler          = NULL;
Line 908... Line 354...
908
 
354
 
Line 909... Line 355...
909
    /* Global Lock support */
355
    /* Global Lock support */
910
 
356
 
Line 929... Line 375...
929
    AcpiGbl_TraceDbgLevel               = 0;
375
    AcpiGbl_TraceDbgLevel               = 0;
930
    AcpiGbl_TraceDbgLayer               = 0;
376
    AcpiGbl_TraceDbgLayer               = 0;
931
    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
377
    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
932
    AcpiGbl_DbOutputFlags               = ACPI_DB_CONSOLE_OUTPUT;
378
    AcpiGbl_DbOutputFlags               = ACPI_DB_CONSOLE_OUTPUT;
933
    AcpiGbl_OsiData                     = 0;
379
    AcpiGbl_OsiData                     = 0;
-
 
380
    AcpiGbl_OsiMutex                    = NULL;
-
 
381
    AcpiGbl_RegMethodsExecuted          = FALSE;
Line 934... Line 382...
934
 
382
 
Line 935... Line 383...
935
    /* Hardware oriented */
383
    /* Hardware oriented */
936
 
384
 
Line 971... Line 419...
971
ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
419
ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
972
ACPI_EXPORT_SYMBOL (AcpiDbgLevel)
420
ACPI_EXPORT_SYMBOL (AcpiDbgLevel)
973
ACPI_EXPORT_SYMBOL (AcpiDbgLayer)
421
ACPI_EXPORT_SYMBOL (AcpiDbgLayer)
974
ACPI_EXPORT_SYMBOL (AcpiGpeCount)
422
ACPI_EXPORT_SYMBOL (AcpiGpeCount)
975
ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount)
423
ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount)
976
-
 
977
-