Subversion Repositories Kolibri OS

Rev

Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
Line 1... Line 1...
1
/******************************************************************************
1
/******************************************************************************
2
 *
2
 *
3
 * Module Name: aetables - Miscellaneous ACPI tables for acpiexec utility
3
 * Module Name: aetables - ACPI table setup/install for acpiexec utility
4
 *
4
 *
5
 *****************************************************************************/
5
 *****************************************************************************/
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 112... Line 112...
112
 * such license, approval or letter.
112
 * such license, approval or letter.
113
 *
113
 *
114
 *****************************************************************************/
114
 *****************************************************************************/
Line 115... Line 115...
115
 
115
 
-
 
116
#include "aecommon.h"
Line 116... Line 117...
116
#include "aecommon.h"
117
#include "aetables.h"
117
 
118
 
Line 118... Line 119...
118
#define _COMPONENT          ACPI_TOOLS
119
#define _COMPONENT          ACPI_TOOLS
Line 127... Line 128...
127
 
128
 
128
ACPI_PHYSICAL_ADDRESS
129
ACPI_PHYSICAL_ADDRESS
129
AeLocalGetRootPointer (
130
AeLocalGetRootPointer (
Line 130... Line -...
130
    void);
-
 
131
 
131
    void);
132
/*
-
 
Line 133... Line 132...
133
 * Misc ACPI tables to be installed
132
 
Line 134... Line -...
134
 */
-
 
135
 
-
 
136
/* Default DSDT. This will be replaced with the input DSDT */
-
 
137
 
-
 
138
unsigned char DsdtCode[] =
133
/* User table (DSDT) */
139
{
-
 
140
    0x44,0x53,0x44,0x54,0x24,0x00,0x00,0x00,  /* 00000000    "DSDT$..." */
-
 
141
    0x02,0x6F,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    ".oIntel." */
-
 
142
    0x4E,0x75,0x6C,0x6C,0x44,0x53,0x44,0x54,  /* 00000010    "NullDSDT" */
-
 
143
    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-
 
144
    0x04,0x12,0x08,0x20,
-
 
145
};
-
 
146
 
-
 
147
unsigned char LocalDsdtCode[] =
-
 
148
{
-
 
149
    0x44,0x53,0x44,0x54,0x24,0x00,0x00,0x00,  /* 00000000    "DSDT$..." */
-
 
150
    0x02,0x2C,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    ".,Intel." */
-
 
151
    0x4C,0x6F,0x63,0x61,0x6C,0x00,0x00,0x00,  /* 00000010    "Local..." */
-
 
152
    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-
 
153
    0x30,0x07,0x09,0x20,
134
 
154
};
135
static ACPI_TABLE_HEADER        *DsdtToInstallOverride;
155
 
-
 
156
/* Several example SSDTs */
-
 
157
 
-
 
158
unsigned char Ssdt1Code[] = /* Has method _T98 */
-
 
159
{
-
 
160
    0x53,0x53,0x44,0x54,0x30,0x00,0x00,0x00,  /* 00000000    "SSDT0..." */
-
 
161
    0x01,0xB8,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    "..Intel." */
-
 
162
    0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00,  /* 00000010    "Many...." */
-
 
163
    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-
 
164
    0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54,  /* 00000020    "$.. .._T" */
136
 
165
    0x39,0x38,0x00,0x70,0x0A,0x04,0x60,0xA4,  /* 00000028    "98.p..`." */
-
 
166
};
-
 
167
 
-
 
168
unsigned char Ssdt2Code[] = /* Has method _T99 */
-
 
169
{
-
 
170
    0x53,0x53,0x44,0x54,0x30,0x00,0x00,0x00,  /* 00000000    "SSDT0..." */
-
 
171
    0x01,0xB7,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    "..Intel." */
-
 
172
    0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00,  /* 00000010    "Many...." */
-
 
173
    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-
 
174
    0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54,  /* 00000020    "$.. .._T" */
137
/* Non-AML tables that are constructed locally and installed */
175
    0x39,0x39,0x00,0x70,0x0A,0x04,0x60,0xA4,  /* 00000028    "99.p..`." */
-
 
176
};
-
 
177
 
-
 
178
unsigned char Ssdt3Code[] = /* Has method _T97 */
-
 
