ReactOS  0.4.14-dev-606-g14ebc0b
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)
 
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, 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, 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)
 
UINT8 AcpiTbChecksum (UINT8 *Buffer, UINT32 Length)
 
ACPI_STATUS AcpiTbVerifyChecksum (ACPI_TABLE_HEADER *Table, UINT32 Length)
 
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 }
ACPI_STATUS AcpiTbResizeRootTableList(void)
Definition: tbdata.c:642
#define ACPI_ROOT_ALLOW_RESIZE
Definition: aclocal.h:245

Referenced by AcpiInitializeTables().

◆ AcpiTbAcquireTable()

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

Definition at line 166 of file tbdata.c.

171 {
173 
174 
175  switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
176  {
178 
179  Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length);
180  break;
181 
184 
186  ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
187  break;
188 
189  default:
190 
191  break;
192  }
193 
194  /* Table is not valid yet */
195 
196  if (!Table)
197  {
198  return (AE_NO_MEMORY);
199  }
200 
201  /* Fill the return values */
202 
203  *TablePtr = Table;
204  *TableLength = TableDesc->Length;
205  *TableFlags = TableDesc->Flags;
206  return (AE_OK);
207 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define AE_NO_MEMORY
Definition: acexcep.h:112
void * AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length)
Definition: osl.c:108
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_PHYSADDR_TO_PTR(i)
Definition: actypes.h:555
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL
Definition: actbl.h:431
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
#define ACPI_TABLE_ORIGIN_MASK
Definition: actbl.h:432
UINT32 Length
Definition: actbl.h:405
UINT8 Flags
Definition: actbl.h:408
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL
Definition: actbl.h:429

Referenced by AcpiTbCompareTables(), and AcpiTbValidateTable().

◆ AcpiTbAcquireTempTable()

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

Definition at line 265 of file tbdata.c.

269 {
270  ACPI_TABLE_HEADER *TableHeader;
271 
272 
273  switch (Flags & ACPI_TABLE_ORIGIN_MASK)
274  {
276 
277  /* Get the length of the full table from the header */
278 
279  TableHeader = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
280  if (!TableHeader)
281  {
282  return (AE_NO_MEMORY);
283  }
284 
285  AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader);
286  AcpiOsUnmapMemory (TableHeader, sizeof (ACPI_TABLE_HEADER));
287  return (AE_OK);
288 
291 
292  TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
294  if (!TableHeader)
295  {
296  return (AE_NO_MEMORY);
297  }
298 
299  AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader);
300  return (AE_OK);
301 
302  default:
303 
304  break;
305  }
306 
307  /* Table is not valid yet */
308 
309  return (AE_NO_MEMORY);
310 }
#define AE_NO_MEMORY
Definition: acexcep.h:112
void * AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length)
Definition: osl.c:108
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
#define ACPI_PHYSADDR_TO_PTR(i)
Definition: actypes.h:555
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL
Definition: actbl.h:431
#define ACPI_TABLE_ORIGIN_MASK
Definition: actbl.h:432
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL
Definition: actbl.h:429

Referenced by AcpiTbInstallStandardTable(), and AcpiTbOverrideTable().

◆ AcpiTbAllocateOwnerId()

ACPI_STATUS AcpiTbAllocateOwnerId ( UINT32  TableIndex)

Definition at line 888 of file tbdata.c.

