ReactOS 0.4.16-dev-306-g647d351
actables.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ACPI_STATUS AcpiAllocateRootTable (UINT32 InitialTableCount)
 
UINT32 AcpiTbGetRsdpLength (ACPI_TABLE_RSDP *Rsdp)
 
ACPI_STATUS AcpiTbValidateRsdp (ACPI_TABLE_RSDP *Rsdp)
 
UINT8AcpiTbScanMemoryForRsdp (UINT8 *StartAddress, UINT32 Length)
 
ACPI_STATUS AcpiTbGetNextTableDescriptor (UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc)
 
void AcpiTbInitTableDescriptor (ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
 
ACPI_STATUS AcpiTbAcquireTempTable (ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
 
void AcpiTbReleaseTempTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbValidateTempTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbVerifyTempTable (ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex)
 
BOOLEAN AcpiTbIsTableLoaded (UINT32 TableIndex)
 
void AcpiTbSetTableLoadedFlag (UINT32 TableIndex, BOOLEAN IsLoaded)
 
void AcpiTbParseFadt (void)
 
void AcpiTbCreateLocalFadt (ACPI_TABLE_HEADER *Table, UINT32 Length)
 
ACPI_STATUS AcpiTbFindTable (char *Signature, char *OemId, char *OemTableId, UINT32 *TableIndex)
 
ACPI_STATUS AcpiTbResizeRootTableList (void)
 
ACPI_STATUS AcpiTbValidateTable (ACPI_TABLE_DESC *TableDesc)
 
void AcpiTbInvalidateTable (ACPI_TABLE_DESC *TableDesc)
 
void AcpiTbOverrideTable (ACPI_TABLE_DESC *OldTableDesc)
 
ACPI_STATUS AcpiTbAcquireTable (ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **TablePtr, UINT32 *TableLength, UINT8 *TableFlags)
 
void AcpiTbReleaseTable (ACPI_TABLE_HEADER *Table, UINT32 TableLength, UINT8 TableFlags)
 
ACPI_STATUS AcpiTbInstallStandardTable (ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table, BOOLEAN Reload, BOOLEAN Override, UINT32 *TableIndex)
 
void AcpiTbUninstallTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbLoadTable (UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode)
 
ACPI_STATUS AcpiTbInstallAndLoadTable (ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table, BOOLEAN Override, UINT32 *TableIndex)
 
ACPI_STATUS AcpiTbUnloadTable (UINT32 TableIndex)
 
void AcpiTbNotifyTable (UINT32 Event, void *Table)
 
void AcpiTbTerminate (void)
 
ACPI_STATUS AcpiTbDeleteNamespaceByOwner (UINT32 TableIndex)
 
ACPI_STATUS AcpiTbAllocateOwnerId (UINT32 TableIndex)
 
ACPI_STATUS AcpiTbReleaseOwnerId (UINT32 TableIndex)
 
ACPI_STATUS AcpiTbGetOwnerId (UINT32 TableIndex, ACPI_OWNER_ID *OwnerId)
 
ACPI_STATUS AcpiTbInitializeFacs (void)
 
void AcpiTbPrintTableHeader (ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header)
 
void AcpiTbCheckDsdtHeader (void)
 
ACPI_TABLE_HEADERAcpiTbCopyDsdt (UINT32 TableIndex)
 
void AcpiTbInstallTableWithOverride (ACPI_TABLE_DESC *NewTableDesc, BOOLEAN Override, UINT32 *TableIndex)
 
ACPI_STATUS AcpiTbParseRootTable (ACPI_PHYSICAL_ADDRESS RsdpAddress)
 
ACPI_STATUS AcpiTbGetTable (ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable)
 
void AcpiTbPutTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbLoadNamespace (void)
 

Function Documentation

◆ AcpiAllocateRootTable()

ACPI_STATUS AcpiAllocateRootTable ( UINT32  InitialTableCount)

Definition at line 69 of file tbxface.c.

71{
72
73 AcpiGbl_RootTableList.MaxTableCount = InitialTableCount;
74 AcpiGbl_RootTableList.Flags = ACPI_ROOT_ALLOW_RESIZE;
75
76 return (AcpiTbResizeRootTableList ());
77}
#define ACPI_ROOT_ALLOW_RESIZE
Definition: aclocal.h:245
ACPI_STATUS AcpiTbResizeRootTableList(void)
Definition: tbdata.c:677

Referenced by AcpiInitializeTables().

◆ AcpiTbAcquireTable()

ACPI_STATUS AcpiTbAcquireTable ( ACPI_TABLE_DESC TableDesc,
ACPI_TABLE_HEADER **  TablePtr,
UINT32 TableLength,
UINT8 TableFlags 
)

Definition at line 180 of file tbdata.c.

185{
187
188
189 switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
190 {
192
193 Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length);
194 break;
195
198
199 Table = TableDesc->Pointer;
200 break;
201
202 default:
203
204 break;
205 }
206
207 /* Table is not valid yet */
208
209 if (!Table)
210 {
211 return (AE_NO_MEMORY);
212 }
213
214 /* Fill the return values */
215
216 *TablePtr = Table;
217 *TableLength = TableDesc->Length;
218 *TableFlags = TableDesc->Flags;
219 return (AE_OK);
220}
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define AE_OK
Definition: acexcep.h:97
void * AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length)
Definition: osl.c:108
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL
Definition: actbl.h:431
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL
Definition: actbl.h:429
#define ACPI_TABLE_ORIGIN_MASK
Definition: actbl.h:432
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
#define NULL
Definition: types.h:112
ASMGENDATA Table[]
Definition: genincdata.c:61
UINT8 Flags
Definition: actbl.h:408
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
UINT32 Length
Definition: actbl.h:405
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404

Referenced by AcpiTbCompareTables(), and AcpiTbValidateTable().

◆ AcpiTbAcquireTempTable()

ACPI_STATUS AcpiTbAcquireTempTable ( ACPI_TABLE_DESC TableDesc,
ACPI_PHYSICAL_ADDRESS  Address,
UINT8  Flags,
ACPI_TABLE_HEADER Table 
)

Definition at line 280 of file tbdata.c.