179
{
-
 
180
    0x54,0x53,0x44,0x54,0x30,0x00,0x00,0x00,  /* 00000000    "TSDT0..." */
-
 
181
    0x01,0xB8,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    "..Intel." */
-
 
182
    0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00,  /* 00000010    "Many...." */
-
 
183
    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-
 
184
    0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54,  /* 00000020    "$.. .._T" */
-
 
185
    0x39,0x37,0x00,0x70,0x0A,0x04,0x60,0xA4,  /* 00000028    "97.p..`." */
-
 
186
};
-
 
187
 
-
 
188
/* Example OEM table */
-
 
189
 
-
 
190
unsigned char Oem1Code[] =
-
 
191
{
-
 
192
    0x4F,0x45,0x4D,0x31,0x38,0x00,0x00,0x00,  /* 00000000    "OEM18..." */
-
 
193
    0x01,0x4B,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    ".KIntel." */
-
 
194
    0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00,  /* 00000010    "Many...." */
-
 
195
    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-
 
196
    0x18,0x09,0x03,0x20,0x08,0x5F,0x58,0x54,  /* 00000020    "... ._XT" */
-
 
197
    0x32,0x0A,0x04,0x14,0x0C,0x5F,0x58,0x54,  /* 00000028    "2...._XT" */
138
 
198
    0x31,0x00,0x70,0x01,0x5F,0x58,0x54,0x32,  /* 00000030    "1.p._XT2" */
-
 
199
};
-
 
200
 
-
 
201
/* ASL source for this table is at the end of this file */
-
 
202
 
-
 
203
unsigned char OemxCode[] =
-
 
204
{
-
 
205
    0x4F,0x45,0x4D,0x58,0xB0,0x00,0x00,0x00,  /* 00000000    "OEMX...." */
-
 
206
    0x02,0x54,0x4D,0x79,0x4F,0x45,0x4D,0x00,  /* 00000008    ".TMyOEM." */
-
 
207
    0x54,0x65,0x73,0x74,0x00,0x00,0x00,0x00,  /* 00000010    "Test...." */
-
 
208
    0x32,0x04,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "2...INTL" */
-
 
209
    0x31,0x03,0x10,0x20,0x14,0x1D,0x5F,0x49,  /* 00000020    "1.. .._I" */
-
 
210
    0x4E,0x49,0x00,0x70,0x0D,0x54,0x61,0x62,  /* 00000028    "NI.p.Tab" */
-
 
211
    0x6C,0x65,0x20,0x4F,0x45,0x4D,0x58,0x20,  /* 00000030    "le OEMX " */
-
 
212
    0x72,0x75,0x6E,0x6E,0x69,0x6E,0x67,0x00,  /* 00000038    "running." */
-
 
213
    0x5B,0x31,0x10,0x22,0x5C,0x5F,0x47,0x50,  /* 00000040    "[1."\_GP" */
-
 
214
    0x45,0x14,0x06,0x5F,0x45,0x30,0x37,0x00,  /* 00000048    "E.._E07." */
-
 
215
    0x14,0x06,0x5F,0x45,0x32,0x32,0x00,0x14,  /* 00000050    ".._E22.." */
-
 
216
    0x06,0x5F,0x4C,0x33,0x31,0x00,0x14,0x06,  /* 00000058    "._L31..." */
-
 
217
    0x5F,0x4C,0x36,0x36,0x00,0x5B,0x82,0x10,  /* 00000060    "_L66.[.." */
-
 
218
    0x4F,0x45,0x4D,0x31,0x08,0x5F,0x50,0x52,  /* 00000068    "OEM1._PR" */
-
 
219
    0x57,0x12,0x05,0x02,0x0A,0x07,0x00,0x5B,  /* 00000070    "W......[" */
-
 
220
    0x82,0x10,0x4F,0x45,0x4D,0x32,0x08,0x5F,  /* 00000078    "..OEM2._" */
-
 
221
    0x50,0x52,0x57,0x12,0x05,0x02,0x0A,0x66,  /* 00000080    "PRW....f" */
-
 
222
    0x00,0x10,0x26,0x5C,0x47,0x50,0x45,0x32,  /* 00000088    "..&\GPE2" */
-
 
223
    0x14,0x06,0x5F,0x4C,0x30,0x31,0x00,0x14,  /* 00000090    ".._L01.." */
-
 
Line 224... Line 139...
224
    0x06,0x5F,0x45,0x30,0x37,0x00,0x08,0x5F,  /* 00000098    "._E07.._" */
139
static ACPI_TABLE_RSDP          LocalRSDP;
225
    0x50,0x52,0x57,0x12,0x0C,0x02,0x12,0x08,  /* 000000A0    "PRW....." */
-
 
226
    0x02,0x5C,0x47,0x50,0x45,0x32,0x01,0x00   /* 000000A8    ".\GPE2.." */
-
 
227
};
140
static ACPI_TABLE_FACS          LocalFACS;
228
 