890 {
892 
893 
894  ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
895 
896 
898  if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
899  {
901  &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
902  }
903 
906 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiUtAllocateOwnerId(ACPI_OWNER_ID *OwnerId)
Definition: utownerid.c:68
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480

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 AE_INFO
Definition: acoutput.h:230
#define ACPI_BIOS_ERROR(plist)
Definition: acoutput.h:243
void AcpiTbPrintTableHeader(ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:141

Referenced by AcpiPsExecuteMethod().

◆ AcpiTbChecksum()

UINT8 AcpiTbChecksum ( UINT8 Buffer,
UINT32  Length 
)

Definition at line 258 of file tbprint.c.

261 {
262  UINT8 Sum = 0;
263  UINT8 *End = Buffer + Length;
264 
265 
266  while (Buffer < End)
267  {
268  Sum = (UINT8) (Sum + *(Buffer++));
269  }
270 
271  return (Sum);
272 }
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
unsigned char UINT8

Referenced by AcpiTbValidateRsdp(), and AcpiTbVerifyChecksum().

◆ 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 }
UINT32 Length
Definition: actbl.h:109
void AcpiTbUninstallTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbinstal.c:333
#define ACPI_ALLOCATE(a)
Definition: actypes.h:384
smooth NULL
Definition: ftsmooth.c:416
#define AE_INFO
Definition: acoutput.h:230
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
#define ACPI_PTR_TO_PHYSADDR(i)
Definition: actypes.h:556
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL
Definition: actbl.h:431
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ACPI_INFO(plist)
Definition: acoutput.h:237
void AcpiTbInitTableDescriptor(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
Definition: tbdata.c:130
UINT32 Length
Definition: actbl.h:405
#define ACPI_ERROR(plist)
Definition: acoutput.h:240

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",
438  Table->Revision, ACPI_FADT_CONFORMANCE, Length,
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 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define TRUE
Definition: types.h:120
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define ACPI_FADT_HW_REDUCED
Definition: actbl.h:356
#define ACPI_MIN(a, b)
Definition: actypes.h:535
static void AcpiTbSetupFadtRegisters(void)
Definition: tbfadt.c:714
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
static void AcpiTbConvertFadt(void)
Definition: tbfadt.c:514
#define ACPI_FADT_CONFORMANCE
Definition: actbl.h:469
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memset(x, y, z)
Definition: compat.h:39
#define ACPI_BIOS_WARNING(plist)
Definition: acoutput.h:241

Referenced by AcpiTbParseFadt().

◆ AcpiTbDeleteNamespaceByOwner()

ACPI_STATUS AcpiTbDeleteNamespaceByOwner ( UINT32  TableIndex)

Definition at line 827 of file tbdata.c.

829 {
832 
833 
834  ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
835 
836 
838  if (ACPI_FAILURE (Status))
839  {
841  }
842 
843  if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
844  {
845  /* The table index does not exist */
846 
849  }
850 
851  /* Get the owner ID for this table, used to delete namespace nodes */
852 
853  OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
855 
856  /*
857  * Need to acquire the namespace writer lock to prevent interference
858  * with any concurrent namespace walks. The interpreter must be
859  * released during the deletion since the acquisition of the deletion
860  * lock may block, and also since the execution of a namespace walk
861  * must be allowed to use the interpreter.
862  */
863  Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
864  if (ACPI_FAILURE (Status))
865  {
867  }
868 
870  AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
872 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
ACPI_STATUS AcpiUtAcquireWriteLock(ACPI_RW_LOCK *Lock)
Definition: utlock.c:185
void AcpiUtReleaseWriteLock(ACPI_RW_LOCK *Lock)
Definition: utlock.c:197
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define AE_NOT_EXIST
Definition: acexcep.h:114
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
void AcpiNsDeleteNamespaceByOwner(ACPI_OWNER_ID OwnerId)
Definition: nsalloc.c:497
_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));
102  ACPI_COPY_NAMESEG (Header.Signature, Signature);
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 
157 UnlockAndExit:
160 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
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
BOOLEAN AcpiUtValidNameseg(char *Signature)
Definition: utascii.c:63
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_OEM_TABLE_ID_SIZE
Definition: actypes.h:422
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
Definition: Header.h:8
#define AE_BAD_SIGNATURE
Definition: acexcep.h:167
#define ACPI_DB_TABLES
Definition: acoutput.h:169
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define AE_NOT_FOUND
Definition: acexcep.h:113
#define AE_AML_STRING_LIMIT
Definition: acexcep.h:196
#define ACPI_OEM_ID_SIZE
Definition: actypes.h:421
#define ACPI_COPY_NAMESEG(dest, src)
Definition: actypes.h:562
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiTbValidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:353
#define ACPI_NAMESEG_SIZE
Definition: actypes.h:415
static const WCHAR Signature[]
Definition: parser.c:141
#define memset(x, y, z)
Definition: compat.h:39
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiDsEvalTableRegionOperands(), and AcpiExLoadTableOp().

◆ AcpiTbGetNextTableDescriptor()

ACPI_STATUS AcpiTbGetNextTableDescriptor ( UINT32 TableIndex,
ACPI_TABLE_DESC **  TableDesc 
)

Definition at line 727 of file tbdata.c.

730 {
732  UINT32 i;
733 
734 
735  /* Ensure that there is room for the table in the Root Table List */
736 
737  if (AcpiGbl_RootTableList.CurrentTableCount >=
738  AcpiGbl_RootTableList.MaxTableCount)
739  {
741  if (ACPI_FAILURE (Status))
742  {
743  return (Status);
744  }
745  }
746 
747  i = AcpiGbl_RootTableList.CurrentTableCount;
748  AcpiGbl_RootTableList.CurrentTableCount++;
749 
750  if (TableIndex)
751  {
752  *TableIndex = i;
753  }
754  if (TableDesc)
755  {
756  *TableDesc = &AcpiGbl_RootTableList.Tables[i];
757  }
758 
759  return (AE_OK);
760 }
ACPI_STATUS AcpiTbResizeRootTableList(void)
Definition: tbdata.c:642
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
unsigned int UINT32
Status
Definition: gdiplustypes.h:24
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiTbInstallTableWithOverride().

◆ AcpiTbGetOwnerId()

ACPI_STATUS AcpiTbGetOwnerId ( UINT32  TableIndex,
ACPI_OWNER_ID OwnerId 
)

Definition at line 958 of file tbdata.c.

961 {
963 
964 
965  ACPI_FUNCTION_TRACE (TbGetOwnerId);
966 
967 
969  if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
970  {
971  *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
972  Status = AE_OK;
973  }
974 
977 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
_Must_inspect_result_ _In_opt_ PVOID OwnerId
Definition: fsrtlfuncs.h:907
#define AE_OK
Definition: acexcep.h:97

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

◆ AcpiTbGetRsdpLength()

UINT32 AcpiTbGetRsdpLength ( ACPI_TABLE_RSDP Rsdp)

Definition at line 66 of file tbxfroot.c.

68 {
69 
70  if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
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 }
char Signature[8]
Definition: actbl.h:151
UINT8 Revision
Definition: actbl.h:154
UINT32 Length
Definition: actbl.h:156
#define ACPI_VALIDATE_RSDP_SIG(a)
Definition: actypes.h:570
#define ACPI_RSDP_CHECKSUM_LENGTH
Definition: acconfig.h:210

◆ AcpiTbGetTable()

ACPI_STATUS AcpiTbGetTable ( ACPI_TABLE_DESC TableDesc,
ACPI_TABLE_HEADER **  OutTable 
)

Definition at line 433 of file tbutils.c.

436 {
438 
439 
441 
442 
443  if (TableDesc->ValidationCount == 0)
444  {
445  /* Table need to be "VALIDATED" */
446 
447  Status = AcpiTbValidateTable (TableDesc);
448  if (ACPI_FAILURE (Status))
449  {
451  }
452  }
453 
455  {
456  TableDesc->ValidationCount++;
457 
458  /*
459  * Detect ValidationCount overflows to ensure that the warning
460  * message will only be printed once.
461  */
463  {
465  "Table %p, Validation count overflows\n", TableDesc));
466  }
467  }
468 
469  *OutTable = TableDesc->Pointer;
471 }
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
ACPI_STATUS AcpiTbGetTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable)
Definition: tbutils.c:433
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
UINT16 ValidationCount
Definition: actbl.h:409
#define AE_INFO
Definition: acoutput.h:230
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_MAX_TABLE_VALIDATIONS
Definition: actbl.h:425
ACPI_STATUS AcpiTbValidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:353
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiGetTable(), AcpiGetTableByIndex(), 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 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiGetTableByIndex(UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)
Definition: tbxface.c:491
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_CAST_INDIRECT_PTR(t, p)
Definition: actypes.h:545
#define AE_OK
Definition: acexcep.h:97

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, since the
139  * 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 }
ASMGENDATA Table[]
Definition: genincdata.c:61
char Ascii[4]
Definition: actbl.h:394
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ACPI_NAME_UNION Signature
Definition: actbl.h:406
static WCHAR Address[46]
Definition: ping.c:68
#define ACPI_MOVE_32_TO_32(d, s)
Definition: acmacros.h:148
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
UINT32 Length
Definition: actbl.h:405
UINT8 Flags
Definition: actbl.h:408
#define memset(x, y, z)
Definition: compat.h:39

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

◆ AcpiTbInstallAndLoadTable()

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

Definition at line 1124 of file tbdata.c.

