ReactOS  0.4.14-dev-297-g23e575c
exconfig.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
#include "acnamesp.h"
#include "actables.h"
#include "acdispat.h"
#include "acevents.h"
#include "amlcode.h"
Include dependency graph for exconfig.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_EXECUTER
 

Functions

static ACPI_STATUS AcpiExAddTable (UINT32 TableIndex, ACPI_OPERAND_OBJECT **DdbHandle)
 
static ACPI_STATUS AcpiExRegionRead (ACPI_OPERAND_OBJECT *ObjDesc, UINT32 Length, UINT8 *Buffer)
 
ACPI_STATUS AcpiExLoadTableOp (ACPI_WALK_STATE *WalkState, ACPI_OPERAND_OBJECT **ReturnDesc)
 
ACPI_STATUS AcpiExLoadOp (ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *Target, ACPI_WALK_STATE *WalkState)
 
ACPI_STATUS AcpiExUnloadTable (ACPI_OPERAND_OBJECT *DdbHandle)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EXECUTER

Definition at line 54 of file exconfig.c.

Function Documentation

◆ AcpiExAddTable()

static ACPI_STATUS AcpiExAddTable ( UINT32  TableIndex,
ACPI_OPERAND_OBJECT **  DdbHandle 
)
static

Definition at line 87 of file exconfig.c.

90 {
91  ACPI_OPERAND_OBJECT *ObjDesc;
92 
93 
94  ACPI_FUNCTION_TRACE (ExAddTable);
95 
96 
97  /* Create an object to be the table handle */
98 
100  if (!ObjDesc)
101  {
103  }
104 
105  /* Init the table handle */
106 
107  ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;
109  ObjDesc->Reference.Value = TableIndex;
110  *DdbHandle = ObjDesc;
112 }
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define ACPI_TYPE_LOCAL_REFERENCE
Definition: actypes.h:710
ACPI_OBJECT_COMMON_HEADER UINT8 Class
Definition: acobject.h:440
ACPI_OBJECT_REFERENCE Reference
Definition: acobject.h:537
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_OBJECT_COMMON Common
Definition: acobject.h:516
#define AOPOBJ_DATA_VALID
Definition: acobject.h:96
#define AcpiUtCreateInternalObject(t)
Definition: acutils.h:654
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiExLoadOp(), and AcpiExLoadTableOp().

◆ AcpiExLoadOp()

ACPI_STATUS AcpiExLoadOp ( ACPI_OPERAND_OBJECT ObjDesc,
ACPI_OPERAND_OBJECT Target,
ACPI_WALK_STATE WalkState 
)

Definition at line 333 of file exconfig.c.