-
 
229
/*
-
 
230
 * Example installable control method
-
 
231
 *
141
static ACPI_TABLE_HEADER        LocalTEST;
232
 * DefinitionBlock ("", "DSDT", 2, "Intel", "MTHDTEST", 0x20090512)
-
 
233
 * {
-
 
234
 *     Method (\_SI_._T97, 1, Serialized)
-
 
235
 *     {
-
 
236
 *         Store ("Example installed method", Debug)
-
 
237
 *         Store (Arg0, Debug)
-
 
238
 *         Return ()
142
static ACPI_TABLE_HEADER        LocalBADTABLE;
239
 *     }
143
 
240
 * }
-
 
241
 *
-
 
242
 * Compiled byte code below.
-
 
243
 */
-
 
244
unsigned char MethodCode[] =
-
 
245
{
-
 
246
    0x44,0x53,0x44,0x54,0x53,0x00,0x00,0x00,  /* 00000000    "DSDTS..." */
-
 
247
    0x02,0xF9,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    "..Intel." */
-
 
248
    0x4D,0x54,0x48,0x44,0x54,0x45,0x53,0x54,  /* 00000010    "MTHDTEST" */
-
 
249
    0x12,0x05,0x09,0x20,0x49,0x4E,0x54,0x4C,  /* 00000018    "... INTL" */
-
 
250
    0x22,0x04,0x09,0x20,0x14,0x2E,0x2E,0x5F,  /* 00000020    "".. ..._" */
-
 
251
    0x54,0x49,0x5F,0x5F,0x54,0x39,0x37,0x09,  /* 00000028    "SI__T97." */
-
 
252
    0x70,0x0D,0x45,0x78,0x61,0x6D,0x70,0x6C,  /* 00000030    "p.Exampl" */
-
 
253
    0x65,0x20,0x69,0x6E,0x73,0x74,0x61,0x6C,  /* 00000038    "e instal" */
-
 
Line 254... Line 144...
254
    0x6C,0x65,0x64,0x20,0x6D,0x65,0x74,0x68,  /* 00000040    "led meth" */
144
/*
255
    0x6F,0x64,0x00,0x5B,0x31,0x70,0x68,0x5B,  /* 00000048    "od.[1ph[" */
145
 * We need a local FADT so that the hardware subcomponent will function,
256
    0x31,0xA4,0x00,
-
 
257
};
146
 * even though the underlying OSD HW access functions don't do anything.
258
 
147
 */
259
 
-
 
260
/*
-
 
261
 * We need a local FADT so that the hardware subcomponent will function,
-
 
262
 * even though the underlying OSD HW access functions don't do
-
 
263
 * anything.
-
 
264
 */
-
 
265
ACPI_TABLE_HEADER           *DsdtToInstallOverride;
148
static ACPI_TABLE_FADT          LocalFADT;
Line 266... Line 149...
266
ACPI_TABLE_RSDP             LocalRSDP;
149
 
-
 
150
/*
267
ACPI_TABLE_FADT             LocalFADT;
151
 * Use XSDT so that both 32- and 64-bit versions of this utility will
Line 268... Line 152...
268
ACPI_TABLE_FACS             LocalFACS;
152
 * function automatically.
269
ACPI_TABLE_HEADER           LocalTEST;
153
 */
Line 315... Line 199...
315
 * PARAMETERS:  TableCount      - Number of tables on the command line
199
 * PARAMETERS:  TableCount      - Number of tables on the command line
316
 *              TableList       - List of actual tables from files
200
 *              TableList       - List of actual tables from files
317
 *
201
 *
318
 * RETURN:      Status
202
 * RETURN:      Status
319
 *
203
 *