285{
286 BOOLEAN MappedTable = FALSE;
287
288
290 {
292
293 /* Get the length of the full table from the header */
294
295 if (!Table)
296 {
298 if (!Table)
299 {
300 return (AE_NO_MEMORY);
301 }
302
303 MappedTable = TRUE;
304 }
305
306 break;
307
310
311 if (!Table)
312 {
313 return (AE_BAD_PARAMETER);
314 }
315
316 break;
317
318 default:
319
320 /* Table is not valid yet */
321
322 return (AE_NO_MEMORY);
323 }
324
326 if (MappedTable)
327 {
329 }
330
331 return (AE_OK);
332}
unsigned char BOOLEAN
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR Address[46]
Definition: ping.c:68
void AcpiTbInitTableDescriptor(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
Definition: tbdata.c:130
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by AcpiTbInstallStandardTable(), and AcpiTbOverrideTable().

◆ AcpiTbAllocateOwnerId()

ACPI_STATUS AcpiTbAllocateOwnerId ( UINT32  TableIndex)

Definition at line 923 of file tbdata.c.

925{
927
928
929 ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
930
931
933 if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
934 {
936 &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
937 }
938
941}
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiUtAllocateOwnerId(ACPI_OWNER_ID *OwnerId)
Definition: utownerid.c:68
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
Status
Definition: gdiplustypes.h:25

Referenced by AcpiNsLoadTable().

◆ AcpiTbCheckDsdtHeader()

void AcpiTbCheckDsdtHeader ( void  )

Definition at line 124 of file tbutils.c.

126{
127
128 /* Compare original length and checksum to current values */
129
130 if (AcpiGbl_OriginalDsdtHeader.Length != AcpiGbl_DSDT->Length ||
131 AcpiGbl_OriginalDsdtHeader.Checksum != AcpiGbl_DSDT->Checksum)
132 {
134 "The DSDT has been corrupted or replaced - "
135 "old, new headers below"));
136
137 AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader);
138 AcpiTbPrintTableHeader (0, AcpiGbl_DSDT);
139
140 /* Disable further error messages */
141
142 AcpiGbl_OriginalDsdtHeader.Length = AcpiGbl_DSDT->Length;
143 AcpiGbl_OriginalDsdtHeader.Checksum = AcpiGbl_DSDT->Checksum;
144 }
145}
#define ACPI_BIOS_ERROR(plist)
Definition: acoutput.h:243
#define AE_INFO
Definition: acoutput.h:230
void AcpiTbPrintTableHeader(ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:143

Referenced by AcpiPsExecuteMethod().

◆ AcpiTbCopyDsdt()

ACPI_TABLE_HEADER * AcpiTbCopyDsdt ( UINT32  TableIndex)

Definition at line 163 of file tbutils.c.

165{
166 ACPI_TABLE_HEADER *NewTable;
167 ACPI_TABLE_DESC *TableDesc;
168
169
170 TableDesc = &AcpiGbl_RootTableList.Tables[TableIndex];
171
172 NewTable = ACPI_ALLOCATE (TableDesc->Length);
173 if (!NewTable)
174 {
175 ACPI_ERROR ((AE_INFO, "Could not copy DSDT of length 0x%X",
176 TableDesc->Length));
177 return (NULL);
178 }
179
180 memcpy (NewTable, TableDesc->Pointer, TableDesc->Length);
181 AcpiTbUninstallTable (TableDesc);
182
184 &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex],
185 ACPI_PTR_TO_PHYSADDR (NewTable),
187
188 ACPI_INFO ((
189 "Forced DSDT copy: length 0x%05X copied locally, original unmapped",
190 NewTable->Length));
191
192 return (NewTable);
193}
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define ACPI_INFO(plist)
Definition: acoutput.h:237
void AcpiTbUninstallTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbinstal.c:336
void AcpiTbInitTableDescriptor(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
Definition: tbdata.c:130
#define ACPI_PTR_TO_PHYSADDR(i)
Definition: actypes.h:559
#define ACPI_ALLOCATE(a)
Definition: actypes.h:384
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT32 Length
Definition: actbl.h:109

Referenced by AcpiTbLoadNamespace().

◆ AcpiTbCreateLocalFadt()

void AcpiTbCreateLocalFadt ( ACPI_TABLE_HEADER Table,
UINT32  Length 
)

Definition at line 423 of file tbfadt.c.

426{
427
428 /*
429 * Check if the FADT is larger than the largest table that we expect
430 * (typically the current ACPI specification version). If so, truncate
431 * the table, and issue a warning.
432 */
433 if (Length > sizeof (ACPI_TABLE_FADT))
434 {
436 "FADT (revision %u) is longer than %s length, "
437 "truncating length %u to %u",
440 }
441
442 /* Clear the entire local FADT */
443
444 memset (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT));
445
446 /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */
447
448 memcpy (&AcpiGbl_FADT, Table,
449 ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT)));
450
451 /* Take a copy of the Hardware Reduced flag */
452
453 AcpiGbl_ReducedHardware = FALSE;
454 if (AcpiGbl_FADT.Flags & ACPI_FADT_HW_REDUCED)
455 {
456 AcpiGbl_ReducedHardware = TRUE;
457 }
458
459 /* Convert the local copy of the FADT to the common internal format */
460
462
463 /* Initialize the global ACPI register structures */
464
466}
unsigned int UINT32
#define ACPI_BIOS_WARNING(plist)
Definition: acoutput.h:241
#define ACPI_FADT_CONFORMANCE
Definition: actbl.h:469
#define ACPI_FADT_HW_REDUCED
Definition: actbl.h:356
#define ACPI_MIN(a, b)
Definition: actypes.h:535
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define memset(x, y, z)
Definition: compat.h:39
static void AcpiTbSetupFadtRegisters(void)
Definition: tbfadt.c:714
static void AcpiTbConvertFadt(void)
Definition: tbfadt.c:514
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by AcpiTbParseFadt().

◆ AcpiTbDeleteNamespaceByOwner()

ACPI_STATUS AcpiTbDeleteNamespaceByOwner ( UINT32  TableIndex)

Definition at line 862 of file tbdata.c.

864{
867
868
869 ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
870
871
873 if (ACPI_FAILURE (Status))
874 {
876 }
877
878 if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
879 {
880 /* The table index does not exist */
881
884 }
885
886 /* Get the owner ID for this table, used to delete namespace nodes */
887
888 OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
890
891 /*
892 * Need to acquire the namespace writer lock to prevent interference
893 * with any concurrent namespace walks. The interpreter must be
894 * released during the deletion since the acquisition of the deletion
895 * lock may block, and also since the execution of a namespace walk
896 * must be allowed to use the interpreter.
897 */
898 Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
899 if (ACPI_FAILURE (Status))
900 {
902 }
903
905 AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
907}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_NOT_EXIST
Definition: acexcep.h:114
void AcpiNsDeleteNamespaceByOwner(ACPI_OWNER_ID OwnerId)
Definition: nsalloc.c:497
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
void AcpiUtReleaseWriteLock(ACPI_RW_LOCK *Lock)
Definition: utlock.c:197
ACPI_STATUS AcpiUtAcquireWriteLock(ACPI_RW_LOCK *Lock)
Definition: utlock.c:185
_Must_inspect_result_ _In_opt_ PVOID OwnerId
Definition: fsrtlfuncs.h:907

Referenced by AcpiTbUnloadTable().

◆ AcpiTbFindTable()

ACPI_STATUS AcpiTbFindTable ( char Signature,
char OemId,
char OemTableId,
UINT32 TableIndex 
)

Definition at line 70 of file tbfind.c.

75{
78 UINT32 i;
79
80
81 ACPI_FUNCTION_TRACE (TbFindTable);
82
83
84 /* Validate the input table signature */
85
87 {
89 }
90
91 /* Don't allow the OEM strings to be too long */
92
93 if ((strlen (OemId) > ACPI_OEM_ID_SIZE) ||
94 (strlen (OemTableId) > ACPI_OEM_TABLE_ID_SIZE))
95 {
97 }
98
99 /* Normalize the input strings */
100
101 memset (&Header, 0, sizeof (ACPI_TABLE_HEADER));
103 strncpy (Header.OemId, OemId, ACPI_OEM_ID_SIZE);
104 strncpy (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE);
105
106 /* Search for the table */
107
109 for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
110 {
111 if (memcmp (&(AcpiGbl_RootTableList.Tables[i].Signature),
112 Header.Signature, ACPI_NAMESEG_SIZE))
113 {
114 /* Not the requested table */
115
116 continue;
117 }
118
119 /* Table with matching signature has been found */
120
121 if (!AcpiGbl_RootTableList.Tables[i].Pointer)
122 {
123 /* Table is not currently mapped, map it */
124
125 Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]);
126 if (ACPI_FAILURE (Status))
127 {
128 goto UnlockAndExit;
129 }
130
131 if (!AcpiGbl_RootTableList.Tables[i].Pointer)
132 {
133 continue;
134 }
135 }
136
137 /* Check for table match on all IDs */
138
139 if (!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->Signature,
140 Header.Signature, ACPI_NAMESEG_SIZE) &&
141 (!OemId[0] ||
142 !memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemId,
143 Header.OemId, ACPI_OEM_ID_SIZE)) &&
144 (!OemTableId[0] ||
145 !memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemTableId,
146 Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE)))
147 {
148 *TableIndex = i;
149
150 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Found table [%4.4s]\n",
151 Header.Signature));
152 goto UnlockAndExit;
153 }
154 }
156
157UnlockAndExit:
160}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define AE_BAD_SIGNATURE
Definition: acexcep.h:167
#define AE_NOT_FOUND
Definition: acexcep.h:113
#define AE_AML_STRING_LIMIT
Definition: acexcep.h:196
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_DB_TABLES
Definition: acoutput.h:169
ACPI_STATUS AcpiTbValidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:375
#define ACPI_OEM_ID_SIZE
Definition: actypes.h:421
#define ACPI_COPY_NAMESEG(dest, src)
Definition: actypes.h:565
#define ACPI_OEM_TABLE_ID_SIZE
Definition: actypes.h:422
#define ACPI_NAMESEG_SIZE
Definition: actypes.h:415
BOOLEAN AcpiUtValidNameseg(char *Signature)
Definition: utascii.c:63
Definition: Header.h:9
static const WCHAR Signature[]
Definition: parser.c:141
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by AcpiDsEvalTableRegionOperands(), and AcpiExLoadTableOp().