337 {
338  ACPI_OPERAND_OBJECT *DdbHandle;
339  ACPI_TABLE_HEADER *TableHeader;
341  UINT32 TableIndex;
343  UINT32 Length;
344 
345 
346  ACPI_FUNCTION_TRACE (ExLoadOp);
347 
348 
349  /* Source Object can be either an OpRegion or a Buffer/Field */
350 
351  switch (ObjDesc->Common.Type)
352  {
353  case ACPI_TYPE_REGION:
354 
356  "Load table from Region %p\n", ObjDesc));
357 
358  /* Region must be SystemMemory (from ACPI spec) */
359 
361  {
363  }
364 
365  /*
366  * If the Region Address and Length have not been previously
367  * evaluated, evaluate them now and save the results.
368  */
369  if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID))
370  {
371  Status = AcpiDsGetRegionArguments (ObjDesc);
372  if (ACPI_FAILURE (Status))
373  {
375  }
376  }
377 
378  /* Get the table header first so we can get the table length */
379 
380  TableHeader = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
381  if (!TableHeader)
382  {
384  }
385 
386  Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
387  ACPI_CAST_PTR (UINT8, TableHeader));
388  Length = TableHeader->Length;
389  ACPI_FREE (TableHeader);
390 
391  if (ACPI_FAILURE (Status))
392  {
394  }
395 
396  /* Must have at least an ACPI table header */
397 
398  if (Length < sizeof (ACPI_TABLE_HEADER))
399  {
401  }
402 
403  /*
404  * The original implementation simply mapped the table, with no copy.
405  * However, the memory region is not guaranteed to remain stable and
406  * we must copy the table to a local buffer. For example, the memory
407  * region is corrupted after suspend on some machines. Dynamically
408  * loaded tables are usually small, so this overhead is minimal.
409  *
410  * The latest implementation (5/2009) does not use a mapping at all.
411  * We use the low-level operation region interface to read the table
412  * instead of the obvious optimization of using a direct mapping.
413  * This maintains a consistent use of operation regions across the
414  * entire subsystem. This is important if additional processing must
415  * be performed in the (possibly user-installed) operation region
416  * handler. For example, AcpiExec and ASLTS depend on this.
417  */
418 
419  /* Allocate a buffer for the table */
420 
422  if (!Table)
423  {
425  }
426 
427  /* Read the entire table */
428 
429  Status = AcpiExRegionRead (ObjDesc, Length,
431  if (ACPI_FAILURE (Status))
432  {
433  ACPI_FREE (Table);
435  }
436  break;
437 
438  case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */
439 
441  "Load table from Buffer or Field %p\n", ObjDesc));
442 
443  /* Must have at least an ACPI table header */
444 
445  if (ObjDesc->Buffer.Length < sizeof (ACPI_TABLE_HEADER))
446  {
448  }
449 
450  /* Get the actual table length from the table header */
451 
452  TableHeader = ACPI_CAST_PTR (
453  ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
454  Length = TableHeader->Length;
455 
456  /* Table cannot extend beyond the buffer */
457 
458  if (Length > ObjDesc->Buffer.Length)
459  {
461  }
462  if (Length < sizeof (ACPI_TABLE_HEADER))
463  {
465  }
466 
467  /*
468  * Copy the table from the buffer because the buffer could be
469  * modified or even deleted in the future
470  */
472  if (!Table)
473  {
475  }
476 
477  memcpy (Table, TableHeader, Length);
478  break;
479 
480  default:
481 
483  }
484 
485  /* Install the new table into the local data structures */
486 
487  ACPI_INFO (("Dynamic OEM Table Load:"));
492  if (ACPI_FAILURE (Status))
493  {
494  /* Delete allocated table buffer */
495 
496  ACPI_FREE (Table);
498  }
499 
500  /*
501  * Add the table to the namespace.
502  *
503  * Note: Load the table objects relative to the root of the namespace.
504  * This appears to go against the ACPI specification, but we do it for
505  * compatibility with other ACPI implementations.
506  */
507  Status = AcpiExAddTable (TableIndex, &DdbHandle);
508  if (ACPI_FAILURE (Status))
509  {
510  /* On error, TablePtr was deallocated above */
511 
513  }
514 
515  /* Complete the initialization/resolution of new objects */
516 
520 
521  /* Store the DdbHandle into the Target operand */
522 
523  Status = AcpiExStore (DdbHandle, Target, WalkState);
524  if (ACPI_FAILURE (Status))
525  {
526  (void) AcpiExUnloadTable (DdbHandle);
527 
528  /* TablePtr was deallocated above */
529 
530  AcpiUtRemoveReference (DdbHandle);
532  }
533 
534  /* Remove the reference by added by AcpiExStore above */
535 
536  AcpiUtRemoveReference (DdbHandle);
538 }
#define AE_AML_BUFFER_LIMIT
Definition: acexcep.h:189
#define ACPI_FREE(a)
Definition: actypes.h:386
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
ACPI_STATUS AcpiNsInitializeObjects(void)
Definition: nsinit.c:92
ACPI_STATUS AcpiExStore(ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc, ACPI_WALK_STATE *WalkState)
Definition: exstore.c:91
#define AE_NO_MEMORY
Definition: acexcep.h:112
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define ACPI_TYPE_BUFFER
Definition: actypes.h:681
UINT32 Length
Definition: actbl.h:109
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
#define AE_AML_OPERAND_TYPE
Definition: acexcep.h:182
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define ACPI_ALLOCATE(a)
Definition: actypes.h:384
static ACPI_STATUS AcpiExRegionRead(ACPI_OPERAND_OBJECT *ObjDesc, UINT32 Length, UINT8 *Buffer)
Definition: exconfig.c:280
unsigned int UINT32
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
ACPI_OBJECT_BUFFER Buffer
Definition: acobject.h:519
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ typedef _In_ ULONG _In_ BOOLEAN Target
Definition: iotypes.h:1068
#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
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_EXEC
Definition: acoutput.h:165
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
ACPI_STATUS AcpiDsGetRegionArguments(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: dsargs.c:395
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiExUnloadTable(ACPI_OPERAND_OBJECT *DdbHandle)
Definition: exconfig.c:554
ACPI_OBJECT_COMMON Common
Definition: acobject.h:516
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:784
static ACPI_STATUS AcpiExAddTable(UINT32 TableIndex, ACPI_OPERAND_OBJECT **DdbHandle)
Definition: exconfig.c:87
#define AOPOBJ_DATA_VALID
Definition: acobject.h:96
#define ACPI_TYPE_REGION
Definition: actypes.h:688
#define AE_INVALID_TABLE_LENGTH
Definition: acexcep.h:171
#define ACPI_ADR_SPACE_SYSTEM_MEMORY
Definition: actypes.h:851
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
unsigned char UINT8
ACPI_STATUS AcpiTbInstallAndLoadTable(ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, BOOLEAN Override, UINT32 *TableIndex)
Definition: tbdata.c:1120

Referenced by AcpiExOpcode_1A_1T_0R().

◆ AcpiExLoadTableOp()

ACPI_STATUS AcpiExLoadTableOp ( ACPI_WALK_STATE WalkState,
ACPI_OPERAND_OBJECT **  ReturnDesc 
)

Definition at line 129 of file exconfig.c.

132 {
134  ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
135  ACPI_NAMESPACE_NODE *ParentNode;
136  ACPI_NAMESPACE_NODE *StartNode;
137  ACPI_NAMESPACE_NODE *ParameterNode = NULL;
138  ACPI_OPERAND_OBJECT *DdbHandle;
139  UINT32 TableIndex;
140 
141 
142  ACPI_FUNCTION_TRACE (ExLoadTableOp);
143 
144 
145  /* Find the ACPI table in the RSDT/XSDT */
146 
149  Operand[0]->String.Pointer,
150  Operand[1]->String.Pointer,
151  Operand[2]->String.Pointer, &TableIndex);
153  if (ACPI_FAILURE (Status))
154  {
155  if (Status != AE_NOT_FOUND)
156  {
158  }
159 
160  /* Table not found, return an Integer=0 and AE_OK */
161 
162  DdbHandle = AcpiUtCreateIntegerObject ((UINT64) 0);
163  if (!DdbHandle)
164  {
166  }
167 
168  *ReturnDesc = DdbHandle;
170  }
171 
172  /* Default nodes */
173 
174  StartNode = WalkState->ScopeInfo->Scope.Node;
175  ParentNode = AcpiGbl_RootNode;
176 
177  /* RootPath (optional parameter) */
178 
179  if (Operand[3]->String.Length > 0)
180  {
181  /*
182  * Find the node referenced by the RootPathString. This is the
183  * location within the namespace where the table will be loaded.
184  */
185  Status = AcpiNsGetNodeUnlocked (StartNode,
186  Operand[3]->String.Pointer, ACPI_NS_SEARCH_PARENT,
187  &ParentNode);
188  if (ACPI_FAILURE (Status))
189  {
191  }
192  }
193 
194  /* ParameterPath (optional parameter) */
195 
196  if (Operand[4]->String.Length > 0)
197  {
198  if ((Operand[4]->String.Pointer[0] != AML_ROOT_PREFIX) &&
199  (Operand[4]->String.Pointer[0] != AML_PARENT_PREFIX))
200  {
201  /*
202  * Path is not absolute, so it will be relative to the node
203  * referenced by the RootPathString (or the NS root if omitted)
204  */
205  StartNode = ParentNode;
206  }
207 
208  /* Find the node referenced by the ParameterPathString */
209 
210  Status = AcpiNsGetNodeUnlocked (StartNode,
211  Operand[4]->String.Pointer, ACPI_NS_SEARCH_PARENT,
212  &ParameterNode);
213  if (ACPI_FAILURE (Status))
214  {
216  }
217  }
218 
219  /* Load the table into the namespace */
220 
221  ACPI_INFO (("Dynamic OEM Table Load:"));
223  Status = AcpiTbLoadTable (TableIndex, ParentNode);
225  if (ACPI_FAILURE (Status))
226  {
228  }
229 
230  Status = AcpiExAddTable (TableIndex, &DdbHandle);
231  if (ACPI_FAILURE (Status))
232  {
234  }
235 
236  /* Complete the initialization/resolution of new objects */
237 
241 
242  /* Parameter Data (optional) */
243 
244  if (ParameterNode)
245  {
246  /* Store the parameter data into the optional parameter object */
247 
248  Status = AcpiExStore (Operand[5],
249  ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode), WalkState);
250  if (ACPI_FAILURE (Status))
251  {
252  (void) AcpiExUnloadTable (DdbHandle);
253 
254  AcpiUtRemoveReference (DdbHandle);
256  }
257  }
258 
259  *ReturnDesc = DdbHandle;
261 }
#define ACPI_NS_SEARCH_PARENT
Definition: acnamesp.h:63
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiNsInitializeObjects(void)
Definition: nsinit.c:92
ACPI_STATUS AcpiExStore(ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc, ACPI_WALK_STATE *WalkState)
Definition: exstore.c:91
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_STATUS AcpiNsGetNodeUnlocked(ACPI_NAMESPACE_NODE *PrefixNode, const char *ExternalPathname, UINT32 Flags, ACPI_NAMESPACE_NODE **OutNode)
Definition: nsutils.c:777
static WCHAR String[]
Definition: stringtable.c:55
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
#define AML_PARENT_PREFIX
Definition: amlcode.h:70
ACPI_OPERAND_OBJECT * AcpiUtCreateIntegerObject(UINT64 Value)
Definition: utobject.c:223
#define AE_NOT_FOUND
Definition: acexcep.h:113
#define AML_ROOT_PREFIX
Definition: amlcode.h:69
ACPI_GENERIC_STATE * ScopeInfo
Definition: acstruct.h:124
#define ACPI_INFO(plist)
Definition: acoutput.h:237
Status
Definition: gdiplustypes.h:24
union acpi_operand_object * Operands[ACPI_OBJ_NUM_OPERANDS+1]
Definition: acstruct.h:105
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiExUnloadTable(ACPI_OPERAND_OBJECT *DdbHandle)
Definition: exconfig.c:554
ACPI_STATUS AcpiTbLoadTable(UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode)
Definition: tbdata.c:1062
ACPI_STATE_COMMON ACPI_NAMESPACE_NODE * Node
Definition: aclocal.h:740
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:784
static ACPI_STATUS AcpiExAddTable(UINT32 TableIndex, ACPI_OPERAND_OBJECT **DdbHandle)
Definition: exconfig.c:87
unsigned long long UINT64
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97
ACPI_SCOPE_STATE Scope
Definition: aclocal.h:825
ACPI_STATUS AcpiTbFindTable(char *Signature, char *OemId, char *OemTableId, UINT32 *TableIndex)
Definition: tbfind.c:70