320
 * DESCRIPTION: Build a complete ACPI table chain, with a local RSDP, RSDT,
204
 * DESCRIPTION: Build a complete ACPI table chain, with a local RSDP, XSDT,
321
 *              FADT, and several other test tables.
205
 *              FADT, and several other test tables.
322
 *
206
 *
323
 *****************************************************************************/
207
 *****************************************************************************/
Line 324... Line 208...
324
 
208
 
325
ACPI_STATUS
209
ACPI_STATUS
326
AeBuildLocalTables (
210
AeBuildLocalTables (
327
    UINT32                  TableCount,
211
    UINT32                  TableCount,
328
    AE_TABLE_DESC           *TableList)
212
    AE_TABLE_DESC           *TableList)
329
{
213
{
330
    ACPI_PHYSICAL_ADDRESS   DsdtAddress = 0;
214
    ACPI_PHYSICAL_ADDRESS   DsdtAddress = 0;
331
    UINT32                  RsdtSize;
215
    UINT32                  XsdtSize;
332
    AE_TABLE_DESC           *NextTable;
216
    AE_TABLE_DESC           *NextTable;
333
    UINT32                  NextIndex;
217
    UINT32                  NextIndex;
Line 334... Line 218...
334
    ACPI_TABLE_FADT         *ExternalFadt = NULL;
218
    ACPI_TABLE_FADT         *ExternalFadt = NULL;
335
 
219
 
336
 
220
 
337
    /*
221
    /*
338
     * Update the table count. For DSDT, it is not put into the RSDT. For
222
     * Update the table count. For DSDT, it is not put into the XSDT. For
339
     * FADT, this is already accounted for since we usually install a
223
     * FADT, this is already accounted for since we usually install a
340
     * local FADT.
224
     * local FADT.
Line 348... Line 232...
348
            TableCount--;
232
            TableCount--;
349
        }
233
        }
350
        NextTable = NextTable->Next;
234
        NextTable = NextTable->Next;
351
    }
235
    }
Line 352... Line 236...
352
 
236
 
Line 353... Line 237...
353
    RsdtSize = BASE_RSDT_SIZE + (TableCount * sizeof (UINT32));
237
    XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64));
Line 354... Line 238...
354
 
238
 
355
    /* Build an RSDT */
239
    /* Build an XSDT */
356
 
240
 
357
    LocalRSDT = AcpiOsAllocate (RsdtSize);
241
    LocalXSDT = AcpiOsAllocate (XsdtSize);
358
    if (!LocalRSDT)
242
    if (!LocalXSDT)
Line 359... Line 243...
359
    {
243
    {
360
        return AE_NO_MEMORY;
244
        return (AE_NO_MEMORY);
361
    }
245
    }
-
 
246
 
Line 362... Line 247...
362
 
247
    ACPI_MEMSET (LocalXSDT, 0, XsdtSize);
363
    ACPI_MEMSET (LocalRSDT, 0, RsdtSize);
248
    ACPI_STRNCPY (LocalXSDT->Header.Signature, ACPI_SIG_XSDT, 4);
364
    ACPI_STRNCPY (LocalRSDT->Header.Signature, ACPI_SIG_RSDT, 4);
249
    LocalXSDT->Header.Length = XsdtSize;
Line 365... Line 250...
365
    LocalRSDT->Header.Length = RsdtSize;
250
    LocalXSDT->Header.Revision = 1;
Line 366... Line 251...
366
 
251
 
367
    LocalRSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalTEST);
252
    LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalTEST);
Line 368... Line 253...
368
    LocalRSDT->TableOffsetEntry[1] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE);
253
    LocalXSDT->TableOffsetEntry[1] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE);
Line 369... Line 254...
369
    LocalRSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);
254
    LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);
Line 370... Line 255...
370
 
255
 
Line 371... Line 256...
371
    /* Install two SSDTs to test multiple table support */
256
    /* Install two SSDTs to test multiple table support */
-
 
257
 
-
 
258
    LocalXSDT->TableOffsetEntry[3] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code);
-
 
259
    LocalXSDT->TableOffsetEntry[4] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code);
-
 
260
 
Line 372... Line 261...
372
 
261
    /* Install the OEM1 table to test LoadTable */
373
    LocalRSDT->TableOffsetEntry[3] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code);
262
 