1129 {
1131  UINT32 i;
1132 
1133 
1134  ACPI_FUNCTION_TRACE (TbInstallAndLoadTable);
1135 
1136 
1137  /* Install the table and load it into the namespace */
1138 
1140  Override, &i);
1141  if (ACPI_FAILURE (Status))
1142  {
1143  goto Exit;
1144  }
1145 
1146  Status = AcpiTbLoadTable (i, AcpiGbl_RootNode);
1147 
1148 Exit:
1149  *TableIndex = i;
1151 }
#define TRUE
Definition: types.h:120
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiTbInstallStandardTable(ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, BOOLEAN Reload, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbinstal.c:137
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
unsigned int UINT32
static WCHAR Address[46]
Definition: ping.c:68
static void Exit(void)
Definition: sock.c:1331
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiTbLoadTable(UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode)
Definition: tbdata.c:1062

Referenced by AcpiExLoadOp(), and AcpiLoadTable().

◆ AcpiTbInstallStandardTable()

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

Definition at line 137 of file tbinstal.c.

143 {
144  UINT32 i;
146  ACPI_TABLE_DESC NewTableDesc;
147 
148 
149  ACPI_FUNCTION_TRACE (TbInstallStandardTable);
150 
151 
152  /* Acquire a temporary table descriptor for validation */
153 
154  Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
155  if (ACPI_FAILURE (Status))
156  {
158  "Could not acquire table length at %8.8X%8.8X",
161  }
162 
163  /*
164  * Optionally do not load any SSDTs from the RSDT/XSDT. This can
165  * be useful for debugging ACPI problems on some machines.
166  */
167  if (!Reload &&
168  AcpiGbl_DisableSsdtTableInstall &&
170  {
171  ACPI_INFO ((
172  "Ignoring installation of %4.4s at %8.8X%8.8X",
173  NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
174  goto ReleaseAndExit;
175  }
176 
177  /* Acquire the table lock */
178 
180 
181  /* Validate and verify a table before installation */
182 
183  Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i);
184  if (ACPI_FAILURE (Status))
185  {
186  if (Status == AE_CTRL_TERMINATE)
187  {
188  /*
189  * Table was unloaded, allow it to be reloaded.
190  * As we are going to return AE_OK to the caller, we should
191  * take the responsibility of freeing the input descriptor.
192  * Refill the input descriptor to ensure
193  * AcpiTbInstallTableWithOverride() can be called again to
194  * indicate the re-installation.
195  */
196  AcpiTbUninstallTable (&NewTableDesc);
198  *TableIndex = i;
200  }
201  goto UnlockAndExit;
202  }
203 
204  /* Add the table to the global root table list */
205 
206  AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex);
207 
208  /* Invoke table handler */
209 
213 
214 UnlockAndExit:
215 
216  /* Release the table lock */
217 
219 
220 ReleaseAndExit:
221 
222  /* Release the temporary table descriptor */
223 
224  AcpiTbReleaseTempTable (&NewTableDesc);
226 }
ACPI_STATUS AcpiTbAcquireTempTable(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags)
Definition: tbdata.c:265
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
char Ascii[4]
Definition: actbl.h:394
UINT32 ACPI_STATUS
Definition: actypes.h:460
void AcpiTbUninstallTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbinstal.c:333
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
ACPI_NAME_UNION Signature
Definition: actbl.h:406
smooth NULL
Definition: ftsmooth.c:416
#define AE_INFO
Definition: acoutput.h:230
static WCHAR Address[46]
Definition: ping.c:68
void AcpiTbReleaseTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:326
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
#define ACPI_TABLE_EVENT_INSTALL
Definition: actypes.h:1184
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
void AcpiTbNotifyTable(UINT32 Event, void *Table)
Definition: tbdata.c:1220
#define ACPI_SIG_SSDT
Definition: actbl.h:75
#define ACPI_INFO(plist)
Definition: acoutput.h:237
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
ACPI_STATUS AcpiTbVerifyTempTable(ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex)
Definition: tbdata.c:549
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
void AcpiTbInstallTableWithOverride(ACPI_TABLE_DESC *NewTableDesc, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbinstal.c:70
#define AE_OK
Definition: acexcep.h:97

Referenced by 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 }
void AcpiUtSetIntegerWidth(UINT8 Revision)
Definition: utmisc.c:181
UINT8 Revision
Definition: actbl.h:110
UINT32 ACPI_STATUS
Definition: actypes.h:460
void AcpiTbOverrideTable(ACPI_TABLE_DESC *OldTableDesc)
Definition: tbinstal.c:247
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
ACPI_STATUS AcpiTbGetNextTableDescriptor(UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc)
Definition: tbdata.c:727
void AcpiTbInitTableDescriptor(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
Definition: tbdata.c:130
Status
Definition: gdiplustypes.h:24
void AcpiTbPrintTableHeader(ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:141
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
UINT8 Flags
Definition: actbl.h:408

Referenced by AcpiTbInstallStandardTable().

◆ AcpiTbInvalidateTable()

void AcpiTbInvalidateTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 392 of file tbdata.c.

394 {
395 
396  ACPI_FUNCTION_TRACE (TbInvalidateTable);
397 
398 
399  /* Table must be validated */
400 
401  if (!TableDesc->Pointer)
402  {
403  return_VOID;
404  }
405 
406  AcpiTbReleaseTable (TableDesc->Pointer, TableDesc->Length,
407  TableDesc->Flags);
408  TableDesc->Pointer = NULL;
409 
410  return_VOID;
411 }
smooth NULL
Definition: ftsmooth.c:416
#define return_VOID
Definition: acoutput.h:495
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
UINT32 Length
Definition: actbl.h:405
void AcpiTbReleaseTable(ACPI_TABLE_HEADER *Table, UINT32 TableLength, UINT8 TableFlags)
Definition: tbdata.c:225
UINT8 Flags
Definition: actbl.h:408

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

◆ AcpiTbIsTableLoaded()

BOOLEAN AcpiTbIsTableLoaded ( UINT32  TableIndex)

Definition at line 991 of file tbdata.c.

993 {
994  BOOLEAN IsLoaded = FALSE;
995 
996 
998  if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
999  {
1000  IsLoaded = (BOOLEAN)
1001  (AcpiGbl_RootTableList.Tables[TableIndex].Flags &
1003  }
1004 
1006  return (IsLoaded);
1007 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned char BOOLEAN
#define ACPI_TABLE_IS_LOADED
Definition: actbl.h:434
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#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 
281 UnlockAndExit:
284 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
ASMGENDATA Table[]
Definition: genincdata.c:61
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_NO_ACPI_TABLES
Definition: acexcep.h:110
ACPI_STATUS AcpiNsLoadTable(UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node)
Definition: nsload.c:82
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_SIG_DSDT
Definition: actbl.h:67
#define ACPI_SIG_OSDT
Definition: actbl.h:70
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
#define ACPI_SIG_SSDT
Definition: actbl.h:75
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ACPI_INFO(plist)
Definition: acoutput.h:237
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_INIT
Definition: acoutput.h:151
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_TABLE_HEADER * AcpiTbCopyDsdt(UINT32 TableIndex)
Definition: tbutils.c:163
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
ACPI_STATUS AcpiTbValidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:353
#define ACPI_SIG_PSDT
Definition: actbl.h:71

Referenced by AcpiLoadTables().

◆ AcpiTbLoadTable()

ACPI_STATUS AcpiTbLoadTable ( UINT32  TableIndex,
ACPI_NAMESPACE_NODE ParentNode 
)

Definition at line 1062 of file tbdata.c.

1065 {
1069 
1070 
1071  ACPI_FUNCTION_TRACE (TbLoadTable);
1072 
1073 
1074  /*
1075  * Note: Now table is "INSTALLED", it must be validated before
1076  * using.
1077  */
1078  Status = AcpiGetTableByIndex (TableIndex, &Table);
1079  if (ACPI_FAILURE (Status))
1080  {
1082  }
1083 
1084  Status = AcpiNsLoadTable (TableIndex, ParentNode);
1085  if (ACPI_FAILURE (Status))
1086  {
1088  }
1089 
1090  /*
1091  * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
1092  * responsible for discovering any new wake GPEs by running _PRW methods
1093  * that may have been loaded by this table.
1094  */
1095  Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
1096  if (ACPI_SUCCESS (Status))
1097  {
1099  }
1100 
1101  /* Invoke table handler */
1102 
1105 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
ACPI_STATUS AcpiNsLoadTable(UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node)
Definition: nsload.c:82
UINT32 ACPI_STATUS
Definition: actypes.h:460
void AcpiEvUpdateGpes(ACPI_OWNER_ID TableOwnerId)
Definition: evgpeinit.c:233
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiGetTableByIndex(UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)
Definition: tbxface.c:491
void AcpiTbNotifyTable(UINT32 Event, void *Table)
Definition: tbdata.c:1220
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
ACPI_STATUS AcpiTbGetOwnerId(UINT32 TableIndex, ACPI_OWNER_ID *OwnerId)
Definition: tbdata.c:958
#define ACPI_TABLE_EVENT_LOAD
Definition: actypes.h:1182
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
_Must_inspect_result_ _In_opt_ PVOID OwnerId
Definition: fsrtlfuncs.h:907

Referenced by AcpiExLoadTableOp(), and AcpiTbInstallAndLoadTable().

◆ AcpiTbNotifyTable()

void AcpiTbNotifyTable ( UINT32  Event,
void Table 
)

Definition at line 1220 of file tbdata.c.

1223 {
1224  /* Invoke table handler if present */
1225 
1226  if (AcpiGbl_TableHandler)
1227  {
1228  (void) AcpiGbl_TableHandler (Event, Table,
1229  AcpiGbl_TableHandlerContext);
1230  }
1231 }
ASMGENDATA Table[]
Definition: genincdata.c:61
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49

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

◆ AcpiTbOverrideTable()

void AcpiTbOverrideTable ( ACPI_TABLE_DESC OldTableDesc)

Definition at line 247 of file tbinstal.c.

249 {
251  ACPI_TABLE_DESC NewTableDesc;
253  ACPI_PHYSICAL_ADDRESS Address;
254  UINT32 Length;
255  ACPI_ERROR_ONLY (char *OverrideType);
256 
257 
258  /* (1) Attempt logical override (returns a logical address) */
259 
260  Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table);
261  if (ACPI_SUCCESS (Status) && Table)
262  {
265  ACPI_ERROR_ONLY (OverrideType = "Logical");
266  goto FinishOverride;
267  }
268 
269  /* (2) Attempt physical override (returns a physical address) */
270 
271  Status = AcpiOsPhysicalTableOverride (OldTableDesc->Pointer,
272  &Address, &Length);
273  if (ACPI_SUCCESS (Status) && Address && Length)
274  {
275  AcpiTbAcquireTempTable (&NewTableDesc, Address,
277  ACPI_ERROR_ONLY (OverrideType = "Physical");
278  goto FinishOverride;
279  }
280 
281  return; /* There was no override */
282 
283 
284 FinishOverride:
285 
286  /*
287  * Validate and verify a table before overriding, no nested table
288  * duplication check as it's too complicated and unnecessary.
289  */
290  Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, NULL);
291  if (ACPI_FAILURE (Status))
292  {
293  return;
294  }
295 
296  ACPI_INFO (("%4.4s 0x%8.8X%8.8X"
297  " %s table override, new table: 0x%8.8X%8.8X",
298  OldTableDesc->Signature.Ascii,
299  ACPI_FORMAT_UINT64 (OldTableDesc->Address),
300  OverrideType, ACPI_FORMAT_UINT64 (NewTableDesc.Address)));
301 
302  /* We can now uninstall the original table */
303 
304  AcpiTbUninstallTable (OldTableDesc);
305 
306  /*
307  * Replace the original table descriptor and keep its state as
308  * "VALIDATED".
309  */
310  AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
311  NewTableDesc.Flags, NewTableDesc.Pointer);
312  AcpiTbValidateTempTable (OldTableDesc);
313 
314  /* Release the temporary table descriptor */
315 
316  AcpiTbReleaseTempTable (&NewTableDesc);
317 }
ASMGENDATA Table[]
Definition: genincdata.c:61
ACPI_STATUS AcpiTbAcquireTempTable(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags)
Definition: tbdata.c:265
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define ACPI_ERROR_ONLY(s)
Definition: acmacros.h:467
char Ascii[4]
Definition: actbl.h:394
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
void AcpiTbUninstallTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbinstal.c:333
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
unsigned int UINT32
ACPI_NAME_UNION Signature
Definition: actbl.h:406
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
void AcpiTbReleaseTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:326
ACPI_STATUS AcpiTbValidateTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:428
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
#define ACPI_PTR_TO_PHYSADDR(i)
Definition: actypes.h:556
ACPI_STATUS AcpiOsPhysicalTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_PHYSICAL_ADDRESS *NewAddress, UINT32 *NewTableLength)
Definition: osl.c:89
#define ACPI_INFO(plist)
Definition: acoutput.h:237
void AcpiTbInitTableDescriptor(ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
Definition: tbdata.c:130
Status
Definition: gdiplustypes.h:24
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
ACPI_STATUS AcpiTbVerifyTempTable(ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex)
Definition: tbdata.c:549
ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable)
Definition: osl.c:72
UINT8 Flags
Definition: actbl.h:408
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL
Definition: actbl.h:429

Referenced by AcpiTbInstallTableWithOverride().

◆ AcpiTbParseFadt()

void AcpiTbParseFadt ( void  )

Definition at line 339 of file tbfadt.c.

341 {
342  UINT32 Length;
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 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
void AcpiTbCreateLocalFadt(ACPI_TABLE_HEADER *Table, UINT32 Length)
Definition: tbfadt.c:423
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiTbInstallStandardTable(ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, BOOLEAN Reload, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbinstal.c:137
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
unsigned int UINT32
ACPI_STATUS AcpiTbGetTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable)
Definition: tbutils.c:433
void AcpiTbPutTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbutils.c:490
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiTbVerifyChecksum(ACPI_TABLE_HEADER *Table, UINT32 Length)
Definition: tbprint.c:203
UINT32 Length
Definition: actbl.h:405

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;
286  UINT32 Length;
287  UINT8 *TableEntry;
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 
397  if (ACPI_SUCCESS (Status) &&
399  &AcpiGbl_RootTableList.Tables[TableIndex].Signature,
400  ACPI_SIG_FADT))
401  {
402  AcpiGbl_FadtIndex = TableIndex;
403  AcpiTbParseFadt ();
404  }
405 
406 NextTable:
407 
408  TableEntry += TableEntrySize;
409  }
410 
413 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define TRUE
Definition: types.h:120
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define AE_NO_MEMORY
Definition: acexcep.h:112
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
void * AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length)
Definition: osl.c:108
#define ACPI_XSDT_ENTRY_SIZE
Definition: actbl.h:209
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiTbInstallStandardTable(ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, BOOLEAN Reload, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbinstal.c:137
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
#define ACPI_RSDT_ENTRY_SIZE
Definition: actbl.h:208
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
static WCHAR Address[46]
Definition: ping.c:68
#define ACPI_BIOS_ERROR(plist)
Definition: acoutput.h:243
UINT64 XsdtPhysicalAddress
Definition: actbl.h:157
UINT8 Revision
Definition: actbl.h:154
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
void AcpiTbParseFadt(void)
Definition: tbfadt.c:339
UINT32 RsdtPhysicalAddress
Definition: actbl.h:155
#define ACPI_SIG_FADT
Definition: actbl.h:68
Status
Definition: gdiplustypes.h:24
void AcpiTbPrintTableHeader(ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:141
ACPI_STATUS AcpiTbVerifyChecksum(ACPI_TABLE_HEADER *Table, UINT32 Length)
Definition: tbprint.c:203
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
_Must_inspect_result_ typedef _In_ ULONG TableEntry
Definition: iotypes.h:3947
static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry(UINT8 *TableEntry, UINT32 TableEntrySize)
Definition: tbutils.c:214
#define AE_INVALID_TABLE_LENGTH
Definition: acexcep.h:171
#define ACPI_ADD_PTR(t, a, b)
Definition: actypes.h:546
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128

Referenced by AcpiInitializeTables().

◆ AcpiTbPrintTableHeader()

void AcpiTbPrintTableHeader ( ACPI_PHYSICAL_ADDRESS  Address,
ACPI_TABLE_HEADER Header 
)

Definition at line 141 of file tbprint.c.

144 {
145  ACPI_TABLE_HEADER LocalHeader;
146 
147 
148  if (ACPI_COMPARE_NAMESEG (Header->Signature, ACPI_SIG_FACS))
149  {
150  /* FACS only has signature and length fields */
151 
152  ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
153  Header->Signature, ACPI_FORMAT_UINT64 (Address),
154  Header->Length));
155  }
156  else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
157  {
158  /* RSDP has no common fields */
159 
160  memcpy (LocalHeader.OemId, ACPI_CAST_PTR (ACPI_TABLE_RSDP,
161  Header)->OemId, ACPI_OEM_ID_SIZE);
162  AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
163 
164  ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
169  LocalHeader.OemId));
170  }
171  else
172  {
173  /* Standard ACPI table with full common header */
174 
175  AcpiTbCleanupTableHeader (&LocalHeader, Header);
176 
177  ACPI_INFO ((
178  "%-4.4s 0x%8.8X%8.8X"
179  " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
180  LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
181  LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
182  LocalHeader.OemTableId, LocalHeader.OemRevision,
183  LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
184  }
185 }
UINT32 OemRevision
Definition: actbl.h:114
UINT32 Length
Definition: actbl.h:109
UINT8 Revision
Definition: actbl.h:110
char Signature[ACPI_NAMESEG_SIZE]
Definition: actbl.h:108
_In_ ULONG Revision
Definition: rtlfuncs.h:1104
static void AcpiTbFixString(char *String, ACPI_SIZE Length)
Definition: tbprint.c:80
char AslCompilerId[ACPI_NAMESEG_SIZE]
Definition: actbl.h:115
Definition: Header.h:8
#define ACPI_SIG_FACS
Definition: actbl.h:69
static WCHAR Address[46]
Definition: ping.c:68
static void AcpiTbCleanupTableHeader(ACPI_TABLE_HEADER *OutHeader, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:113
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
#define ACPI_OEM_ID_SIZE
Definition: actypes.h:421
UINT32 AslCompilerRevision
Definition: actbl.h:116
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]
Definition: actbl.h:113
#define ACPI_INFO(plist)
Definition: acoutput.h:237
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
char OemId[ACPI_OEM_ID_SIZE]
Definition: actbl.h:112
#define ACPI_VALIDATE_RSDP_SIG(a)
Definition: actypes.h:570
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544

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

◆ AcpiTbPutTable()

void AcpiTbPutTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 490 of file tbutils.c.

492 {
493 
495 
496 
498  {
499  TableDesc->ValidationCount--;
500 
501  /*
502  * Detect ValidationCount underflows to ensure that the warning
503  * message will only be printed once.
504  */
506  {
508  "Table %p, Validation count underflows\n", TableDesc));
509  return_VOID;
510  }
511  }
512 
513  if (TableDesc->ValidationCount == 0)
514  {
515  /* Table need to be "INVALIDATED" */
516 
517  AcpiTbInvalidateTable (TableDesc);
518  }
519 
520  return_VOID;
521 }
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
UINT16 ValidationCount
Definition: actbl.h:409
#define AE_INFO
Definition: acoutput.h:230
void AcpiTbPutTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbutils.c:490
#define return_VOID
Definition: acoutput.h:495
void AcpiTbInvalidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:392
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_MAX_TABLE_VALIDATIONS
Definition: actbl.h:425