Referenced by AcpiExOpcode_6A_0T_1R().

◆ AcpiExRegionRead()

static ACPI_STATUS AcpiExRegionRead ( ACPI_OPERAND_OBJECT ObjDesc,
UINT32  Length,
UINT8 Buffer 
)
static

Definition at line 280 of file exconfig.c.

284 {
286  UINT64 Value;
287  UINT32 RegionOffset = 0;
288  UINT32 i;
289 
290 
291  /* Bytewise reads */
292 
293  for (i = 0; i < Length; i++)
294  {
296  RegionOffset, 8, &Value);
297  if (ACPI_FAILURE (Status))
298  {
299  return (Status);
300  }
301 
302  *Buffer = (UINT8) Value;
303  Buffer++;
304  RegionOffset++;
305  }
306 
307  return (AE_OK);
308 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define ACPI_READ
Definition: actypes.h:742
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 AcpiEvAddressSpaceDispatch(ACPI_OPERAND_OBJECT *RegionObj, ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, UINT64 *Value)
Definition: evregion.c:148
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
unsigned long long UINT64
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiExLoadOp().

◆ AcpiExUnloadTable()

ACPI_STATUS AcpiExUnloadTable ( ACPI_OPERAND_OBJECT DdbHandle)

Definition at line 554 of file exconfig.c.

