Use __DECONST to silence GCC. Make some private routines static.
[dragonfly.git] / sys / contrib / dev / acpica / tbconvrt.c
1 /******************************************************************************
2  *
3  * Module Name: tbconvrt - ACPI Table conversion utilities
4  *              $Revision: 47 $
5  *
6  *****************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13  * All rights 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 /* $DragonFly: src/sys/contrib/dev/acpica/Attic/tbconvrt.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $                                                               */
117
118 #define __TBCONVRT_C__
119
120 #include "acpi.h"
121 #include "actables.h"
122
123
124 #define _COMPONENT          ACPI_TABLES
125         ACPI_MODULE_NAME    ("tbconvrt")
126
127
128 /*******************************************************************************
129  *
130  * FUNCTION:    AcpiTbGetTableCount
131  *
132  * PARAMETERS:  RSDP            - Pointer to the RSDP
133  *              RSDT            - Pointer to the RSDT/XSDT
134  *
135  * RETURN:      The number of tables pointed to by the RSDT or XSDT.
136  *
137  * DESCRIPTION: Calculate the number of tables.  Automatically handles either
138  *              an RSDT or XSDT.
139  *
140  ******************************************************************************/
141
142 UINT32
143 AcpiTbGetTableCount (
144     RSDP_DESCRIPTOR         *RSDP,
145     ACPI_TABLE_HEADER       *RSDT)
146 {
147     UINT32                  PointerSize;
148
149
150     ACPI_FUNCTION_ENTRY ();
151
152
153 #if ACPI_MACHINE_WIDTH != 64
154
155     if (RSDP->Revision < 2)
156     {
157         PointerSize = sizeof (UINT32);
158     }
159     else
160 #endif
161     {
162         PointerSize = sizeof (UINT64);
163     }
164
165     /*
166      * Determine the number of tables pointed to by the RSDT/XSDT.
167      * This is defined by the ACPI Specification to be the number of
168      * pointers contained within the RSDT/XSDT.  The size of the pointers
169      * is architecture-dependent.
170      */
171     return ((RSDT->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize);
172 }
173
174
175 /*******************************************************************************
176  *
177  * FUNCTION:    AcpiTbConvertToXsdt
178  *
179  * PARAMETERS:  TableInfo       - Info about the RSDT
180  *
181  * RETURN:      Status
182  *
183  * DESCRIPTION: Convert an RSDT to an XSDT (internal common format)
184  *
185  ******************************************************************************/
186
187 ACPI_STATUS
188 AcpiTbConvertToXsdt (
189     ACPI_TABLE_DESC         *TableInfo)
190 {
191     ACPI_SIZE               TableSize;
192     UINT32                  i;
193     XSDT_DESCRIPTOR         *NewTable;
194
195
196     ACPI_FUNCTION_ENTRY ();
197
198
199     /* Compute size of the converted XSDT */
200
201     TableSize = ((ACPI_SIZE) AcpiGbl_RsdtTableCount * sizeof (UINT64)) +
202                     sizeof (ACPI_TABLE_HEADER);
203
204     /* Allocate an XSDT */
205
206     NewTable = ACPI_MEM_CALLOCATE (TableSize);
207     if (!NewTable)
208     {
209         return (AE_NO_MEMORY);
210     }
211
212     /* Copy the header and set the length */
213
214     ACPI_MEMCPY (NewTable, TableInfo->Pointer, sizeof (ACPI_TABLE_HEADER));
215     NewTable->Header.Length = (UINT32) TableSize;
216
217     /* Copy the table pointers */
218
219     for (i = 0; i < AcpiGbl_RsdtTableCount; i++)
220     {
221         if (AcpiGbl_RSDP->Revision < 2)
222         {
223             ACPI_STORE_ADDRESS (NewTable->TableOffsetEntry[i],
224                 ((RSDT_DESCRIPTOR_REV1 *) TableInfo->Pointer)->TableOffsetEntry[i]);
225         }
226         else
227         {
228             NewTable->TableOffsetEntry[i] =
229                 ((XSDT_DESCRIPTOR *) TableInfo->Pointer)->TableOffsetEntry[i];
230         }
231     }
232
233     /* Delete the original table (either mapped or in a buffer) */
234
235     AcpiTbDeleteSingleTable (TableInfo);
236
237     /* Point the table descriptor to the new table */
238
239     TableInfo->Pointer      = (ACPI_TABLE_HEADER *) NewTable;
240     TableInfo->Length       = TableSize;
241     TableInfo->Allocation   = ACPI_MEM_ALLOCATED;
242
243     return (AE_OK);
244 }
245
246
247 /*******************************************************************************
248  *
249  * FUNCTION:    AcpiTbConvertFadt1
250  *
251  * PARAMETERS:  LocalFadt       - Pointer to new FADT
252  *              OriginalFadt    - Pointer to old FADT
253  *
254  * RETURN:      Populates LocalFadt
255  *
256  * DESCRIPTION: Convert an ACPI 1.0 FADT to common internal format
257  *
258  ******************************************************************************/
259
260 static void
261 AcpiTbConvertFadt1 (
262     FADT_DESCRIPTOR_REV2   *LocalFadt,
263     FADT_DESCRIPTOR_REV1   *OriginalFadt)
264 {
265
266
267     /* ACPI 1.0 FACS */
268     /* The BIOS stored FADT should agree with Revision 1.0 */
269
270     /*
271      * Copy the table header and the common part of the tables.
272      *
273      * The 2.0 table is an extension of the 1.0 table, so the entire 1.0
274      * table can be copied first, then expand some fields to 64 bits.
275      */
276     ACPI_MEMCPY (LocalFadt, OriginalFadt, sizeof (FADT_DESCRIPTOR_REV1));
277
278     /* Convert table pointers to 64-bit fields */
279
280     ACPI_STORE_ADDRESS (LocalFadt->XFirmwareCtrl, LocalFadt->V1_FirmwareCtrl);
281     ACPI_STORE_ADDRESS (LocalFadt->XDsdt, LocalFadt->V1_Dsdt);
282
283     /*
284      * System Interrupt Model isn't used in ACPI 2.0 (LocalFadt->Reserved1 = 0;)
285      */
286
287     /*
288      * This field is set by the OEM to convey the preferred power management
289      * profile to OSPM. It doesn't have any 1.0 equivalence.  Since we don't
290      * know what kind of 32-bit system this is, we will use "unspecified".
291      */
292     LocalFadt->Prefer_PM_Profile = PM_UNSPECIFIED;
293
294     /*
295      * Processor Performance State Control. This is the value OSPM writes to
296      * the SMI_CMD register to assume processor performance state control
297      * responsibility. There isn't any equivalence in 1.0, leave it zeroed.
298      */
299     LocalFadt->PstateCnt = 0;
300
301     /*
302      * Support for the _CST object and C States change notification.
303      * This data item hasn't any 1.0 equivalence so leave it zero.
304      */
305     LocalFadt->CstCnt = 0;
306
307     /*
308      * Since there isn't any equivalence in 1.0 and since it highly likely
309      * that a 1.0 system has legacy support.
310      */
311     LocalFadt->IapcBootArch = BAF_LEGACY_DEVICES;
312
313     /*
314      * Convert the V1.0 block addresses to V2.0 GAS structures
315      */
316     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1aEvtBlk, LocalFadt->Pm1EvtLen,  LocalFadt->V1_Pm1aEvtBlk);
317     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1bEvtBlk, LocalFadt->Pm1EvtLen,  LocalFadt->V1_Pm1bEvtBlk);
318     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1aCntBlk, LocalFadt->Pm1CntLen,  LocalFadt->V1_Pm1aCntBlk);
319     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1bCntBlk, LocalFadt->Pm1CntLen,  LocalFadt->V1_Pm1bCntBlk);
320     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm2CntBlk,  LocalFadt->Pm2CntLen,  LocalFadt->V1_Pm2CntBlk);
321     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPmTmrBlk,   LocalFadt->PmTmLen,    LocalFadt->V1_PmTmrBlk);
322     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XGpe0Blk,    0,                     LocalFadt->V1_Gpe0Blk);
323     ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XGpe1Blk,    0,                     LocalFadt->V1_Gpe1Blk);
324 }
325
326
327 /*******************************************************************************
328  *
329  * FUNCTION:    AcpiTbConvertFadt2
330  *
331  * PARAMETERS:  LocalFadt       - Pointer to new FADT
332  *              OriginalFadt    - Pointer to old FADT
333  *
334  * RETURN:      Populates LocalFadt
335  *
336  * DESCRIPTION: Convert an ACPI 2.0 FADT to common internal format.
337  *              Handles optional "X" fields.
338  *
339  ******************************************************************************/
340
341 static void
342 AcpiTbConvertFadt2 (
343     FADT_DESCRIPTOR_REV2   *LocalFadt,
344     FADT_DESCRIPTOR_REV2   *OriginalFadt)
345 {
346
347     /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */
348
349     ACPI_MEMCPY (LocalFadt, OriginalFadt, sizeof (FADT_DESCRIPTOR_REV2));
350
351     /*
352      * "X" fields are optional extensions to the original V1.0 fields, so
353      * we must selectively expand V1.0 fields if the corresponding X field
354      * is zero.
355      */
356     if (!(ACPI_GET_ADDRESS (LocalFadt->XFirmwareCtrl)))
357     {
358         ACPI_STORE_ADDRESS (LocalFadt->XFirmwareCtrl, LocalFadt->V1_FirmwareCtrl);
359     }
360
361     if (!(ACPI_GET_ADDRESS (LocalFadt->XDsdt)))
362     {
363         ACPI_STORE_ADDRESS (LocalFadt->XDsdt, LocalFadt->V1_Dsdt);
364     }
365
366     if (!(ACPI_GET_ADDRESS (LocalFadt->XPm1aEvtBlk.Address)))
367     {
368         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1aEvtBlk,
369             LocalFadt->Pm1EvtLen,  LocalFadt->V1_Pm1aEvtBlk);
370     }
371
372     if (!(ACPI_GET_ADDRESS (LocalFadt->XPm1bEvtBlk.Address)))
373     {
374         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1bEvtBlk,
375             LocalFadt->Pm1EvtLen,  LocalFadt->V1_Pm1bEvtBlk);
376     }
377
378     if (!(ACPI_GET_ADDRESS (LocalFadt->XPm1aCntBlk.Address)))
379     {
380         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1aCntBlk,
381             LocalFadt->Pm1CntLen,  LocalFadt->V1_Pm1aCntBlk);
382     }
383
384     if (!(ACPI_GET_ADDRESS (LocalFadt->XPm1bCntBlk.Address)))
385     {
386         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm1bCntBlk,
387             LocalFadt->Pm1CntLen,  LocalFadt->V1_Pm1bCntBlk);
388     }
389
390     if (!(ACPI_GET_ADDRESS (LocalFadt->XPm2CntBlk.Address)))
391     {
392         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPm2CntBlk,
393             LocalFadt->Pm2CntLen,  LocalFadt->V1_Pm2CntBlk);
394     }
395
396     if (!(ACPI_GET_ADDRESS (LocalFadt->XPmTmrBlk.Address)))
397     {
398         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XPmTmrBlk,
399             LocalFadt->PmTmLen,    LocalFadt->V1_PmTmrBlk);
400     }
401
402     if (!(ACPI_GET_ADDRESS (LocalFadt->XGpe0Blk.Address)))
403     {
404         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XGpe0Blk,
405             0, LocalFadt->V1_Gpe0Blk);
406     }
407
408     if (!(ACPI_GET_ADDRESS (LocalFadt->XGpe1Blk.Address)))
409     {
410         ASL_BUILD_GAS_FROM_V1_ENTRY (LocalFadt->XGpe1Blk,
411             0, LocalFadt->V1_Gpe1Blk);
412     }
413 }
414
415
416 /*******************************************************************************
417  *
418  * FUNCTION:    AcpiTbConvertTableFadt
419  *
420  * PARAMETERS:  None
421  *
422  * RETURN:      Status
423  *
424  * DESCRIPTION: Converts a BIOS supplied ACPI 1.0 FADT to a local
425  *              ACPI 2.0 FADT. If the BIOS supplied a 2.0 FADT then it is simply
426  *              copied to the local FADT.  The ACPI CA software uses this
427  *              local FADT. Thus a significant amount of special #ifdef
428  *              type codeing is saved.
429  *
430  ******************************************************************************/
431
432 ACPI_STATUS
433 AcpiTbConvertTableFadt (void)
434 {
435     FADT_DESCRIPTOR_REV2   *LocalFadt;
436     ACPI_TABLE_DESC        *TableDesc;
437
438
439     ACPI_FUNCTION_TRACE ("TbConvertTableFadt");
440
441
442     /*
443      * AcpiGbl_FADT is valid
444      * Allocate and zero the 2.0 FADT buffer
445      */
446     LocalFadt = ACPI_MEM_CALLOCATE (sizeof (FADT_DESCRIPTOR_REV2));
447     if (LocalFadt == NULL)
448     {
449         return_ACPI_STATUS (AE_NO_MEMORY);
450     }
451
452     /*
453      * FADT length and version validation.  The table must be at least as
454      * long as the version 1.0 FADT
455      */
456     if (AcpiGbl_FADT->Header.Length < sizeof (FADT_DESCRIPTOR_REV1))
457     {
458         ACPI_REPORT_ERROR (("Invalid FADT table length: 0x%X\n", AcpiGbl_FADT->Header.Length));
459         return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);
460     }
461
462     if (AcpiGbl_FADT->Header.Revision >= FADT2_REVISION_ID)
463     {
464         if (AcpiGbl_FADT->Header.Length < sizeof (FADT_DESCRIPTOR_REV2))
465         {
466             /* Length is too short to be a V2.0 table */
467
468             ACPI_REPORT_WARNING (("Inconsistent FADT length (0x%X) and revision (0x%X), using FADT V1.0 portion of table\n",
469                         AcpiGbl_FADT->Header.Length, AcpiGbl_FADT->Header.Revision));
470
471             AcpiTbConvertFadt1 (LocalFadt, (void *) AcpiGbl_FADT);
472         }
473         else
474         {
475             /* Valid V2.0 table */
476
477             AcpiTbConvertFadt2 (LocalFadt, AcpiGbl_FADT);
478         }
479     }
480     else
481     {
482         /* Valid V1.0 table */
483
484         AcpiTbConvertFadt1 (LocalFadt, (void *) AcpiGbl_FADT);
485     }
486
487     /*
488      * Global FADT pointer will point to the new common V2.0 FADT
489      */
490     AcpiGbl_FADT = LocalFadt;
491     AcpiGbl_FADT->Header.Length = sizeof (FADT_DESCRIPTOR);
492
493     /* Free the original table */
494
495     TableDesc = &AcpiGbl_AcpiTables[ACPI_TABLE_FADT];
496     AcpiTbDeleteSingleTable (TableDesc);
497
498     /* Install the new table */
499
500     TableDesc->Pointer      = (ACPI_TABLE_HEADER *) AcpiGbl_FADT;
501     TableDesc->Allocation   = ACPI_MEM_ALLOCATED;
502     TableDesc->Length       = sizeof (FADT_DESCRIPTOR_REV2);
503
504     /* Dump the entire FADT */
505
506     ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
507         "Hex dump of common internal FADT, size %d (%X)\n",
508         AcpiGbl_FADT->Header.Length, AcpiGbl_FADT->Header.Length));
509     ACPI_DUMP_BUFFER ((UINT8 *) (AcpiGbl_FADT), AcpiGbl_FADT->Header.Length);
510
511     return_ACPI_STATUS (AE_OK);
512 }
513
514
515 /*******************************************************************************
516  *
517  * FUNCTION:    AcpiTbConvertTableFacs
518  *
519  * PARAMETERS:  TableInfo       - Info for currently installad FACS
520  *
521  * RETURN:      Status
522  *
523  * DESCRIPTION: Convert ACPI 1.0 and ACPI 2.0 FACS to a common internal
524  *              table format.
525  *
526  ******************************************************************************/
527
528 ACPI_STATUS
529 AcpiTbBuildCommonFacs (
530     ACPI_TABLE_DESC         *TableInfo)
531 {
532
533     ACPI_FUNCTION_TRACE ("TbBuildCommonFacs");
534
535
536     /* Absolute minimum length is 24, but the ACPI spec says 64 */
537
538     if (AcpiGbl_FACS->Length < 24)
539     {
540         ACPI_REPORT_ERROR (("Invalid FACS table length: 0x%X\n", AcpiGbl_FACS->Length));
541         return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);
542     }
543
544     if (AcpiGbl_FACS->Length < 64)
545     {
546         ACPI_REPORT_WARNING (("FACS is shorter than the ACPI specification allows: 0x%X, using anyway\n",
547             AcpiGbl_FACS->Length));
548     }
549
550     /* Copy fields to the new FACS */
551
552     AcpiGbl_CommonFACS.GlobalLock = &(AcpiGbl_FACS->GlobalLock);
553
554     if ((AcpiGbl_RSDP->Revision < 2) ||
555         (AcpiGbl_FACS->Length < 32)  ||
556         (!(ACPI_GET_ADDRESS (AcpiGbl_FACS->XFirmwareWakingVector))))
557     {
558         /* ACPI 1.0 FACS or short table or optional X_ field is zero */
559
560         AcpiGbl_CommonFACS.FirmwareWakingVector = ACPI_CAST_PTR (UINT64, &(AcpiGbl_FACS->FirmwareWakingVector));
561         AcpiGbl_CommonFACS.VectorWidth = 32;
562     }
563     else
564     {
565         /* ACPI 2.0 FACS with valid X_ field */
566
567         AcpiGbl_CommonFACS.FirmwareWakingVector = &AcpiGbl_FACS->XFirmwareWakingVector;
568         AcpiGbl_CommonFACS.VectorWidth = 64;
569     }
570
571     return_ACPI_STATUS (AE_OK);
572 }
573
574