Referenced by AcpiPutTable(), and AcpiTbParseFadt().

◆ AcpiTbReleaseOwnerId()

ACPI_STATUS AcpiTbReleaseOwnerId ( UINT32  TableIndex)

Definition at line 922 of file tbdata.c.

924 {
926 
927 
928  ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
929 
930 
932  if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
933  {
935  &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
936  Status = AE_OK;
937  }
938 
941 }
void AcpiUtReleaseOwnerId(ACPI_OWNER_ID *OwnerId)
Definition: utownerid.c:190
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiNsLoadTable(), and AcpiTbUnloadTable().

◆ AcpiTbReleaseTable()

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

Definition at line 225 of file tbdata.c.

229 {
230 
231  switch (TableFlags & ACPI_TABLE_ORIGIN_MASK)
232  {
234 
235  AcpiOsUnmapMemory (Table, TableLength);
236  break;
237 
240  default:
241 
242  break;
243  }
244 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL
Definition: actbl.h:430
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL
Definition: actbl.h:431
#define ACPI_TABLE_ORIGIN_MASK
Definition: actbl.h:432
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL
Definition: actbl.h:429

Referenced by AcpiTbCompareTables(), and AcpiTbInvalidateTable().

◆ AcpiTbReleaseTempTable()

void AcpiTbReleaseTempTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 326 of file tbdata.c.

328 {
329 
330  /*
331  * Note that the .Address is maintained by the callers of
332  * AcpiTbAcquireTempTable(), thus do not invoke AcpiTbUninstallTable()
333  * where .Address will be freed.
334  */
335  AcpiTbInvalidateTable (TableDesc);
336 }
void AcpiTbInvalidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:392

Referenced by AcpiTbInstallStandardTable(), and AcpiTbOverrideTable().

◆ AcpiTbResizeRootTableList()

ACPI_STATUS AcpiTbResizeRootTableList ( void  )

Definition at line 642 of file tbdata.c.

644 {
645  ACPI_TABLE_DESC *Tables;
646  UINT32 TableCount;
647  UINT32 CurrentTableCount, MaxTableCount;
648  UINT32 i;
649 
650 
651  ACPI_FUNCTION_TRACE (TbResizeRootTableList);
652 
653 
654  /* AllowResize flag is a parameter to AcpiInitializeTables */
655 
656  if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
657  {
658  ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
660  }
661 
662  /* Increase the Table Array size */
663 
664  if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
665  {
666  TableCount = AcpiGbl_RootTableList.MaxTableCount;
667  }
668  else
669  {
670  TableCount = AcpiGbl_RootTableList.CurrentTableCount;
671  }
672 
673  MaxTableCount = TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
674  Tables = ACPI_ALLOCATE_ZEROED (
675  ((ACPI_SIZE) MaxTableCount) * sizeof (ACPI_TABLE_DESC));
676  if (!Tables)
677  {
678  ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
680  }
681 
682  /* Copy and free the previous table array */
683 
684  CurrentTableCount = 0;
685  if (AcpiGbl_RootTableList.Tables)
686  {
687  for (i = 0; i < TableCount; i++)
688  {
689  if (AcpiGbl_RootTableList.Tables[i].Address)
690  {
691  memcpy (Tables + CurrentTableCount,
692  AcpiGbl_RootTableList.Tables + i,
694  CurrentTableCount++;
695  }
696  }
697 
698  if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
699  {
700  ACPI_FREE (AcpiGbl_RootTableList.Tables);
701  }
702  }
703 
704  AcpiGbl_RootTableList.Tables = Tables;
705  AcpiGbl_RootTableList.MaxTableCount = MaxTableCount;
706  AcpiGbl_RootTableList.CurrentTableCount = CurrentTableCount;
707  AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
708 
710 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
#define AE_NO_MEMORY
Definition: acexcep.h:112
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
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
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
#define AE_SUPPORT
Definition: acexcep.h:123
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ACPI_ROOT_TABLE_SIZE_INCREMENT
Definition: acconfig.h:140
#define ACPI_ROOT_ORIGIN_ALLOCATED
Definition: aclocal.h:244
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
UINT8 Flags
Definition: actbl.h:408
#define AE_OK
Definition: acexcep.h:97
#define ACPI_ROOT_ALLOW_RESIZE
Definition: aclocal.h:245

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

◆ AcpiTbScanMemoryForRsdp()

UINT8* AcpiTbScanMemoryForRsdp ( UINT8 StartAddress,
UINT32  Length 
)

Definition at line 282 of file tbxfroot.c.

285 {
287  UINT8 *MemRover;
288  UINT8 *EndAddress;
289 
290 
291  ACPI_FUNCTION_TRACE (TbScanMemoryForRsdp);
292 
293 
294  EndAddress = StartAddress + Length;
295 
296  /* Search from given start address for the requested length */
297 
298  for (MemRover = StartAddress; MemRover < EndAddress;
299  MemRover += ACPI_RSDP_SCAN_STEP)
300  {
301  /* The RSDP signature and checksum must both be correct */
302 
304  ACPI_CAST_PTR (ACPI_TABLE_RSDP, MemRover));
305  if (ACPI_SUCCESS (Status))
306  {
307  /* Sig and checksum valid, we have found a real RSDP */
308 
310  "RSDP located at physical address %p\n", MemRover));
311  return_PTR (MemRover);
312  }
313 
314  /* No sig match or bad checksum, keep searching */
315  }
316 
317  /* Searched entire block, no RSDP was found */
318 
320  "Searched entire block from %p, valid RSDP was not found\n",
321  StartAddress));
322  return_PTR (NULL);
323 }
#define return_PTR(s)
Definition: acoutput.h:497
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_RSDP_SCAN_STEP
Definition: acconfig.h:193
smooth NULL
Definition: ftsmooth.c:416
ACPI_STATUS AcpiTbValidateRsdp(ACPI_TABLE_RSDP *Rsdp)
Definition: tbxfroot.c:103
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_INFO
Definition: acoutput.h:153
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
unsigned char UINT8

