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 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 140... Line 140...
140
#define DT_FIELD_TYPE_BUFFER            2
140
#define DT_FIELD_TYPE_BUFFER            2
141
#define DT_FIELD_TYPE_PCI_PATH          3
141
#define DT_FIELD_TYPE_PCI_PATH          3
142
#define DT_FIELD_TYPE_FLAG              4
142
#define DT_FIELD_TYPE_FLAG              4
143
#define DT_FIELD_TYPE_FLAGS_INTEGER     5
143
#define DT_FIELD_TYPE_FLAGS_INTEGER     5
144
#define DT_FIELD_TYPE_INLINE_SUBTABLE   6
144
#define DT_FIELD_TYPE_INLINE_SUBTABLE   6
-
 
145
#define DT_FIELD_TYPE_UUID              7
-
 
146
#define DT_FIELD_TYPE_UNICODE           8
-
 
147
#define DT_FIELD_TYPE_DEVICE_PATH       9
-
 
148
#define DT_FIELD_TYPE_LABEL             10
Line 145... Line 149...
145
 
149
 
146
 
150
 
147
/*
151
/*
148
 * Structure used for each individual field within an ACPI table
152
 * Structure used for each individual field within an ACPI table
149
 */
153
 */
150
typedef struct dt_field
154
typedef struct dt_field
151
{
155
{
152
    char                    *Name;
156
    char                    *Name;      /* Field name (from name : value) */
-
 
157
    char                    *Value;     /* Field value (from name : value) */
153
    char                    *Value;
158
    struct dt_field         *Next;      /* Next field */
154
    struct dt_field         *Next;
159
    struct dt_field         *NextLabel; /* If field is a label, next label */
155
    UINT32                  Line;       /* Line number for this field */
160
    UINT32                  Line;       /* Line number for this field */
156
    UINT32                  ByteOffset; /* Offset in source file for field */
161
    UINT32                  ByteOffset; /* Offset in source file for field */
-
 
162
    UINT32                  NameColumn; /* Start column for field name */
157
    UINT32                  NameColumn; /* Start column for field name */
163
    UINT32                  Column;     /* Start column for field value */
Line 158... Line 164...
158
    UINT32                  Column;     /* Start column for field value */
164
    UINT32                  TableOffset;/* Binary offset within ACPI table */
Line 159... Line 165...
159
    UINT8                   Flags;
165
    UINT8                   Flags;
Line 198... Line 204...
198
 
204
 
Line 199... Line 205...
199
/* Stack for subtables */
205
/* Stack for subtables */
Line -... Line 206...
-
 
206
 
-
 
207
DT_EXTERN DT_SUBTABLE       DT_INIT_GLOBAL (*Gbl_SubtableStack, NULL);
-
 
208
 
-
 
209
/* List for defined labels */
-
 
210
 
-
 
211
DT_EXTERN DT_FIELD          DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
-
 
212
 
-
 
213
/* Current offset within the binary output table */
Line 200... Line 214...
200
 
214
 
Line 201... Line 215...
201
DT_EXTERN DT_SUBTABLE       DT_INIT_GLOBAL (*Gbl_SubtableStack, NULL);
215
DT_EXTERN UINT32            DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
202
 
216
 
Line 219... Line 233...
219
 
233
 
220
void
234
void
221
DtOutputBinary (
235
DtOutputBinary (
Line -... Line 236...
-
 
236
    DT_SUBTABLE             *RootTable);
-
 
237
 
-
 
238
void
-
 
239
DtWriteFieldToListing (
-
 
240
    UINT8                   *Buffer,
-
 
241
    DT_FIELD                *Field,
-
 
242
    UINT32                  Length);
-
 
243
 
-
 
244
void
-
 
245
DtWriteTableToListing (
Line 222... Line 246...
222
    DT_SUBTABLE             *RootTable);
246
    void);
Line 223... Line 247...
223
 
247
 
224
 
248
 
Line 264... Line 288...
264
DT_SUBTABLE *
288
DT_SUBTABLE *
265
DtGetParentSubtable (
289
DtGetParentSubtable (
266
    DT_SUBTABLE             *Subtable);
290
    DT_SUBTABLE             *Subtable);
Line -... Line 291...
-
 
291
 
-
 
292
 
-
 
293
/* dtexpress - Integer expressions and labels */
-
 
294
 
-
 
295
ACPI_STATUS
-
 
296
DtResolveIntegerExpression (
-
 
297
    DT_FIELD                *Field,
-
 
298
    UINT64                  *ReturnValue);
-
 
299
 
-
 
300
UINT64
-
 
301
DtDoOperator (
-
 
302
    UINT64                  LeftValue,
-
 
303
    UINT32                  Operator,
-
 
304
    UINT64                  RightValue);
-
 
305
 
-
 
306
UINT64
-
 
307
DtResolveLabel (
-
 
308
    char                    *LabelString);
-
 
309
 
-
 
310
void
-
 
311
DtDetectAllLabels (
-
 
312
    DT_FIELD                *FieldList);
267
 
313
 
Line 268... Line 314...
268
 
314
 
269
/* dtfield - Compile individual fields within a table */
315
/* dtfield - Compile individual fields within a table */
270
 
316
 
Line 288... Line 334...
288
    UINT8                   *Buffer,
334
    UINT8                   *Buffer,
289
    char                    *Value,
335
    char                    *Value,
290
    DT_FIELD                *Field,
336
    DT_FIELD                *Field,
291
    UINT32                  ByteLength);
337
    UINT32                  ByteLength);