374
    LocalRSDT->TableOffsetEntry[4] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code);
263
    LocalXSDT->TableOffsetEntry[5] = ACPI_PTR_TO_PHYSADDR (&Oem1Code);
375
 
264
 
376
    /* Install the OEM1 table to test LoadTable */
265
    /* Install the OEMx table to test LoadTable */
377
 
266
 
378
    LocalRSDT->TableOffsetEntry[5] = ACPI_PTR_TO_PHYSADDR (&Oem1Code);
267
    LocalXSDT->TableOffsetEntry[6] = ACPI_PTR_TO_PHYSADDR (&OemxCode);
379
 
268
 
380
    /* Install the OEMx table to test LoadTable */
269
     /* Install the ECDT table to test _REG */
381
 
270
 
382
    LocalRSDT->TableOffsetEntry[6] = ACPI_PTR_TO_PHYSADDR (&OemxCode);
271
    LocalXSDT->TableOffsetEntry[7] = ACPI_PTR_TO_PHYSADDR (&EcdtCode);
383
 
272
 
384
    /*
273
   /*
385
     * Install the user tables. The DSDT must be installed in the FADT.
274
     * Install the user tables. The DSDT must be installed in the FADT.
386
     * All other tables are installed directly into the RSDT.
275
     * All other tables are installed directly into the XSDT.
387
     */
276
     */
388
    NextIndex = BASE_RSDT_TABLES;
277
    NextIndex = BASE_XSDT_TABLES;
389
    NextTable = TableList;
278
    NextTable = TableList;
390
    while (NextTable)
279
    while (NextTable)
Line 391... Line 280...
391
    {
280
    {
Line 392... Line 281...
392
        /*
281
        /*
393
         * Incoming DSDT or FADT are special cases. All other tables are
282
         * Incoming DSDT or FADT are special cases. All other tables are
394
         * just immediately installed into the RSDT.
283
         * just immediately installed into the XSDT.
395
         */
284
         */
396
        if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT))
285
        if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT))
397
        {
286
        {
398
            if (DsdtAddress)
287
            if (DsdtAddress)
399
            {
288
            {
400
                printf ("Already found a DSDT, only one allowed\n");
289
                printf ("Already found a DSDT, only one allowed\n");
401
                return AE_ALREADY_EXISTS;
290
                return (AE_ALREADY_EXISTS);
402
            }
291
            }
Line 403... Line 292...
403
 
292
 
404
            /* The incoming user table is a DSDT */
293
            /* The incoming user table is a DSDT */
405
 
294
 
Line 406... Line 295...
406
            DsdtAddress = ACPI_PTR_TO_PHYSADDR (&DsdtCode);
295
            DsdtAddress = ACPI_PTR_TO_PHYSADDR (&DsdtCode);
407
            DsdtToInstallOverride = NextTable->Table;
296
            DsdtToInstallOverride = NextTable->Table;
Line 425... Line 314...
425
    /* Build an RSDP */
314
    /* Build an RSDP */
Line 426... Line 315...
426
 
315
 
427
    ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));
316
    ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));
428
    ACPI_MEMCPY (LocalRSDP.Signature, ACPI_SIG_RSDP, 8);
317
    ACPI_MEMCPY (LocalRSDP.Signature, ACPI_SIG_RSDP, 8);
429
    ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6);
318
    ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6);
430
    LocalRSDP.Revision = 1;
319
    LocalRSDP.Revision = 2;
431
    LocalRSDP.RsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalRSDT);
320
    LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT);
Line 432... Line 321...
432
    LocalRSDP.Length = sizeof (ACPI_TABLE_RSDT);
321
    LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT);
Line 433... Line 322...
433
 
322
 
434
    /* Set checksums for both RSDT and RSDP */
323
    /* Set checksums for both XSDT and RSDP */
435
 
324
 
436
    LocalRSDT->Header.Checksum = (UINT8) -AcpiTbChecksum (
325
    LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum (
Line 437... Line 326...
437
        (void *) LocalRSDT, LocalRSDT->Header.Length);
326
        (void *) LocalXSDT, LocalXSDT->Header.Length);
438
    LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (
327
    LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (
Line 474... Line 363...
474
        ACPI_MEMSET (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT));
363
        ACPI_MEMSET (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT));
475
        ACPI_STRNCPY (LocalFADT.Header.Signature, ACPI_SIG_FADT, 4);