Referenced by AcpiFindRootPointer().

◆ AcpiTbSetTableLoadedFlag()

void AcpiTbSetTableLoadedFlag ( UINT32  TableIndex,
BOOLEAN  IsLoaded 
)

Definition at line 1024 of file tbdata.c.

1027 {
1028 
1030  if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
1031  {
1032  if (IsLoaded)
1033  {
1034  AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
1036  }
1037  else
1038  {
1039  AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
1041  }
1042  }
1043 
1045 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
#define ACPI_TABLE_IS_LOADED
Definition: actbl.h:434
#define ACPI_MTX_TABLES
Definition: aclocal.h:86

Referenced by AcpiNsLoadTable(), and AcpiTbUnloadTable().

◆ AcpiTbTerminate()

void AcpiTbTerminate ( void  )

Definition at line 776 of file tbdata.c.

778 {
779  UINT32 i;
780 
781 
782  ACPI_FUNCTION_TRACE (TbTerminate);
783 
784 
786 
787  /* Delete the individual tables */
788 
789  for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
790  {
791  AcpiTbUninstallTable (&AcpiGbl_RootTableList.Tables[i]);
792  }
793 
794  /*
795  * Delete the root table array if allocated locally. Array cannot be
796  * mapped, so we don't need to check for that flag.
797  */
798  if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
799  {
800  ACPI_FREE (AcpiGbl_RootTableList.Tables);
801  }
802 
803  AcpiGbl_RootTableList.Tables = NULL;
804  AcpiGbl_RootTableList.Flags = 0;
805  AcpiGbl_RootTableList.CurrentTableCount = 0;
806 
807  ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
808 
810  return_VOID;
811 }
#define ACPI_FREE(a)
Definition: actypes.h:386
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
void AcpiTbUninstallTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbinstal.c:333
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
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define return_VOID
Definition: acoutput.h:495
#define ACPI_DB_INFO
Definition: acoutput.h:153
#define ACPI_ROOT_ORIGIN_ALLOCATED
Definition: aclocal.h:244
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480

Referenced by AcpiUtSubsystemShutdown().

◆ AcpiTbUninstallTable()

void AcpiTbUninstallTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 333 of file tbinstal.c.

335 {
336 
337  ACPI_FUNCTION_TRACE (TbUninstallTable);
338 
339 
340  /* Table must be installed */
341 
342  if (!TableDesc->Address)
343  {
344  return_VOID;
345  }
346 
347  AcpiTbInvalidateTable (TableDesc);
348 
349  if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
351  {
352  ACPI_FREE (ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
353  }
354 
355  TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);
356  return_VOID;
357 }
#define ACPI_FREE(a)
Definition: actypes.h:386
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_PHYSADDR_TO_PTR(i)
Definition: actypes.h:555
#define return_VOID
Definition: acoutput.h:495
#define ACPI_PTR_TO_PHYSADDR(i)
Definition: actypes.h:556
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL
Definition: actbl.h:431
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
void AcpiTbInvalidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:392
#define ACPI_TABLE_ORIGIN_MASK
Definition: actbl.h:432
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
UINT8 Flags
Definition: actbl.h:408

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

◆ AcpiTbUnloadTable()

ACPI_STATUS AcpiTbUnloadTable ( UINT32  TableIndex)

Definition at line 1167 of file tbdata.c.

1169 {
1172 
1173 
1174  ACPI_FUNCTION_TRACE (TbUnloadTable);
1175 
1176 
1177  /* Ensure the table is still loaded */
1178 
1179  if (!AcpiTbIsTableLoaded (TableIndex))
1180  {
1182  }
1183 
1184  /* Invoke table handler */
1185 
1186  Status = AcpiGetTableByIndex (TableIndex, &Table);
1187  if (ACPI_SUCCESS (Status))
1188  {
1190  }
1191 
1192  /* Delete the portion of the namespace owned by this table */
1193 
1194  Status = AcpiTbDeleteNamespaceByOwner (TableIndex);
1195  if (ACPI_FAILURE (Status))
1196  {
1198  }
1199 
1200  (void) AcpiTbReleaseOwnerId (TableIndex);
1201  AcpiTbSetTableLoadedFlag (TableIndex, FALSE);
1203 }
void AcpiTbSetTableLoadedFlag(UINT32 TableIndex, BOOLEAN IsLoaded)
Definition: tbdata.c:1024
ASMGENDATA Table[]
Definition: genincdata.c:61
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiTbDeleteNamespaceByOwner(UINT32 TableIndex)
Definition: tbdata.c:827
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiGetTableByIndex(UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)
Definition: tbxface.c:491
void AcpiTbNotifyTable(UINT32 Event, void *Table)
Definition: tbdata.c:1220
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_STATUS AcpiTbReleaseOwnerId(UINT32 TableIndex)
Definition: tbdata.c:922
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_TABLE_EVENT_UNLOAD
Definition: actypes.h:1183
BOOLEAN AcpiTbIsTableLoaded(UINT32 TableIndex)
Definition: tbdata.c:991
#define AE_OK
Definition: acexcep.h:97

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  */
113  if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
114  {
115  /* Nope, BAD Signature */
116 
117  return (AE_BAD_SIGNATURE);
118  }
119 
120  /* Check the standard checksum */
121 
122  if (AcpiTbChecksum ((UINT8 *) Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0)
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 }
UINT8 AcpiTbChecksum(UINT8 *Buffer, UINT32 Length)
Definition: tbprint.c:258
char Signature[8]
Definition: actbl.h:151
#define AE_BAD_CHECKSUM
Definition: acexcep.h:169
#define AE_BAD_SIGNATURE
Definition: acexcep.h:167
#define ACPI_RSDP_XCHECKSUM_LENGTH
Definition: acconfig.h:211
#define ACPI_VALIDATE_RSDP_SIG(a)
Definition: actypes.h:570
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97
#define ACPI_RSDP_CHECKSUM_LENGTH
Definition: acconfig.h:210

Referenced by AcpiTbScanMemoryForRsdp().

◆ AcpiTbValidateTable()

ACPI_STATUS AcpiTbValidateTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 353 of file tbdata.c.

355 {
357 
358 
359  ACPI_FUNCTION_TRACE (TbValidateTable);
360 
361 
362  /* Validate the table if necessary */
363 
364  if (!TableDesc->Pointer)
365  {
366  Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer,
367  &TableDesc->Length, &TableDesc->Flags);
368  if (!TableDesc->Pointer)
369  {
371  }
372  }
373 
375 }
#define AE_NO_MEMORY
Definition: acexcep.h:112
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
UINT32 Length
Definition: actbl.h:405
ACPI_STATUS AcpiTbAcquireTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **TablePtr, UINT32 *TableLength, UINT8 *TableFlags)
Definition: tbdata.c:166
UINT8 Flags
Definition: actbl.h:408
#define AE_OK
Definition: acexcep.h:97

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