◆ AcpiTbGetNextTableDescriptor()

ACPI_STATUS AcpiTbGetNextTableDescriptor ( UINT32 TableIndex,
ACPI_TABLE_DESC **  TableDesc 
)

Definition at line 762 of file tbdata.c.

765{
767 UINT32 i;
768
769
770 /* Ensure that there is room for the table in the Root Table List */
771
772 if (AcpiGbl_RootTableList.CurrentTableCount >=
773 AcpiGbl_RootTableList.MaxTableCount)
774 {
776 if (ACPI_FAILURE (Status))
777 {
778 return (Status);
779 }
780 }
781
782 i = AcpiGbl_RootTableList.CurrentTableCount;
783 AcpiGbl_RootTableList.CurrentTableCount++;
784
785 if (TableIndex)
786 {
787 *TableIndex = i;
788 }
789 if (TableDesc)
790 {
791 *TableDesc = &AcpiGbl_RootTableList.Tables[i];
792 }
793
794 return (AE_OK);
795}
ACPI_STATUS AcpiTbResizeRootTableList(void)
Definition: tbdata.c:677

Referenced by AcpiTbInstallTableWithOverride().

◆ AcpiTbGetOwnerId()

ACPI_STATUS AcpiTbGetOwnerId ( UINT32  TableIndex,
ACPI_OWNER_ID OwnerId 
)

Definition at line 993 of file tbdata.c.

996{
998
999
1000 ACPI_FUNCTION_TRACE (TbGetOwnerId);
1001
1002
1004 if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
1005 {
1006 *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
1007 Status = AE_OK;
1008 }
1009
1012}

Referenced by AcpiDsInitializeObjects(), AcpiNsExecuteTable(), AcpiNsOneCompleteParse(), and AcpiTbLoadTable().

◆ AcpiTbGetRsdpLength()

UINT32 AcpiTbGetRsdpLength ( ACPI_TABLE_RSDP Rsdp)

Definition at line 66 of file tbxfroot.c.

68{
69
71 {
72 /* BAD Signature */
73
74 return (0);
75 }
76
77 /* "Length" field is available if table version >= 2 */
78
79 if (Rsdp->Revision >= 2)
80 {
81 return (Rsdp->Length);
82 }
83 else
84 {
86 }
87}
#define ACPI_VALIDATE_RSDP_SIG(a)
Definition: actypes.h:573
#define ACPI_RSDP_CHECKSUM_LENGTH
Definition: acconfig.h:210
UINT32 Length
Definition: actbl.h:156
UINT8 Revision
Definition: actbl.h:154
char Signature[8]
Definition: actbl.h:151

◆ AcpiTbGetTable()

ACPI_STATUS AcpiTbGetTable ( ACPI_TABLE_DESC TableDesc,
ACPI_TABLE_HEADER **  OutTable 
)

Definition at line 434 of file tbutils.c.

437{
439
440
442
443
444 if (TableDesc->ValidationCount == 0)
445 {
446 /* Table need to be "VALIDATED" */
447
448 Status = AcpiTbValidateTable (TableDesc);
449 if (ACPI_FAILURE (Status))
450 {
452 }
453 }
454
456 {
457 TableDesc->ValidationCount++;
458
459 /*
460 * Detect ValidationCount overflows to ensure that the warning
461 * message will only be printed once.
462 */
464 {
466 "Table %p, Validation count overflows\n", TableDesc));
467 }
468 }
469
470 *OutTable = TableDesc->Pointer;
472}
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
#define ACPI_MAX_TABLE_VALIDATIONS
Definition: actbl.h:425
UINT16 ValidationCount
Definition: actbl.h:409
ACPI_STATUS AcpiTbGetTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable)
Definition: tbutils.c:434

Referenced by AcpiGetTable(), AcpiGetTableByIndex(), AcpiTbGetTable(), and AcpiTbParseFadt().

◆ AcpiTbInitializeFacs()

ACPI_STATUS AcpiTbInitializeFacs ( void  )

Definition at line 75 of file tbutils.c.

