Skip to content

Commit

Permalink
ACPI 6.0: Add changes for FADT table.
Browse files Browse the repository at this point in the history
One new 64-bit field at the end of the table.
FADT version is now 6.
  • Loading branch information
acpibob committed Apr 23, 2015
1 parent a6ccb40 commit 72b0b67
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
7 changes: 7 additions & 0 deletions source/common/dmtbdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,13 @@ AcpiDmDumpFadt (
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
}

/* Check for FADT revision 6 fields and up (ACPI 6.0+) */

if (Table->Length > ACPI_FADT_V3_SIZE)
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
}
}

/* Validate various fields in the FADT, including length */
Expand Down
8 changes: 8 additions & 0 deletions source/common/dmtbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,14 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] =
ACPI_DMT_TERMINATOR
};

/* ACPI 6.0 Extensions (FADT version 6) */

ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[] =
{
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (HypervisorId), "Hypervisor ID", 0},
ACPI_DMT_TERMINATOR
};


/*
* Remaining tables are not consumed directly by the ACPICA subsystem
Expand Down
12 changes: 12 additions & 0 deletions source/compiler/dttable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,18 @@ DtCompileFadt (

DtInsertSubtable (ParentTable, Subtable);
}

if (Revision >= 6)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}

DtInsertSubtable (ParentTable, Subtable);
}
}

return (AE_OK);
Expand Down
11 changes: 6 additions & 5 deletions source/compiler/dttemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ const unsigned char TemplateFacs[] =

const unsigned char TemplateFadt[] =
{
0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00, /* 00000000 "FACP...." */
0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".dINTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x46,0x41,0x43,0x50,0x14,0x01,0x00,0x00, /* 00000000 "FACP...." */
0x06,0x8A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x10,0x04,0x15,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
Expand Down Expand Up @@ -484,7 +484,8 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
0x01,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000100 "........" */
0x00,0x00,0x00,0x00 /* 00000108 "...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
0x00,0x00,0x00,0x00 /* 00000110 "...." */
};

const unsigned char TemplateFpdt[] =
Expand Down
1 change: 1 addition & 0 deletions source/include/acdisasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[];
Expand Down
17 changes: 10 additions & 7 deletions source/include/actbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ typedef struct acpi_table_fadt
ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */
ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */
UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */

} ACPI_TABLE_FADT;

Expand Down Expand Up @@ -441,7 +442,7 @@ enum AcpiPreferredPmProfiles
PM_TABLET = 8
};

/* Values for SleepStatus and SleepControl registers (V5 FADT) */
/* Values for SleepStatus and SleepControl registers (V5+ FADT) */

#define ACPI_X_WAKE_STATUS 0x80
#define ACPI_X_SLEEP_TYPE_MASK 0x1C
Expand Down Expand Up @@ -506,15 +507,17 @@ typedef struct acpi_table_desc
* FADT is the bottom line as to what the version really is.
*
* For reference, the values below are as follows:
* FADT V1 size: 0x074
* FADT V2 size: 0x084
* FADT V3 size: 0x0F4
* FADT V4 size: 0x0F4
* FADT V5 size: 0x10C
* FADT V1 size: 0x074
* FADT V2 size: 0x084
* FADT V3 size: 0x0F4
* FADT V4 size: 0x0F4
* FADT V5 size: 0x10C
* FADT V6 size: 0x114
*/
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl))
#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId))
#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))

#endif /* __ACTBL_H__ */

0 comments on commit 72b0b67

Please sign in to comment.