◆ AcpiTbValidateTempTable()

ACPI_STATUS AcpiTbValidateTempTable ( ACPI_TABLE_DESC TableDesc)

Definition at line 428 of file tbdata.c.

430 {
431 
432  if (!TableDesc->Pointer && !AcpiGbl_EnableTableValidation)
433  {
434  /*
435  * Only validates the header of the table.
436  * Note that Length contains the size of the mapping after invoking
437  * this work around, this value is required by
438  * AcpiTbReleaseTempTable().
439  * We can do this because in AcpiInitTableDescriptor(), the Length
440  * field of the installed descriptor is filled with the actual
441  * table length obtaining from the table header.
442  */
443  TableDesc->Length = sizeof (ACPI_TABLE_HEADER);
444  }
445 
446  return (AcpiTbValidateTable (TableDesc));
447 }
ACPI_STATUS AcpiTbValidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:353
struct acpi_table_header ACPI_TABLE_HEADER
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
UINT32 Length
Definition: actbl.h:405

Referenced by AcpiTbOverrideTable(), and AcpiTbVerifyTempTable().

◆ AcpiTbVerifyChecksum()

ACPI_STATUS AcpiTbVerifyChecksum ( ACPI_TABLE_HEADER Table,
UINT32  Length 
)

Definition at line 203 of file tbprint.c.