77{
78 ACPI_TABLE_FACS *Facs;
79
80
81 /* If Hardware Reduced flag is set, there is no FACS */
82
83 if (AcpiGbl_ReducedHardware)
84 {
85 AcpiGbl_FACS = NULL;
86 return (AE_OK);
87 }
88 else if (AcpiGbl_FADT.XFacs &&
89 (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses))
90 {
91 (void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex,
93 AcpiGbl_FACS = Facs;
94 }
95 else if (AcpiGbl_FADT.Facs)
96 {
97 (void) AcpiGetTableByIndex (AcpiGbl_FacsIndex,
99 AcpiGbl_FACS = Facs;
100 }
101
102 /* If there is no FACS, just continue. There was already an error msg */
103
104 return (AE_OK);
105}
#define ACPI_CAST_INDIRECT_PTR(t, p)
Definition: actypes.h:545
ACPI_STATUS AcpiGetTableByIndex(UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)
Definition: tbxface.c:491

Referenced by AcpiEnableSubsystem().

◆ AcpiTbInitTableDescriptor()

void AcpiTbInitTableDescriptor ( ACPI_TABLE_DESC TableDesc,
ACPI_PHYSICAL_ADDRESS  Address,
UINT8  Flags,
ACPI_TABLE_HEADER Table 
)

Definition at line 130 of file tbdata.c.

135{
136
137 /*
138 * Initialize the table descriptor. Set the pointer to NULL for external
139 * tables, since the table is not fully mapped at this time.
140 */
141 memset (TableDesc, 0, sizeof (ACPI_TABLE_DESC));
142 TableDesc->Address = Address;
143 TableDesc->Length = Table->Length;
144 TableDesc->Flags = Flags;
145 ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);
146
147 switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
148 {
151
152 TableDesc->Pointer = Table;
153 break;
154
156 default:
157
158 break;
159 }
160}
#define ACPI_MOVE_32_TO_32(d, s)
Definition: acmacros.h:148
ACPI_NAME_UNION Signature
Definition: actbl.h:406
char Ascii[4]
Definition: actbl.h:394

Referenced by AcpiTbAcquireTempTable(), AcpiTbCopyDsdt(), AcpiTbInstallTableWithOverride(), and AcpiTbOverrideTable().

◆ AcpiTbInstallAndLoadTable()

ACPI_STATUS AcpiTbInstallAndLoadTable ( ACPI_PHYSICAL_ADDRESS  Address,
UINT8  Flags,
ACPI_TABLE_HEADER Table,
BOOLEAN  Override,
UINT32 TableIndex 
)

Definition at line 1162 of file tbdata.c.

1168{
1170 UINT32 i;
1171
1172
1173 ACPI_FUNCTION_TRACE (TbInstallAndLoadTable);
1174
1175
1176 /* Install the table and load it into the namespace */
1177
1179 Override, &i);
1180 if (ACPI_FAILURE (Status))
1181 {
1182 goto Exit;
1183 }
1184
1185 Status = AcpiTbLoadTable (i, AcpiGbl_RootNode);
1186
1187Exit:
1188 *TableIndex = i;
1190}
ACPI_STATUS AcpiTbInstallStandardTable(ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table, BOOLEAN Reload, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbinstal.c:139
static void Exit(void)
Definition: sock.c:1330
ACPI_STATUS AcpiTbLoadTable(UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode)
Definition: tbdata.c:1097

Referenced by AcpiExLoadOp(), and AcpiLoadTable().

◆ AcpiTbInstallStandardTable()

ACPI_STATUS AcpiTbInstallStandardTable ( ACPI_PHYSICAL_ADDRESS  Address,
UINT8  Flags,
ACPI_TABLE_HEADER Table,
BOOLEAN  Reload,
BOOLEAN  Override,
UINT32 TableIndex 
)

Definition at line 139 of file tbinstal.c.

146{
147 UINT32 i;
149 ACPI_TABLE_DESC NewTableDesc;
150
151
152 ACPI_FUNCTION_TRACE (TbInstallStandardTable);
153
154
155 /* Acquire a temporary table descriptor for validation */
156
157 Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags, Table);
158 if (ACPI_FAILURE (Status))
159 {
161 "Could not acquire table length at %8.8X%8.8X",
164 }
165
166 /*
167 * Optionally do not load any SSDTs from the RSDT/XSDT. This can
168 * be useful for debugging ACPI problems on some machines.
169 */
170 if (!Reload &&
171 AcpiGbl_DisableSsdtTableInstall &&
173 {
174 ACPI_INFO ((
175 "Ignoring installation of %4.4s at %8.8X%8.8X",
176 NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
177 goto ReleaseAndExit;
178 }
179
180 /* Acquire the table lock */
181
183
184 /* Validate and verify a table before installation */
185
186 Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i);
187 if (ACPI_FAILURE (Status))
188 {
190 {
191 /*
192 * Table was unloaded, allow it to be reloaded.
193 * As we are going to return AE_OK to the caller, we should
194 * take the responsibility of freeing the input descriptor.
195 * Refill the input descriptor to ensure
196 * AcpiTbInstallTableWithOverride() can be called again to
197 * indicate the re-installation.
198 */
199 AcpiTbUninstallTable (&NewTableDesc);
201 *TableIndex = i;
203 }
204 goto UnlockAndExit;
205 }
206
207 /* Add the table to the global root table list */
208
209 AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex);
210
211 /* Invoke table handler */
212
216
217UnlockAndExit:
218
219 /* Release the table lock */
220
222
223ReleaseAndExit:
224
225 /* Release the temporary table descriptor */
226
227 AcpiTbReleaseTempTable (&NewTableDesc);
229}
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
void AcpiTbReleaseTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:348
ACPI_STATUS AcpiTbAcquireTempTable(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
Definition: tbdata.c:280
ACPI_STATUS AcpiTbVerifyTempTable(ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex)
Definition: tbdata.c:584
void AcpiTbNotifyTable(UINT32 Event, void *Table)
Definition: tbdata.c:1259
#define ACPI_SIG_SSDT
Definition: actbl.h:75
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:564
#define ACPI_TABLE_EVENT_INSTALL
Definition: actypes.h:1195
void AcpiTbUninstallTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbinstal.c:336
void AcpiTbInstallTableWithOverride(ACPI_TABLE_DESC *NewTableDesc, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbinstal.c:70

Referenced by AcpiInstallPhysicalTable(), AcpiInstallTable(), AcpiTbInstallAndLoadTable(), AcpiTbParseFadt(), and AcpiTbParseRootTable().

◆ AcpiTbInstallTableWithOverride()

void AcpiTbInstallTableWithOverride ( ACPI_TABLE_DESC NewTableDesc,
BOOLEAN  Override,
UINT32 TableIndex 
)

Definition at line 70 of file tbinstal.c.

74{
75 UINT32 i;
77
78
80 if (ACPI_FAILURE (Status))
81 {
82 return;
83 }
84
85 /*
86 * ACPI Table Override:
87 *
88 * Before we install the table, let the host OS override it with a new
89 * one if desired. Any table within the RSDT/XSDT can be replaced,
90 * including the DSDT which is pointed to by the FADT.
91 */
92 if (Override)
93 {
94 AcpiTbOverrideTable (NewTableDesc);
95 }
96
97 AcpiTbInitTableDescriptor (&AcpiGbl_RootTableList.Tables[i],
98 NewTableDesc->Address, NewTableDesc->Flags, NewTableDesc->Pointer);
99
100 AcpiTbPrintTableHeader (NewTableDesc->Address, NewTableDesc->Pointer);
101
102 /* This synchronizes AcpiGbl_DsdtIndex */
103
104 *TableIndex = i;
105
106 /* Set the global integer width (based upon revision of the DSDT) */
107
108 if (i == AcpiGbl_DsdtIndex)
109 {
110 AcpiUtSetIntegerWidth (NewTableDesc->Pointer->Revision);
111 }
112}
ACPI_STATUS AcpiTbGetNextTableDescriptor(UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc)
Definition: tbdata.c:762
void AcpiUtSetIntegerWidth(UINT8 Revision)
Definition: utmisc.c:181
UINT8 Revision
Definition: actbl.h:110
void AcpiTbOverrideTable(ACPI_TABLE_DESC *OldTableDesc)
Definition: tbinstal.c:250

Referenced by AcpiTbInstallStandardTable().

◆ AcpiTbInvalidateTable()

void AcpiTbInvalidateTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 414 of file tbdata.c.

416{
417
418 ACPI_FUNCTION_TRACE (TbInvalidateTable);
419
420
421 /* Table must be validated */
422
423 if (!TableDesc->Pointer)
424 {
426 }
427
428 AcpiTbReleaseTable (TableDesc->Pointer, TableDesc->Length,
429 TableDesc->Flags);
430
431 switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
432 {
434
435 TableDesc->Pointer = NULL;
436 break;
437
440 default:
441
442 break;
443 }
444
446}
#define return_VOID
Definition: acoutput.h:495
void AcpiTbReleaseTable(ACPI_TABLE_HEADER *Table, UINT32 TableLength, UINT8 TableFlags)
Definition: tbdata.c:238

Referenced by AcpiTbPutTable(), AcpiTbReleaseTempTable(), AcpiTbUninstallTable(), and AcpiTbVerifyTempTable().

◆ AcpiTbIsTableLoaded()

BOOLEAN AcpiTbIsTableLoaded ( UINT32  TableIndex)

Definition at line 1026 of file tbdata.c.

1028{
1029 BOOLEAN IsLoaded = FALSE;
1030
1031
1033 if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
1034 {
1035 IsLoaded = (BOOLEAN)
1036 (AcpiGbl_RootTableList.Tables[TableIndex].Flags &
1038 }
1039
1041 return (IsLoaded);
1042}
#define ACPI_TABLE_IS_LOADED
Definition: actbl.h:434
#define BOOLEAN
Definition: pedump.c:73

Referenced by AcpiNsLoadTable(), and AcpiTbUnloadTable().

◆ AcpiTbLoadNamespace()

ACPI_STATUS AcpiTbLoadNamespace ( void  )

Definition at line 147 of file tbxfload.c.

149{
151 UINT32 i;
152 ACPI_TABLE_HEADER *NewDsdt;
154 UINT32 TablesLoaded = 0;
155 UINT32 TablesFailed = 0;
156
157
158 ACPI_FUNCTION_TRACE (TbLoadNamespace);
159
160
162
163 /*
164 * Load the namespace. The DSDT is required, but any SSDT and
165 * PSDT tables are optional. Verify the DSDT.
166 */
167 Table = &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex];
168
169 if (!AcpiGbl_RootTableList.CurrentTableCount ||
170 !ACPI_COMPARE_NAMESEG (Table->Signature.Ascii, ACPI_SIG_DSDT) ||
172 {
174 goto UnlockAndExit;
175 }
176
177 /*
178 * Save the DSDT pointer for simple access. This is the mapped memory
179 * address. We must take care here because the address of the .Tables
180 * array can change dynamically as tables are loaded at run-time. Note:
181 * .Pointer field is not validated until after call to AcpiTbValidateTable.
182 */
183 AcpiGbl_DSDT = Table->Pointer;
184
185 /*
186 * Optionally copy the entire DSDT to local memory (instead of simply
187 * mapping it.) There are some BIOSs that corrupt or replace the original
188 * DSDT, creating the need for this option. Default is FALSE, do not copy
189 * the DSDT.
190 */
191 if (AcpiGbl_CopyDsdtLocally)
192 {
193 NewDsdt = AcpiTbCopyDsdt (AcpiGbl_DsdtIndex);
194 if (NewDsdt)
195 {
196 AcpiGbl_DSDT = NewDsdt;
197 }
198 }
199
200 /*
201 * Save the original DSDT header for detection of table corruption
202 * and/or replacement of the DSDT from outside the OS.
203 */
204 memcpy (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,
205 sizeof (ACPI_TABLE_HEADER));
206
207 /* Load and parse tables */
208
210 Status = AcpiNsLoadTable (AcpiGbl_DsdtIndex, AcpiGbl_RootNode);
212 if (ACPI_FAILURE (Status))
213 {
214 ACPI_EXCEPTION ((AE_INFO, Status, "[DSDT] table load failed"));
215 TablesFailed++;
216 }
217 else
218 {
219 TablesLoaded++;
220 }
221
222 /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
223
224 for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
225 {
226 Table = &AcpiGbl_RootTableList.Tables[i];
227
228 if (!Table->Address ||
229 (!ACPI_COMPARE_NAMESEG (Table->Signature.Ascii, ACPI_SIG_SSDT) &&
230 !ACPI_COMPARE_NAMESEG (Table->Signature.Ascii, ACPI_SIG_PSDT) &&
231 !ACPI_COMPARE_NAMESEG (Table->Signature.Ascii, ACPI_SIG_OSDT)) ||
233 {
234 continue;
235 }
236
237 /* Ignore errors while loading tables, get as many as possible */
238
240 Status = AcpiNsLoadTable (i, AcpiGbl_RootNode);
242 if (ACPI_FAILURE (Status))
243 {
244 ACPI_EXCEPTION ((AE_INFO, Status, "(%4.4s:%8.8s) while loading table",
245 Table->Signature.Ascii, Table->Pointer->OemTableId));
246
247 TablesFailed++;
248
250 "Table [%4.4s:%8.8s] (id FF) - Table namespace load failed\n\n",
251 Table->Signature.Ascii, Table->Pointer->OemTableId));
252 }
253 else
254 {
255 TablesLoaded++;
256 }
257 }
258
259 if (!TablesFailed)
260 {
261 ACPI_INFO ((
262 "%u ACPI AML tables successfully acquired and loaded",
263 TablesLoaded));
264 }
265 else
266 {
268 "%u table load failures, %u successful",
269 TablesFailed, TablesLoaded));
270
271 /* Indicate at least one failure */
272
274 }
275
276#ifdef ACPI_APPLICATION
278#endif
279
280
281UnlockAndExit:
284}
#define AE_NO_ACPI_TABLES
Definition: acexcep.h:110
ACPI_STATUS AcpiNsLoadTable(UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node)
Definition: nsload.c:82
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
#define ACPI_DB_INIT
Definition: acoutput.h:151
ACPI_TABLE_HEADER * AcpiTbCopyDsdt(UINT32 TableIndex)
Definition: tbutils.c:163
#define ACPI_SIG_DSDT
Definition: actbl.h:67
#define ACPI_SIG_PSDT
Definition: actbl.h:71
#define ACPI_SIG_OSDT
Definition: actbl.h:70

Referenced by AcpiLoadTables().

◆ AcpiTbLoadTable()

ACPI_STATUS AcpiTbLoadTable ( UINT32  TableIndex,
ACPI_NAMESPACE_NODE ParentNode 
)

Definition at line 1097 of file tbdata.c.

1100{
1104
1105
1106 ACPI_FUNCTION_TRACE (TbLoadTable);
1107
1108
1109 /*
1110 * Note: Now table is "INSTALLED", it must be validated before
1111 * using.
1112 */
1113 Status = AcpiGetTableByIndex (TableIndex, &Table);
1114 if (ACPI_FAILURE (Status))
1115 {
1117 }
1118
1119 Status = AcpiNsLoadTable (TableIndex, ParentNode);
1120 if (ACPI_FAILURE (Status))
1121 {
1123 }
1124
1125 /*
1126 * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
1127 * responsible for discovering any new wake GPEs by running _PRW methods
1128 * that may have been loaded by this table.
1129 */
1130 Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
1131 if (ACPI_SUCCESS (Status))
1132 {
1134 }
1135
1136 /* Invoke table handler */
1137
1140}
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define ACPI_TABLE_EVENT_LOAD
Definition: actypes.h:1193
void AcpiEvUpdateGpes(ACPI_OWNER_ID TableOwnerId)
Definition: evgpeinit.c:233
ACPI_STATUS AcpiTbGetOwnerId(UINT32 TableIndex, ACPI_OWNER_ID *OwnerId)
Definition: tbdata.c:993
void AcpiTbNotifyTable(UINT32 Event, void *Table)
Definition: tbdata.c:1259

Referenced by AcpiExLoadTableOp(), and AcpiTbInstallAndLoadTable().

◆ AcpiTbNotifyTable()

void AcpiTbNotifyTable ( UINT32  Event,
void Table 
)

Definition at line 1259 of file tbdata.c.

1262{
1263 /* Invoke table handler if present */
1264
1265 if (AcpiGbl_TableHandler)
1266 {
1267 (void) AcpiGbl_TableHandler (Event, Table,
1268 AcpiGbl_TableHandlerContext);
1269 }
1270}

Referenced by AcpiTbInstallStandardTable(), AcpiTbLoadTable(), and AcpiTbUnloadTable().

◆ AcpiTbOverrideTable()

void AcpiTbOverrideTable ( ACPI_TABLE_DESC OldTableDesc)

Definition at line 250 of file tbinstal.c.

252{
254 ACPI_TABLE_DESC NewTableDesc;
256 ACPI_PHYSICAL_ADDRESS Address;
258 ACPI_ERROR_ONLY (char *OverrideType);
259
260
261 /* (1) Attempt logical override (returns a logical address) */
262
263 Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table);
264 if (ACPI_SUCCESS (Status) && Table)
265 {
268 ACPI_ERROR_ONLY (OverrideType = "Logical");
269 goto FinishOverride;
270 }
271
272 /* (2) Attempt physical override (returns a physical address) */
273
275 &Address, &Length);
276 if (ACPI_SUCCESS (Status) && Address && Length)
277 {
278 AcpiTbAcquireTempTable (&NewTableDesc, Address,
280 ACPI_ERROR_ONLY (OverrideType = "Physical");
281 goto FinishOverride;
282 }
283
284 return; /* There was no override */
285
286
287FinishOverride:
288
289 /*
290 * Validate and verify a table before overriding, no nested table
291 * duplication check as it's too complicated and unnecessary.
292 */
293 Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, NULL);
294 if (ACPI_FAILURE (Status))
295 {
296 return;
297 }
298
299 ACPI_INFO (("%4.4s 0x%8.8X%8.8X"
300 " %s table override, new table: 0x%8.8X%8.8X",
301 OldTableDesc->Signature.Ascii,
302 ACPI_FORMAT_UINT64 (OldTableDesc->Address),
303 OverrideType, ACPI_FORMAT_UINT64 (NewTableDesc.Address)));
304
305 /* We can now uninstall the original table */
306
307 AcpiTbUninstallTable (OldTableDesc);
308
309 /*
310 * Replace the original table descriptor and keep its state as
311 * "VALIDATED".
312 */
313 AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
314 NewTableDesc.Flags, NewTableDesc.Pointer);
315 AcpiTbValidateTempTable (OldTableDesc);
316
317 /* Release the temporary table descriptor */
318
319 AcpiTbReleaseTempTable (&NewTableDesc);
320}
#define ACPI_ERROR_ONLY(s)
Definition: acmacros.h:467
ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable)
Definition: osl.c:72
ACPI_STATUS AcpiOsPhysicalTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_PHYSICAL_ADDRESS *NewAddress, UINT32 *NewTableLength)
Definition: osl.c:89
ACPI_STATUS AcpiTbValidateTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:463

