ReactOS  0.4.15-dev-3303-g1ade494
tbdata.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "actables.h"
#include "acevents.h"
Include dependency graph for tbdata.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_TABLES
 

Functions

static ACPI_STATUS AcpiTbCheckDuplication (ACPI_TABLE_DESC *TableDesc, UINT32 *TableIndex)
 
static BOOLEAN AcpiTbCompareTables (ACPI_TABLE_DESC *TableDesc, UINT32 TableIndex)
 
void AcpiTbInitTableDescriptor (ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table)
 
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 AcpiTbAcquireTempTable (ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags)
 
void AcpiTbReleaseTempTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbValidateTable (ACPI_TABLE_DESC *TableDesc)
 
void AcpiTbInvalidateTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbValidateTempTable (ACPI_TABLE_DESC *TableDesc)
 
ACPI_STATUS AcpiTbVerifyTempTable (ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex)
 
ACPI_STATUS AcpiTbResizeRootTableList (void)
 
ACPI_STATUS AcpiTbGetNextTableDescriptor (UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc)
 
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)
 
BOOLEAN AcpiTbIsTableLoaded (UINT32 TableIndex)
 
void AcpiTbSetTableLoadedFlag (UINT32 TableIndex, BOOLEAN IsLoaded)
 
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)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_TABLES

Definition at line 50 of file tbdata.c.

Function Documentation

◆ 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
#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
#define NULL
Definition: types.h:112
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
static WCHAR Address[46]
Definition: ping.c:68
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
Status
Definition: gdiplustypes.h:24
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
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().

◆ AcpiTbCheckDuplication()

static ACPI_STATUS AcpiTbCheckDuplication ( ACPI_TABLE_DESC TableDesc,
UINT32 TableIndex 
)
static

Definition at line 467 of file tbdata.c.

470 {
471  UINT32 i;
472 
473 
474  ACPI_FUNCTION_TRACE (TbCheckDuplication);
475 
476 
477  /* Check if table is already registered */
478 
479  for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
480  {
481  /* Do not compare with unverified tables */
482 
483  if (!(AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_VERIFIED))
484  {
485  continue;
486  }
487 
488  /*
489  * Check for a table match on the entire table length,
490  * not just the header.
491  */
492  if (!AcpiTbCompareTables (TableDesc, i))
493  {
494  continue;
495  }
496 
497  /*
498  * Note: the current mechanism does not unregister a table if it is
499  * dynamically unloaded. The related namespace entries are deleted,
500  * but the table remains in the root table list.
501  *
502  * The assumption here is that the number of different tables that
503  * will be loaded is actually small, and there is minimal overhead
504  * in just keeping the table in case it is needed again.
505  *
506  * If this assumption changes in the future (perhaps on large
507  * machines with many table load/unload operations), tables will
508  * need to be unregistered when they are unloaded, and slots in the
509  * root table list should be reused when empty.
510  */
511  if (AcpiGbl_RootTableList.Tables[i].Flags &
513  {
514  /* Table is still loaded, this is an error */
515 
517  }
518  else
519  {
520  *TableIndex = i;
522  }
523  }
524 
525  /* Indicate no duplication to the caller */
526 
528 }
static BOOLEAN AcpiTbCompareTables(ACPI_TABLE_DESC *TableDesc, UINT32 TableIndex)
Definition: tbdata.c:81
#define AE_CTRL_TERMINATE
Definition: acexcep.h:226
unsigned int UINT32
#define ACPI_TABLE_IS_VERIFIED
Definition: actbl.h:433
#define ACPI_TABLE_IS_LOADED
Definition: actbl.h:434
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
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
#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 AcpiTbVerifyTempTable().

◆ AcpiTbCompareTables()

static BOOLEAN AcpiTbCompareTables ( ACPI_TABLE_DESC TableDesc,
UINT32  TableIndex 
)
static

Definition at line 81 of file tbdata.c.

84 {
86  BOOLEAN IsIdentical;
88  UINT32 TableLength;
89  UINT8 TableFlags;
90 
91 
92  Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
93  &Table, &TableLength, &TableFlags);
94  if (ACPI_FAILURE (Status))
95  {
96  return (FALSE);
97  }
98 
99  /*
100  * Check for a table match on the entire table length,
101  * not just the header.
102  */
103  IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
104  memcmp (TableDesc->Pointer, Table, TableLength)) ?
105  FALSE : TRUE);
106 
107  /* Release the acquired table */
108 
109  AcpiTbReleaseTable (Table, TableLength, TableFlags);
110  return (IsIdentical);
111 }
ASMGENDATA Table[]
Definition: genincdata.c:61
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TRUE
Definition: types.h:120
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define FALSE
Definition: types.h:117
unsigned int UINT32
unsigned char BOOLEAN
Status
Definition: gdiplustypes.h:24
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
UINT32 Length
Definition: actbl.h:405
#define BOOLEAN
Definition: pedump.c:73
void AcpiTbReleaseTable(ACPI_TABLE_HEADER *Table, UINT32 TableLength, UINT8 TableFlags)
Definition: tbdata.c:225
ACPI_STATUS AcpiTbAcquireTable(ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **TablePtr, UINT32 *TableLength, UINT8 *TableFlags)
Definition: tbdata.c:166
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiTbCheckDuplication().

◆ 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
Status
Definition: gdiplustypes.h:24
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define AE_NOT_EXIST
Definition: acexcep.h:114
#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().

◆ 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
unsigned int UINT32
Status
Definition: gdiplustypes.h:24
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
#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
Status
Definition: gdiplustypes.h:24
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
_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().

◆ 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
ACPI_NAME_UNION Signature
Definition: actbl.h:406
static WCHAR Address[46]
Definition: ping.c:68
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#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
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
unsigned int UINT32
static WCHAR Address[46]
Definition: ping.c:68
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
static void Exit(void)
Definition: sock.c:1331
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
#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().

◆ 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 }
#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
#define NULL
Definition: types.h:112
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
#define FALSE
Definition: types.h:117
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().

◆ 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
Status
Definition: gdiplustypes.h:24
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:1184
#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().

◆ 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
Status
Definition: gdiplustypes.h:24
#define ACPI_MTX_TABLES
Definition: aclocal.h:86
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#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
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
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
#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().

◆ 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
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
#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
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
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define NULL
Definition: types.h:112

Referenced by AcpiUtSubsystemShutdown().

◆ 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
#define FALSE
Definition: types.h:117
void AcpiTbNotifyTable(UINT32 Event, void *Table)
Definition: tbdata.c:1220
Status
Definition: gdiplustypes.h:24
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_STATUS AcpiTbReleaseOwnerId(UINT32 TableIndex)
Definition: tbdata.c:922
#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:1185
BOOLEAN AcpiTbIsTableLoaded(UINT32 TableIndex)
Definition: tbdata.c:991
#define AE_OK
Definition: acexcep.h:97

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

◆ 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
Status
Definition: gdiplustypes.h:24
ACPI_TABLE_HEADER * Pointer
Definition: actbl.h:404
#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().

◆ 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
Status
Definition: gdiplustypes.h:24
#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
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().