206 {
207  UINT8 Checksum;
208 
209 
210  /*
211  * FACS/S3PT:
212  * They are the odd tables, have no standard ACPI header and no checksum
213  */
214 
215  if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) ||
217  {
218  return (AE_OK);
219  }
220 
221  /* Compute the checksum on the table */
222 
223  Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length);
224 
225  /* Checksum ok? (should be zero) */
226 
227  if (Checksum)
228  {
230  "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
231  "should be 0x%2.2X",
232  Table->Signature, Table->Checksum,
233  (UINT8) (Table->Checksum - Checksum)));
234 
235 #if (ACPI_CHECKSUM_ABORT)
236  return (AE_BAD_CHECKSUM);
237 #endif
238  }
239 
240  return (AE_OK);
241 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define AE_BAD_CHECKSUM
Definition: acexcep.h:169
#define ACPI_SIG_FACS
Definition: actbl.h:69
#define AE_INFO
Definition: acoutput.h:230
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
#define ACPI_SIG_S3PT
Definition: actbl1.h:83
UINT8 AcpiTbChecksum(UINT8 *Buffer, UINT32 Length)
Definition: tbprint.c:258
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97
#define ACPI_BIOS_WARNING(plist)
Definition: acoutput.h:241

Referenced by AcpiTbParseFadt(), AcpiTbParseRootTable(), and AcpiTbVerifyTempTable().