556 {
558  ACPI_OPERAND_OBJECT *TableDesc = DdbHandle;
559  UINT32 TableIndex;
560 
561 
562  ACPI_FUNCTION_TRACE (ExUnloadTable);
563 
564 
565  /*
566  * Temporarily emit a warning so that the ASL for the machine can be
567  * hopefully obtained. This is to say that the Unload() operator is
568  * extremely rare if not completely unused.
569  */
571  "Received request to unload an ACPI table"));
572 
573  /*
574  * May 2018: Unload is no longer supported for the following reasons:
575  * 1) A correct implementation on some hosts may not be possible.
576  * 2) Other ACPI implementations do not correctly/fully support it.
577  * 3) It requires host device driver support which does not exist.
578  * (To properly support namespace unload out from underneath.)
579  * 4) This AML operator has never been seen in the field.
580  */
582  "AML Unload operator is not supported"));
583 
584  /*
585  * Validate the handle
586  * Although the handle is partially validated in AcpiExReconfiguration()
587  * when it calls AcpiExResolveOperands(), the handle is more completely
588  * validated here.
589  *
590  * Handle must be a valid operand object of type reference. Also, the
591  * DdbHandle must still be marked valid (table has not been previously
592  * unloaded)
593  */
594  if ((!DdbHandle) ||
596  (DdbHandle->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) ||
597  (!(DdbHandle->Common.Flags & AOPOBJ_DATA_VALID)))
598  {
600  }
601 
602  /* Get the table index from the DdbHandle */
603 
604  TableIndex = TableDesc->Reference.Value;
605 
606  /*
607  * Release the interpreter lock so that the table lock won't have
608  * strict order requirement against it.
609  */
611  Status = AcpiTbUnloadTable (TableIndex);
613 
614  /*
615  * Invalidate the handle. We do this because the handle may be stored
616  * in a named object and may not be actually deleted until much later.
617  */
618  if (ACPI_SUCCESS (Status))
619  {
620  DdbHandle->Common.Flags &= ~AOPOBJ_DATA_VALID;
621  }
623 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
#define ACPI_TYPE_LOCAL_REFERENCE
Definition: actypes.h:710
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_AML_OPERAND_TYPE
Definition: acexcep.h:182
#define AE_NOT_IMPLEMENTED
Definition: acexcep.h:122
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
ACPI_OBJECT_REFERENCE Reference
Definition: acobject.h:537
#define ACPI_DESC_TYPE_OPERAND
Definition: acobject.h:573
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiTbUnloadTable(UINT32 TableIndex)
Definition: tbdata.c:1163
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_OBJECT_COMMON Common
Definition: acobject.h:516
#define AOPOBJ_DATA_VALID
Definition: acobject.h:96
#define AE_OK
Definition: acexcep.h:97
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414

Referenced by AcpiExLoadOp(), AcpiExLoadTableOp(), and AcpiExOpcode_1A_0T_0R().