Referenced by AcpiTbInstallTableWithOverride().

◆ AcpiTbParseFadt()

void AcpiTbParseFadt ( void  )

Definition at line 339 of file tbfadt.c.

341{
344 ACPI_TABLE_DESC *FadtDesc;
346
347
348 /*
349 * The FADT has multiple versions with different lengths,
350 * and it contains pointers to both the DSDT and FACS tables.
351 *
352 * Get a local copy of the FADT and convert it to a common format
353 * Map entire FADT, assumed to be smaller than one page.
354 */
355 FadtDesc = &AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex];
356 Status = AcpiTbGetTable (FadtDesc, &Table);
357 if (ACPI_FAILURE (Status))
358 {
359 return;
360 }
361 Length = FadtDesc->Length;
362
363 /*
364 * Validate the FADT checksum before we copy the table. Ignore
365 * checksum error as we want to try to get the DSDT and FACS.
366 */
368
369 /* Create a local copy of the FADT in common ACPI 2.0+ format */
370
372
373 /* All done with the real FADT, unmap it */
374
375 AcpiTbPutTable (FadtDesc);
376
377 /* Obtain the DSDT and FACS tables via their addresses within the FADT */
378
380 (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt,
382 &AcpiGbl_DsdtIndex);
383
384 /* If Hardware Reduced flag is set, there is no FACS */
385
386 if (!AcpiGbl_ReducedHardware)
387 {
388 if (AcpiGbl_FADT.Facs)
389 {
391 (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs,
393 &AcpiGbl_FacsIndex);
394 }
395 if (AcpiGbl_FADT.XFacs)
396 {
398 (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
400 &AcpiGbl_XFacsIndex);
401 }
402 }
403}
ACPI_STATUS AcpiTbGetTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable)
Definition: tbutils.c:434
void AcpiTbPutTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbutils.c:491
ACPI_STATUS AcpiUtVerifyChecksum(ACPI_TABLE_HEADER *Table, UINT32 Length)
Definition: utcksum.c:74
void AcpiTbCreateLocalFadt(ACPI_TABLE_HEADER *Table, UINT32 Length)
Definition: tbfadt.c:423