◆ AcpiTbVerifyTempTable()

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

Definition at line 549 of file tbdata.c.

553 {
555 
556 
557  ACPI_FUNCTION_TRACE (TbVerifyTempTable);
558 
559 
560  /* Validate the table */
561 
562  Status = AcpiTbValidateTempTable (TableDesc);
563  if (ACPI_FAILURE (Status))
564  {
566  }
567 
568  /* If a particular signature is expected (DSDT/FACS), it must match */
569 
570  if (Signature &&
571  !ACPI_COMPARE_NAMESEG (&TableDesc->Signature, Signature))
572  {
574  "Invalid signature 0x%X for ACPI table, expected [%s]",
575  TableDesc->Signature.Integer, Signature));
577  goto InvalidateAndExit;
578  }
579 
580  if (AcpiGbl_EnableTableValidation)
581  {
582  /* Verify the checksum */
583 
584  Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
585  if (ACPI_FAILURE (Status))
586  {
588  "%4.4s 0x%8.8X%8.8X"
589  " Attempted table install failed",
590  AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
591  TableDesc->Signature.Ascii : "????",
592  ACPI_FORMAT_UINT64 (TableDesc->Address)));
593 
594  goto InvalidateAndExit;
595  }
596 
597  /* Avoid duplications */
598 
599  if (TableIndex)
600  {
601  Status = AcpiTbCheckDuplication (TableDesc, TableIndex);
602  if (ACPI_FAILURE (Status))
603  {
604  if (Status != AE_CTRL_TERMINATE)
605  {
607  "%4.4s 0x%8.8X%8.8X"
608  " Table is already loaded",
609  AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
610  TableDesc->Signature.Ascii : "????",
611  ACPI_FORMAT_UINT64 (TableDesc->Address)));
612  }
613 
614  goto InvalidateAndExit;
615  }
616  }
617 
618  TableDesc->Flags |= ACPI_TABLE_IS_VERIFIED;
619  }
620 
622 
623 InvalidateAndExit:
624  AcpiTbInvalidateTable (TableDesc);
626 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
UINT32 Integer
Definition: actbl.h:393
#define AE_NO_MEMORY
Definition: acexcep.h:112
BOOLEAN AcpiUtValidNameseg(char *Signature)
Definition: utascii.c:63
char Ascii[4]
Definition: actbl.h:394
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
ACPI_NAME_UNION Signature
Definition: actbl.h:406
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_BIOS_ERROR(plist)
Definition: acoutput.h:243
#define ACPI_TABLE_IS_VERIFIED
Definition: actbl.h:433
#define AE_BAD_SIGNATURE
Definition: acexcep.h:167
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
ACPI_STATUS AcpiTbValidateTempTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:428
static ACPI_STATUS AcpiTbCheckDuplication(ACPI_TABLE_DESC *TableDesc, UINT32 *TableIndex)
Definition: tbdata.c:467
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
Status
Definition: gdiplustypes.h:24
ACPI_PHYSICAL_ADDRESS Address
Definition: actbl.h:403
ACPI_STATUS AcpiTbVerifyChecksum(ACPI_TABLE_HEADER *Table, UINT32 Length)
Definition: tbprint.c:203
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
UINT32 Length
Definition: actbl.h:405
void AcpiTbInvalidateTable(ACPI_TABLE_DESC *TableDesc)
Definition: tbdata.c:392
UINT8 Flags
Definition: actbl.h:408
static const WCHAR Signature[]
Definition: parser.c:141
#define AE_OK
Definition: acexcep.h:97

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