Line 292... Line 338...
292
 
338
 
293
UINT32
339
void
294
DtCompileFlag (
340
DtCompileFlag (
295
    UINT8                   *Buffer,
341
    UINT8                   *Buffer,
296
    DT_FIELD                *Field,
342
    DT_FIELD                *Field,
-
 
343
    ACPI_DMTABLE_INFO       *Info);
-
 
344
 
-
 
345
 
-
 
346
/* dtparser - lex/yacc files */
-
 
347
 
-
 
348
UINT64
-
 
349
DtEvaluateExpression (
-
 
350
    char                    *ExprString);
-
 
351
 
-
 
352
int
-
 
353
DtInitLexer (
-
 
354
    char                    *String);
-
 
355
 
-
 
356
void
-
 
357
DtTerminateLexer (
-
 
358
    void);
-
 
359
 
-
 
360
char *
297
    ACPI_DMTABLE_INFO       *Info,
361
DtGetOpName (
Line 298... Line 362...
298
    UINT32                  BitPosition);
362
    UINT32                  ParseOpcode);
Line 299... Line 363...
299
 
363
 
Line 342... Line 406...
342
DtGetFileSize (
406
DtGetFileSize (
343
    FILE                    *Handle);
407
    FILE                    *Handle);
Line 344... Line 408...
344
 
408
 
345
char*
409
char*
346
DtGetFieldValue (
410
DtGetFieldValue (
347
    DT_FIELD                *Field,
-
 
Line 348... Line 411...
348
    char                    *Name);
411
    DT_FIELD                *Field);
349
 
412
 
350
UINT8
413
UINT8
Line 430... Line 493...
430
ACPI_STATUS
493
ACPI_STATUS
431
DtCompileRsdt (
494
DtCompileRsdt (
432
    void                    **PFieldList);
495
    void                    **PFieldList);
Line 433... Line 496...
433
 
496
 
-
 
497
ACPI_STATUS
-
 
498
DtCompileSlic (
-
 
499
    void                    **PFieldList);
-
 
500
 
434
ACPI_STATUS
501
ACPI_STATUS
435
DtCompileSlit (
502
DtCompileSlit (
Line 436... Line 503...
436
    void                    **PFieldList);
503
    void                    **PFieldList);
437
 
504
 
438
ACPI_STATUS
505
ACPI_STATUS
Line 439... Line 506...
439
DtCompileSrat (
506
DtCompileSrat (
-
 
507
    void                    **PFieldList);
-
 
508
 
-
 
509
ACPI_STATUS
-
 
510
DtCompileUefi (
440
    void                    **PFieldList);
511
    void                    **PFieldList);
441
 
512
 
Line 442... Line 513...
442
ACPI_STATUS
513
ACPI_STATUS
443
DtCompileWdat (
514
DtCompileWdat (
444
    void                    **PFieldList);
515
    void                    **PFieldList);
Line -... Line 516...
-
 
516
 
-
 
517
ACPI_STATUS
-
 
518
DtCompileXsdt (
-
 
519
    void                    **PFieldList);
-
 
520
 
-
 
521
ACPI_STATUS
-
 
522
DtCompileGeneric (
Line 445... Line 523...
445
 
523
    void                    **PFieldList);
Line -... Line 524...
-
 
524
 
-
 
525
ACPI_DMTABLE_INFO *
-
 
526
DtGetGenericTableInfo (
-
 
527
    char                    *Name);
-
 
528
 
-
 
529
/* ACPI Table templates */
-
 
530
 
446
ACPI_STATUS
531
extern const unsigned char  TemplateAsf[];
-
 
532
extern const unsigned char  TemplateBoot[];
-
 
533
extern const unsigned char  TemplateBert[];
-
 
534
extern const unsigned char  TemplateCpep[];
-
 
535
extern const unsigned char  TemplateDbgp[];
-
 
536
extern const unsigned char  TemplateDmar[];
-
 
537
extern const unsigned char  TemplateEcdt[];
-
 
538
extern const unsigned char  TemplateEinj[];
-
 
539
extern const unsigned char  TemplateErst[];
-
 
540
extern const unsigned char  TemplateFadt[];
-
 
541
extern const unsigned char  TemplateHest[];
-
 
542
extern const unsigned char  TemplateHpet[];
-
 
543
extern const unsigned char  TemplateIvrs[];
-
 
544
extern const unsigned char  TemplateMadt[];
-
 
545
extern const unsigned char  TemplateMcfg[];
-
 
546
extern const unsigned char  TemplateMchi[];
-
 
547
extern const unsigned char  TemplateMsct[];
-
 
548
extern const unsigned char  TemplateRsdt[];
-
 
549
extern const unsigned char  TemplateSbst[];
-
 
550
extern const unsigned char  TemplateSlic[];
-
 
551
extern const unsigned char  TemplateSlit[];
-
 
552
extern const unsigned char  TemplateSpcr[];
-
 
553
extern const unsigned char  TemplateSpmi[];
-
 
554
extern const unsigned char  TemplateSrat[];
Line 447... Line 555...
447
DtCompileXsdt (
555
extern const unsigned char  TemplateTcpa[];