Referenced by AcpiTbParseRootTable().

◆ AcpiTbParseRootTable()

ACPI_STATUS AcpiTbParseRootTable ( ACPI_PHYSICAL_ADDRESS  RsdpAddress)

Definition at line 277 of file tbutils.c.

279{
280 ACPI_TABLE_RSDP *Rsdp;
281 UINT32 TableEntrySize;
282 UINT32 i;
283 UINT32 TableCount;
285 ACPI_PHYSICAL_ADDRESS Address;
289 UINT32 TableIndex;
290
291
292 ACPI_FUNCTION_TRACE (TbParseRootTable);
293
294
295 /* Map the entire RSDP and extract the address of the RSDT or XSDT */
296
297 Rsdp = AcpiOsMapMemory (RsdpAddress, sizeof (ACPI_TABLE_RSDP));
298 if (!Rsdp)
299 {
301 }
302
303 AcpiTbPrintTableHeader (RsdpAddress,
305
306 /* Use XSDT if present and not overridden. Otherwise, use RSDT */
307
308 if ((Rsdp->Revision > 1) &&
309 Rsdp->XsdtPhysicalAddress &&
310 !AcpiGbl_DoNotUseXsdt)
311 {
312 /*
313 * RSDP contains an XSDT (64-bit physical addresses). We must use
314 * the XSDT if the revision is > 1 and the XSDT pointer is present,
315 * as per the ACPI specification.
316 */
317 Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->XsdtPhysicalAddress;
318 TableEntrySize = ACPI_XSDT_ENTRY_SIZE;
319 }
320 else
321 {
322 /* Root table is an RSDT (32-bit physical addresses) */
323
324 Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
325 TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
326 }
327
328 /*
329 * It is not possible to map more than one entry in some environments,
330 * so unmap the RSDP here before mapping other tables
331 */
332 AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
333
334 /* Map the RSDT/XSDT table header to get the full table length */
335
337 if (!Table)
338 {
340 }
341
343
344 /*
345 * Validate length of the table, and map entire table.
346 * Minimum length table must contain at least one entry.
347 */
348 Length = Table->Length;
350
351 if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize))
352 {
354 "Invalid table length 0x%X in RSDT/XSDT", Length));
356 }
357
359 if (!Table)
360 {
362 }
363
364 /* Validate the root table checksum */
365
367 if (ACPI_FAILURE (Status))
368 {
371 }
372
373 /* Get the number of entries and pointer to first entry */
374
375 TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
376 TableEntrySize);
378
379 /* Initialize the root table array from the RSDT/XSDT */
380
381 for (i = 0; i < TableCount; i++)
382 {
383 /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
384
385 Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
386
387 /* Skip NULL entries in RSDT/XSDT */
388
389 if (!Address)
390 {
391 goto NextTable;
392 }
393
396 &TableIndex);
397
398 if (ACPI_SUCCESS (Status) &&
400 &AcpiGbl_RootTableList.Tables[TableIndex].Signature,
402 {
403 AcpiGbl_FadtIndex = TableIndex;
405 }
406
407NextTable:
408
409 TableEntry += TableEntrySize;
410 }
411
414}
unsigned char UINT8
#define AE_INVALID_TABLE_LENGTH
Definition: acexcep.h:171
void AcpiTbParseFadt(void)
Definition: tbfadt.c:339
#define ACPI_SIG_FADT
Definition: actbl.h:68
#define ACPI_RSDT_ENTRY_SIZE
Definition: actbl.h:208
#define ACPI_XSDT_ENTRY_SIZE
Definition: actbl.h:209
#define ACPI_ADD_PTR(t, a, b)
Definition: actypes.h:546
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
UINT64 XsdtPhysicalAddress
Definition: actbl.h:157
UINT32 RsdtPhysicalAddress
Definition: actbl.h:155
static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry(UINT8 *TableEntry, UINT32 TableEntrySize)
Definition: tbutils.c:214
_Must_inspect_result_ typedef _In_ ULONG TableEntry
Definition: iotypes.h:4303

Referenced by AcpiInitializeTables().

◆ AcpiTbPrintTableHeader()

void AcpiTbPrintTableHeader ( ACPI_PHYSICAL_ADDRESS  Address,
ACPI_TABLE_HEADER Header 
)

Definition at line 143 of file tbprint.c.

146{
147 ACPI_TABLE_HEADER LocalHeader;
148
149
150 if (ACPI_COMPARE_NAMESEG (Header->Signature, ACPI_SIG_FACS))
151 {
152 /* FACS only has signature and length fields */
153
154 ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
155 Header->Signature, ACPI_FORMAT_UINT64 (Address),
156 Header->Length));
157 }
159 Header)->Signature))
160 {
161 /* RSDP has no common fields */
162
164 Header)->OemId, ACPI_OEM_ID_SIZE);
166
167 ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
172 LocalHeader.OemId));
173 }
174 else
175 {
176 /* Standard ACPI table with full common header */
177
178 AcpiTbCleanupTableHeader (&LocalHeader, Header);
179
180 ACPI_INFO ((
181 "%-4.4s 0x%8.8X%8.8X"
182 " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
183 LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
184 LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
185 LocalHeader.OemTableId, LocalHeader.OemRevision,
186 LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
187 }
188}
#define ACPI_SIG_FACS
Definition: actbl.h:69
_In_ ULONG Revision
Definition: rtlfuncs.h:1142
UINT32 OemRevision
Definition: actbl.h:114
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]
Definition: actbl.h:113
char AslCompilerId[ACPI_NAMESEG_SIZE]
Definition: actbl.h:115
char OemId[ACPI_OEM_ID_SIZE]
Definition: actbl.h:112
UINT32 AslCompilerRevision
Definition: actbl.h:116
char Signature[ACPI_NAMESEG_SIZE]
Definition: actbl.h:108
static void AcpiTbCleanupTableHeader(ACPI_TABLE_HEADER *OutHeader, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:115
static void AcpiTbFixString(char *String, ACPI_SIZE Length)
Definition: tbprint.c:82

Referenced by AcpiTbCheckDsdtHeader(), AcpiTbInstallTableWithOverride(), and AcpiTbParseRootTable().

◆ AcpiTbPutTable()

void AcpiTbPutTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 491 of file tbutils.c.

493{
494
496
497
499 {
500 TableDesc->ValidationCount--;
501
502 /*
503 * Detect ValidationCount underflows to ensure that the warning
504 * message will only be printed once.
505 */
507 {
509 "Table %p, Validation count underflows\n", TableDesc));
511 }
512 }
513
514 if (TableDesc->ValidationCount == 0)
515 {
516 /* Table need to be "INVALIDATED" */
517
518 AcpiTbInvalidateTable (TableDesc);
519 }
520
522}
void AcpiTbInvalidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:414
void AcpiTbPutTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbutils.c:491