364
        ACPI_STRNCPY (LocalFADT.Header.Signature, ACPI_SIG_FADT, 4);
Line 476... Line 365...
476
 
365
 
Line 477... Line 366...
477
        /* Setup FADT header and DSDT/FACS addresses */
366
        /* Setup FADT header and DSDT/FACS addresses */
478
 
367
 
Line 479... Line 368...
479
        LocalFADT.Dsdt = DsdtAddress;
368
        LocalFADT.Dsdt = 0;
480
        LocalFADT.Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
369
        LocalFADT.Facs = 0;
Line 481... Line 370...
481
 
370
 
482
        LocalFADT.XDsdt = DsdtAddress;
371
        LocalFADT.XDsdt = DsdtAddress;
Line 483... Line 372...
483
        LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
372
        LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
Line 484... Line 373...
484
 
373
 
-
 
374
        LocalFADT.Header.Revision = 3;
-
 
375
        LocalFADT.Header.Length = sizeof (ACPI_TABLE_FADT);
485
        LocalFADT.Header.Revision = 3;
376
 
-
 
377
        /* Miscellaneous FADT fields */
486
        LocalFADT.Header.Length = sizeof (ACPI_TABLE_FADT);
378
 
Line 487... Line 379...
487
 
379
        LocalFADT.Gpe0BlockLength = 16;
488
        /* Miscellaneous FADT fields */
-
 
489
 
-
 
490
        LocalFADT.Gpe0BlockLength = 16;
-
 
491
        LocalFADT.Gpe1BlockLength = 6;
-
 
492
        LocalFADT.Gpe1Base = 96;
-
 
493
 
-
 
494
        LocalFADT.Pm1EventLength = 4;
380
        LocalFADT.Gpe0Block = 0x00001234;
495
        LocalFADT.Pm1ControlLength = 2;
381
 
-
 
382
        LocalFADT.Gpe1BlockLength = 6;
496
        LocalFADT.PmTimerLength  = 4;
383
        LocalFADT.Gpe1Block = 0x00005678;
497
 
384
        LocalFADT.Gpe1Base = 96;
Line -... Line 385...
-
 
385
 
-
 
386
        LocalFADT.Pm1EventLength = 4;
-
 
387
        LocalFADT.Pm1aEventBlock = 0x00001aaa;
-
 
388
        LocalFADT.Pm1bEventBlock = 0x00001bbb;
-
 
389
 
-
 
390
        LocalFADT.Pm1ControlLength = 2;
498
        LocalFADT.Gpe0Block = 0x00001234;
391
        LocalFADT.Pm1aControlBlock = 0xB0;
Line 499... Line 392...
499
        LocalFADT.Gpe1Block = 0x00005678;
392
 
500
 
393
        LocalFADT.PmTimerLength = 4;
501
        LocalFADT.Pm1aEventBlock = 0x00001aaa;
394
        LocalFADT.PmTimerBlock = 0xA0;
Line 522... Line 415...
522
    ACPI_STRNCPY (LocalFACS.Signature, ACPI_SIG_FACS, 4);
415
    ACPI_STRNCPY (LocalFACS.Signature, ACPI_SIG_FACS, 4);
Line 523... Line 416...
523
 
416
 
524
    LocalFACS.Length = sizeof (ACPI_TABLE_FACS);
417
    LocalFACS.Length = sizeof (ACPI_TABLE_FACS);
Line -... Line 418...
-
 
418
    LocalFACS.GlobalLock = 0x11AA0011;
525
    LocalFACS.GlobalLock = 0x11AA0011;
419
 
-
 
420
    /*
526
 
421
     * Build a fake table [TEST] so that we make sure that the
527
    /* Build a fake table [TEST] so that we make sure that the CA core ignores it */
422
     * ACPICA core ignores it
528
 
423
     */
Line 529... Line 424...
529
    ACPI_MEMSET (&LocalTEST, 0, sizeof (ACPI_TABLE_HEADER));
424
    ACPI_MEMSET (&LocalTEST, 0, sizeof (ACPI_TABLE_HEADER));
530
    ACPI_STRNCPY (LocalTEST.Signature, "TEST", 4);
425
    ACPI_STRNCPY (LocalTEST.Signature, "TEST", 4);
531
 