Referenced by AcpiPutTable(), AcpiTbParseFadt(), and AcpiTbPutTable().

◆ AcpiTbReleaseOwnerId()

ACPI_STATUS AcpiTbReleaseOwnerId ( UINT32  TableIndex)

Definition at line 957 of file tbdata.c.

959{
961
962
963 ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
964
965
967 if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
968 {
970 &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
971 Status = AE_OK;
972 }
973
976}
void AcpiUtReleaseOwnerId(ACPI_OWNER_ID *OwnerId)
Definition: utownerid.c:190

Referenced by AcpiNsLoadTable(), and AcpiTbUnloadTable().

◆ AcpiTbReleaseTable()

void AcpiTbReleaseTable ( ACPI_TABLE_HEADER Table,
UINT32  TableLength,
UINT8  TableFlags 
)

Definition at line 238 of file tbdata.c.

242{
243
244 switch (TableFlags & ACPI_TABLE_ORIGIN_MASK)
245 {
247
248 AcpiOsUnmapMemory (Table, TableLength);
249 break;
250
253 default:
254
255 break;
256 }
257}

Referenced by AcpiTbCompareTables(), and AcpiTbInvalidateTable().

◆ AcpiTbReleaseTempTable()

void AcpiTbReleaseTempTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 348 of file tbdata.c.

350{
351
352 /*
353 * Note that the .Address is maintained by the callers of
354 * AcpiTbAcquireTempTable(), thus do not invoke AcpiTbUninstallTable()
355 * where .Address will be freed.
356 */
357 AcpiTbInvalidateTable (TableDesc);
358}
void AcpiTbInvalidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:414

Referenced by AcpiTbInstallStandardTable(), and AcpiTbOverrideTable().

◆ AcpiTbResizeRootTableList()

ACPI_STATUS AcpiTbResizeRootTableList ( void  )

Definition at line 677 of file tbdata.c.

679{
680 ACPI_TABLE_DESC *Tables;
681 UINT32 TableCount;
682 UINT32 CurrentTableCount, MaxTableCount;
683 UINT32 i;
684
685
686 ACPI_FUNCTION_TRACE (TbResizeRootTableList);
687
688
689 /* AllowResize flag is a parameter to AcpiInitializeTables */
690
691 if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
692 {
693 ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
695 }
696
697 /* Increase the Table Array size */
698
699 if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
700 {
701 TableCount = AcpiGbl_RootTableList.MaxTableCount;
702 }
703 else
704 {
705 TableCount = AcpiGbl_RootTableList.CurrentTableCount;
706 }
707
708 MaxTableCount = TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
709 Tables = ACPI_ALLOCATE_ZEROED (
710 ((ACPI_SIZE) MaxTableCount) * sizeof (ACPI_TABLE_DESC));
711 if (!Tables)
712 {
713 ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
715 }
716
717 /* Copy and free the previous table array */
718
719 CurrentTableCount = 0;
720 if (AcpiGbl_RootTableList.Tables)
721 {
722 for (i = 0; i < TableCount; i++)
723 {
724 if (AcpiGbl_RootTableList.Tables[i].Address)
725 {
726 memcpy (Tables + CurrentTableCount,
727 AcpiGbl_RootTableList.Tables + i,
729 CurrentTableCount++;
730 }
731 }
732
733 if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
734 {
735 ACPI_FREE (AcpiGbl_RootTableList.Tables);
736 }
737 }
738
739 AcpiGbl_RootTableList.Tables = Tables;
740 AcpiGbl_RootTableList.MaxTableCount = MaxTableCount;
741 AcpiGbl_RootTableList.CurrentTableCount = CurrentTableCount;
742 AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
743
745}
#define AE_SUPPORT
Definition: acexcep.h:123
#define ACPI_ROOT_ORIGIN_ALLOCATED
Definition: aclocal.h:244
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
#define ACPI_ROOT_TABLE_SIZE_INCREMENT
Definition: acconfig.h:140

Referenced by AcpiAllocateRootTable(), AcpiReallocateRootTable(), and AcpiTbGetNextTableDescriptor().

◆ AcpiTbScanMemoryForRsdp()

UINT8 * AcpiTbScanMemoryForRsdp ( UINT8 StartAddress,
UINT32  Length 
)

Definition at line 296 of file tbxfroot.c.

299{
301 UINT8 *MemRover;
302 UINT8 *EndAddress;
303
304
305 ACPI_FUNCTION_TRACE (TbScanMemoryForRsdp);
306
307
308 EndAddress = StartAddress + Length;
309
310 /* Search from given start address for the requested length */
311
312 for (MemRover = StartAddress; MemRover < EndAddress;
313 MemRover += ACPI_RSDP_SCAN_STEP)
314 {
315 /* The RSDP signature and checksum must both be correct */
316
318 ACPI_CAST_PTR (ACPI_TABLE_RSDP, MemRover));
319 if (ACPI_SUCCESS (Status))
320 {
321 /* Sig and checksum valid, we have found a real RSDP */
322
324 "RSDP located at physical address %p\n", MemRover));
325 return_PTR (MemRover);
326 }
327
328 /* No sig match or bad checksum, keep searching */
329 }
330
331 /* Searched entire block, no RSDP was found */
332
334 "Searched entire block from %p, valid RSDP was not found\n",
335 StartAddress));
337}
#define return_PTR(s)
Definition: acoutput.h:497
#define ACPI_DB_INFO
Definition: acoutput.h:153
#define ACPI_RSDP_SCAN_STEP
Definition: acconfig.h:193
ACPI_STATUS AcpiTbValidateRsdp(ACPI_TABLE_RSDP *Rsdp)
Definition: tbxfroot.c:103

Referenced by AcpiFindRootPointer().

◆ AcpiTbSetTableLoadedFlag()

void AcpiTbSetTableLoadedFlag ( UINT32  TableIndex,
BOOLEAN  IsLoaded 
)

Definition at line 1059 of file tbdata.c.

1062{
1063
1065 if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
1066 {
1067 if (IsLoaded)
1068 {
1069 AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
1071 }
1072 else
1073 {
1074 AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
1075 ~ACPI_TABLE_IS_LOADED;
1076 }
1077 }
1078
1080}

Referenced by AcpiNsLoadTable(), and AcpiTbUnloadTable().

◆ AcpiTbTerminate()

void AcpiTbTerminate ( void  )

Definition at line 811 of file tbdata.c.

813{
814 UINT32 i;
815
816
817 ACPI_FUNCTION_TRACE (TbTerminate);
818
819
821
822 /* Delete the individual tables */
823
824 for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
825 {
826 AcpiTbUninstallTable (&AcpiGbl_RootTableList.Tables[i]);
827 }
828
829 /*
830 * Delete the root table array if allocated locally. Array cannot be
831 * mapped, so we don't need to check for that flag.
832 */
833 if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
834 {
835 ACPI_FREE (AcpiGbl_RootTableList.Tables);
836 }
837
838 AcpiGbl_RootTableList.Tables = NULL;
839 AcpiGbl_RootTableList.Flags = 0;
840 AcpiGbl_RootTableList.CurrentTableCount = 0;
841
842 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
843
846}

Referenced by AcpiUtSubsystemShutdown().

◆ AcpiTbUninstallTable()

void AcpiTbUninstallTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 336 of file tbinstal.c.

338{
339
340 ACPI_FUNCTION_TRACE (TbUninstallTable);
341
342
343 /* Table must be installed */
344
345 if (!TableDesc->Address)
346 {
348 }
349
350 AcpiTbInvalidateTable (TableDesc);
351
352 if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
354 {
355 ACPI_FREE (TableDesc->Pointer);
356 TableDesc->Pointer = NULL;
357 }
358
359 TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);
361}

Referenced by AcpiReallocateRootTable(), AcpiTbCopyDsdt(), AcpiTbInstallStandardTable(), AcpiTbOverrideTable(), and AcpiTbTerminate().

◆ AcpiTbUnloadTable()

ACPI_STATUS AcpiTbUnloadTable ( UINT32  TableIndex)

Definition at line 1206 of file tbdata.c.

1208{
1211
1212
1213 ACPI_FUNCTION_TRACE (TbUnloadTable);
1214
1215
1216 /* Ensure the table is still loaded */
1217
1218 if (!AcpiTbIsTableLoaded (TableIndex))
1219 {
1221 }
1222
1223 /* Invoke table handler */
1224
1225 Status = AcpiGetTableByIndex (TableIndex, &Table);
1226 if (ACPI_SUCCESS (Status))
1227 {
1229 }
1230
1231 /* Delete the portion of the namespace owned by this table */
1232
1233 Status = AcpiTbDeleteNamespaceByOwner (TableIndex);
1234 if (ACPI_FAILURE (Status))
1235 {
1237 }
1238
1239 (void) AcpiTbReleaseOwnerId (TableIndex);
1240 AcpiTbSetTableLoadedFlag (TableIndex, FALSE);
1242}
#define ACPI_TABLE_EVENT_UNLOAD
Definition: actypes.h:1194
void AcpiTbSetTableLoadedFlag(UINT32 TableIndex, BOOLEAN IsLoaded)
Definition: tbdata.c:1059
BOOLEAN AcpiTbIsTableLoaded(UINT32 TableIndex)
Definition: tbdata.c:1026
ACPI_STATUS AcpiTbReleaseOwnerId(UINT32 TableIndex)
Definition: tbdata.c:957
ACPI_STATUS AcpiTbDeleteNamespaceByOwner(UINT32 TableIndex)
Definition: tbdata.c:862

Referenced by AcpiExUnloadTable(), AcpiUnloadParentTable(), and AcpiUnloadTable().

◆ AcpiTbValidateRsdp()

ACPI_STATUS AcpiTbValidateRsdp ( ACPI_TABLE_RSDP Rsdp)

Definition at line 103 of file tbxfroot.c.

105{
106
107 /*
108 * The signature and checksum must both be correct
109 *
110 * Note: Sometimes there exists more than one RSDP in memory; the valid
111 * RSDP has a valid checksum, all others have an invalid checksum.
112 */
114 {
115 /* Nope, BAD Signature */
116
117 return (AE_BAD_SIGNATURE);
118 }
119
120 /* Check the standard checksum */
121
123 {
124 return (AE_BAD_CHECKSUM);
125 }
126
127 /* Check extended checksum if table version >= 2 */
128
129 if ((Rsdp->Revision >= 2) &&
131 {
132 return (AE_BAD_CHECKSUM);
133 }
134
135 return (AE_OK);
136}
#define AE_BAD_CHECKSUM
Definition: acexcep.h:169
UINT8 AcpiUtChecksum(UINT8 *Buffer, UINT32 Length)
Definition: utcksum.c:213
#define ACPI_RSDP_XCHECKSUM_LENGTH
Definition: acconfig.h:211

Referenced by AcpiTbScanMemoryForRsdp().

◆ AcpiTbValidateTable()

ACPI_STATUS AcpiTbValidateTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 375 of file tbdata.c.

377{
379
380
381 ACPI_FUNCTION_TRACE (TbValidateTable);
382
383
384 /* Validate the table if necessary */
385
386 if (!TableDesc->Pointer)
387 {
388 Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer,
389 &TableDesc->Length, &TableDesc->Flags);
390 if (!TableDesc->Pointer)
391 {
393 }
394 }
395
397}
ACPI_STATUS AcpiTbAcquireTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **TablePtr, UINT32 *TableLength, UINT8 *TableFlags)
Definition: tbdata.c:180

Referenced by AcpiTbFindTable(), AcpiTbGetTable(), AcpiTbLoadNamespace(), and AcpiTbValidateTempTable().

◆ AcpiTbValidateTempTable()

ACPI_STATUS AcpiTbValidateTempTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 463 of file tbdata.c.

465{
466
467 if (!TableDesc->Pointer && !AcpiGbl_EnableTableValidation)
468 {
469 /*
470 * Only validates the header of the table.
471 * Note that Length contains the size of the mapping after invoking
472 * this work around, this value is required by
473 * AcpiTbReleaseTempTable().
474 * We can do this because in AcpiInitTableDescriptor(), the Length
475 * field of the installed descriptor is filled with the actual
476 * table length obtaining from the table header.
477 */
478 TableDesc->Length = sizeof (ACPI_TABLE_HEADER);
479 }
480
481 return (AcpiTbValidateTable (TableDesc));
482}
struct acpi_table_header ACPI_TABLE_HEADER
ACPI_STATUS AcpiTbValidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:375

Referenced by AcpiTbOverrideTable(), and AcpiTbVerifyTempTable().

◆ AcpiTbVerifyTempTable()

ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC TableDesc,
char Signature,
UINT32 TableIndex 
)

Definition at line 584 of file tbdata.c.

588{
590
591
592 ACPI_FUNCTION_TRACE (TbVerifyTempTable);
593
594
595 /* Validate the table */
596
597 Status = AcpiTbValidateTempTable (TableDesc);
598 if (ACPI_FAILURE (Status))
599 {
601 }
602
603 /* If a particular signature is expected (DSDT/FACS), it must match */
604
605 if (Signature &&
607 {
609 "Invalid signature 0x%X for ACPI table, expected [%s]",
610 TableDesc->Signature.Integer, Signature));
612 goto InvalidateAndExit;
613 }
614
615 if (AcpiGbl_EnableTableValidation)
616 {
617 /* Verify the checksum */
618
619 Status = AcpiUtVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
620 if (ACPI_FAILURE (Status))
621 {
623 "%4.4s 0x%8.8X%8.8X"
624 " Attempted table install failed",
625 AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
626 TableDesc->Signature.Ascii : "????",
627 ACPI_FORMAT_UINT64 (TableDesc->Address)));
628
629 goto InvalidateAndExit;
630 }
631
632 /* Avoid duplications */
633
634 if (TableIndex)
635 {
636 Status = AcpiTbCheckDuplication (TableDesc, TableIndex);
637 if (ACPI_FAILURE (Status))
638 {
640 {
642 "%4.4s 0x%8.8X%8.8X"
643 " Table is already loaded",
644 AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
645 TableDesc->Signature.Ascii : "????",
646 ACPI_FORMAT_UINT64 (TableDesc->Address)));
647 }
648
649 goto InvalidateAndExit;
650 }
651 }
652
653 TableDesc->Flags |= ACPI_TABLE_IS_VERIFIED;
654 }
655
657
658InvalidateAndExit:
659 AcpiTbInvalidateTable (TableDesc);
661}
#define ACPI_TABLE_IS_VERIFIED
Definition: actbl.h:433
static ACPI_STATUS AcpiTbCheckDuplication(ACPI_TABLE_DESC *TableDesc, UINT32 *TableIndex)
Definition: tbdata.c:502
ACPI_STATUS AcpiTbValidateTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:463
UINT32 Integer
Definition: actbl.h:393

Referenced by AcpiReallocateRootTable(), AcpiTbInstallStandardTable(), and AcpiTbOverrideTable().