426
 
532
    LocalTEST.Revision = 1;
427
    LocalTEST.Revision = 1;
Line -... Line 428...
-
 
428
    LocalTEST.Length = sizeof (ACPI_TABLE_HEADER);
533
    LocalTEST.Length = sizeof (ACPI_TABLE_HEADER);
429
    LocalTEST.Checksum = (UINT8) -AcpiTbChecksum (
-
 
430
        (void *) &LocalTEST, LocalTEST.Length);
534
    LocalTEST.Checksum = (UINT8) -AcpiTbChecksum (
431
 
535
        (void *) &LocalTEST, LocalTEST.Length);
432
    /*
536
 
433
     * Build a fake table with a bad signature [BAD!] so that we make
Line 537... Line 434...
537
    /* Build a fake table with a bad signature [BAD!] so that we make sure that the CA core ignores it */
434
     * sure that the ACPICA core ignores it
538
 
435
     */
Line 564... Line 461...
564
AeInstallTables (
461
AeInstallTables (
565
    void)
462
    void)
566
{
463
{
567
    ACPI_STATUS             Status;
464
    ACPI_STATUS             Status;
Line -... Line 465...
-
 
465
 
568
 
466
 
-
 
467
    Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE);
-
 
468
    AE_CHECK_OK (AcpiInitializeTables, Status);
569
    Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE);
469
 
-
 
470
    Status = AcpiReallocateRootTable ();
-
 
471
    AE_CHECK_OK (AcpiReallocateRootTable, Status);
570
    Status = AcpiReallocateRootTable ();
472
 
-
 
473
    Status = AcpiLoadTables ();
Line 571... Line 474...
571
    Status = AcpiLoadTables ();
474
    AE_CHECK_OK (AcpiLoadTables, Status);
572
 
475
 
573
    /*
476
    /*
574
     * Test run-time control method installation. Do it twice to test code
477
     * Test run-time control method installation. Do it twice to test code
Line 611... Line 514...
611
    void)
514
    void)
612
{
515
{
Line 613... Line 516...
613
 
516
 
614
    return ((ACPI_PHYSICAL_ADDRESS) &LocalRSDP);
517
    return ((ACPI_PHYSICAL_ADDRESS) &LocalRSDP);
615
}
-
 
616
 
-
 
617
 
-
 
618
#if 0
-
 
619
/******************************************************************************
-
 
620
 *
-
 
621
 * DESCRIPTION: ASL tables that are used in RSDT/XSDT, also used to test
-
 
622
 *              Load/LoadTable operators.
-
 
623
 *
-
 
624
 *****************************************************************************/
-
 
625
 
-
 
626
DefinitionBlock ("", "OEMX", 2, "MyOEM", "Test", 0x00000432)
-
 
627
{
-
 
628
    External (GPE2, DeviceObj)
-
 
629
 
-
 
630
    Method (_INI)
-
 
631
    {
-
 
632
        Store ("Table OEMX running", Debug)
-
 
633
    }
-
 
634
 
-
 
635
    Scope (\_GPE)
-
 
636
    {
-
 
637
        Method (_E07) {}
-
 
638
        Method (_E22) {}
-
 
639
        Method (_L31) {}
-
 
640
        Method (_L66) {}
-
 
641
    }
-
 
642
 
-
 
643
    Device (OEM1)
-
 
644
    {
-
 
645
        Name (_PRW, Package(){7,0})
-
 
646
    }
-
 
647
    Device (OEM2)
-
 
648
    {
-
 
649
        Name (_PRW, Package(){0x66,0})
-
 
650
    }
-
 
651
 
-
 
652
    Scope (\GPE2)
-
 
653
    {
-
 
654
        Method (_L01) {}
-
 
655
        Method (_E07) {}
-
 
656
 
-
 
657
        Name (_PRW, Package() {Package() {\GPE2, 1}, 0})
-
 
658
    }
-
 
659
}
-
 
660
 
-
 
661
/* Parent gr.asl file */
-
 
662
 
-
 
663
DefinitionBlock ("", "DSDT", 2, "Intel", "Many", 0x00000001)
-
 
664
{
-
 
665
    Name (BUF1, Buffer()
-
 
666
    {
-
 
667
        0x4F,0x45,0x4D,0x58,0xB0,0x00,0x00,0x00,  /* 00000000    "OEMX...." */
-
 
668
        0x02,0x54,0x4D,0x79,0x4F,0x45,0x4D,0x00,  /* 00000008    ".TMyOEM." */
-
 
669
        0x54,0x65,0x73,0x74,0x00,0x00,0x00,0x00,  /* 00000010    "Test...." */
-
 
670
        0x32,0x04,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "2...INTL" */
-
 
671
        0x31,0x03,0x10,0x20,0x14,0x1D,0x5F,0x49,  /* 00000020    "1.. .._I" */
-
 
672
        0x4E,0x49,0x00,0x70,0x0D,0x54,0x61,0x62,  /* 00000028    "NI.p.Tab" */
-
 
673
        0x6C,0x65,0x20,0x4F,0x45,0x4D,0x58,0x20,  /* 00000030    "le OEMX " */
-
 
674
        0x72,0x75,0x6E,0x6E,0x69,0x6E,0x67,0x00,  /* 00000038    "running." */
-
 
675
        0x5B,0x31,0x10,0x22,0x5C,0x5F,0x47,0x50,  /* 00000040    "[1."\_GP" */
-
 
676
        0x45,0x14,0x06,0x5F,0x45,0x30,0x37,0x00,  /* 00000048    "E.._E07." */
-
 
677
        0x14,0x06,0x5F,0x45,0x32,0x32,0x00,0x14,  /* 00000050    ".._E22.." */
-
 
678
        0x06,0x5F,0x4C,0x33,0x31,0x00,0x14,0x06,  /* 00000058    "._L31..." */
-
 
679
        0x5F,0x4C,0x36,0x36,0x00,0x5B,0x82,0x10,  /* 00000060    "_L66.[.." */
-
 
680
        0x4F,0x45,0x4D,0x31,0x08,0x5F,0x50,0x52,  /* 00000068    "OEM1._PR" */
-
 
681
        0x57,0x12,0x05,0x02,0x0A,0x07,0x00,0x5B,  /* 00000070    "W......[" */
-
 
682
        0x82,0x10,0x4F,0x45,0x4D,0x32,0x08,0x5F,  /* 00000078    "..OEM2._" */
-
 
683
        0x50,0x52,0x57,0x12,0x05,0x02,0x0A,0x66,  /* 00000080    "PRW....f" */
-
 
684
        0x00,0x10,0x26,0x5C,0x47,0x50,0x45,0x32,  /* 00000088    "..&\GPE2" */
-
 
685
        0x14,0x06,0x5F,0x4C,0x30,0x31,0x00,0x14,  /* 00000090    ".._L01.." */
-
 
686
        0x06,0x5F,0x45,0x30,0x37,0x00,0x08,0x5F,  /* 00000098    "._E07.._" */
-
 
687
        0x50,0x52,0x57,0x12,0x0C,0x02,0x12,0x08,  /* 000000A0    "PRW....." */
-
 
688
        0x02,0x5C,0x47,0x50,0x45,0x32,0x01,0x00   /* 000000A8    ".\GPE2.." */
-
 
689
    })
-
 
690
 
-
 
691
    Name (HNDL, 0)
-
 
692
    Method (LD)
-
 
693
    {
-
 
694
        Load (BUF1, HNDL)
-
 
695
        Store ("Load operator, handle:", Debug)
-
 
696
        Store (HNDL, Debug)
-
 
697
    }
-
 
698
 
-
 
699
    Method (MAIN, 0, NotSerialized)
-
 
700
    {
-
 
701
        Store ("Loading OEMX table", Debug)
-
 
702
        Store (LoadTable ("OEMX", "MyOEM", "Test"), Debug)
-
 
703
    }
-
 
704
 
-
 
705
    Scope (\_GPE)
-
 
706
    {
-
 
707
        Method (_L08) {}
-
 
708
        Method (_E08) {}
-
 
709
        Method (_L0B) {}
-
 
710
    }
-
 
711
 
-
 
712
    Device (DEV0)
-
 
713
    {
-
 
714
        Name (_PRW, Package() {0x11, 0})
-
 
715
    }
-
 
716
 
-
 
717
    Device (\GPE2)
-
 
718
    {
-
 
719
        Method (_L00) {}
-
 
720
    }
-
 
721
}
-
 
722
 
-
 
723
#endif
-