ReactOS  0.4.15-dev-1150-g593bcce
evrgnini.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
#include "acinterp.h"
Include dependency graph for evrgnini.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_EVENTS
 

Functions

ACPI_STATUS AcpiEvSystemMemoryRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvIoSpaceRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvPciConfigRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
BOOLEAN AcpiEvIsPciRootBridge (ACPI_NAMESPACE_NODE *Node)
 
ACPI_STATUS AcpiEvPciBarRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvCmosRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvDefaultRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvInitializeRegion (ACPI_OPERAND_OBJECT *RegionObj)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EVENTS

Definition at line 50 of file evrgnini.c.

Function Documentation

◆ AcpiEvCmosRegionSetup()

ACPI_STATUS AcpiEvCmosRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 481 of file evrgnini.c.

486 {
487  ACPI_FUNCTION_TRACE (EvCmosRegionSetup);
488 
489 
491 }
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvDefaultRegionSetup()

ACPI_STATUS AcpiEvDefaultRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 510 of file evrgnini.c.

515 {
516  ACPI_FUNCTION_TRACE (EvDefaultRegionSetup);
517 
518 
520  {
521  *RegionContext = NULL;
522  }
523  else
524  {
525  *RegionContext = HandlerContext;
526  }
527 
529 }
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1154
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1223
smooth NULL
Definition: ftsmooth.c:416
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvInitializeRegion()

ACPI_STATUS AcpiEvInitializeRegion ( ACPI_OPERAND_OBJECT RegionObj)

Definition at line 571 of file evrgnini.c.

573 {
574  ACPI_OPERAND_OBJECT *HandlerObj;
575  ACPI_OPERAND_OBJECT *ObjDesc;
578 
579 
580  ACPI_FUNCTION_TRACE (EvInitializeRegion);
581 
582 
583  if (!RegionObj)
584  {
586  }
587 
588  if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED)
589  {
591  }
592 
593  RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
594 
595  Node = RegionObj->Region.Node->Parent;
596  SpaceId = RegionObj->Region.SpaceId;
597 
598  /*
599  * The following loop depends upon the root Node having no parent
600  * ie: AcpiGbl_RootNode->Parent being set to NULL
601  */
602  while (Node)
603  {
604  /* Check to see if a handler exists */
605 
606  HandlerObj = NULL;
607  ObjDesc = AcpiNsGetAttachedObject (Node);
608  if (ObjDesc)
609  {
610  /* Can only be a handler if the object exists */
611 
612  switch (Node->Type)
613  {
614  case ACPI_TYPE_DEVICE:
615  case ACPI_TYPE_PROCESSOR:
616  case ACPI_TYPE_THERMAL:
617 
618  HandlerObj = ObjDesc->CommonNotify.Handler;
619  break;
620 
621  default:
622 
623  /* Ignore other objects */
624 
625  break;
626  }
627 
628  HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj);
629  if (HandlerObj)
630  {
631  /* Found correct handler */
632 
634  "Found handler %p for region %p in obj %p\n",
635  HandlerObj, RegionObj, ObjDesc));
636 
637  (void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE);
638 
639  /*
640  * Tell all users that this region is usable by
641  * running the _REG method
642  */
647  }
648  }
649 
650  /* This node does not have the handler we need; Pop up one level */
651 
652  Node = Node->Parent;
653  }
654 
655  /*
656  * If we get here, there is no handler for this region. This is not
657  * fatal because many regions get created before a handler is installed
658  * for said region.
659  */
661  "No handler for RegionType %s(%X) (RegionObj %p)\n",
662  AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));
663 
665 }
UINT8 ACPI_ADR_SPACE_TYPE
Definition: actypes.h:850
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ACPI_TYPE_THERMAL
Definition: actypes.h:692
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
#define ACPI_REG_CONNECT
Definition: actypes.h:881
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
struct acpi_namespace_node * Parent
Definition: aclocal.h:192
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:828
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:125
#define FALSE
Definition: types.h:117
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_OBJECT_REGION Region
Definition: acobject.h:525
#define AOPOBJ_OBJECT_INITIALIZED
Definition: acobject.h:97
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_STATUS AcpiEvAttachRegion(ACPI_OPERAND_OBJECT *HandlerObj, ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked)
Definition: evregion.c:530
#define ACPI_TYPE_DEVICE
Definition: actypes.h:685
ACPI_STATUS AcpiEvExecuteRegMethod(ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function)
Definition: evregion.c:577
#define ACPI_TYPE_PROCESSOR
Definition: actypes.h:691
ACPI_OPERAND_OBJECT * AcpiEvFindRegionHandler(ACPI_ADR_SPACE_TYPE SpaceId, ACPI_OPERAND_OBJECT *HandlerObj)
Definition: evhandler.c:346
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:517
ACPI_OBJECT_NOTIFY_COMMON CommonNotify
Definition: acobject.h:526
#define AE_OK
Definition: acexcep.h:97
Definition: dlist.c:348

Referenced by AcpiDsInitializeRegion(), and AcpiDsLoad2EndOp().

◆ AcpiEvIoSpaceRegionSetup()

ACPI_STATUS AcpiEvIoSpaceRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 139 of file evrgnini.c.

144 {
145  ACPI_FUNCTION_TRACE (EvIoSpaceRegionSetup);
146 
147 
149  {
150  *RegionContext = NULL;
151  }
152  else
153  {
154  *RegionContext = HandlerContext;
155  }
156 
158 }
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1154
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1223
smooth NULL
Definition: ftsmooth.c:416
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvIsPciRootBridge()

BOOLEAN AcpiEvIsPciRootBridge ( ACPI_NAMESPACE_NODE Node)

Definition at line 382 of file evrgnini.c.

384 {
386  ACPI_PNP_DEVICE_ID *Hid;
388  UINT32 i;
389  BOOLEAN Match;
390 
391 
392  /* Get the _HID and check for a PCI Root Bridge */
393 
394  Status = AcpiUtExecute_HID (Node, &Hid);
395  if (ACPI_FAILURE (Status))
396  {
397  return (FALSE);
398  }
399 
400  Match = AcpiUtIsPciRootBridge (Hid->String);
401  ACPI_FREE (Hid);
402 
403  if (Match)
404  {
405  return (TRUE);
406  }
407 
408  /* The _HID did not match. Get the _CID and check for a PCI Root Bridge */
409 
410  Status = AcpiUtExecute_CID (Node, &Cid);
411  if (ACPI_FAILURE (Status))
412  {
413  return (FALSE);
414  }
415 
416  /* Check all _CIDs in the returned list */
417 
418  for (i = 0; i < Cid->Count; i++)
419  {
420  if (AcpiUtIsPciRootBridge (Cid->Ids[i].String))
421  {
422  ACPI_FREE (Cid);
423  return (TRUE);
424  }
425  }
426 
427  ACPI_FREE (Cid);
428  return (FALSE);
429 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define TRUE
Definition: types.h:120
BOOLEAN AcpiUtIsPciRootBridge(char *Id)
Definition: utmisc.c:66
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_PNP_DEVICE_ID Ids[]
Definition: actypes.h:1274
#define FALSE
Definition: types.h:117
unsigned int UINT32
unsigned char BOOLEAN
ACPI_STATUS AcpiUtExecute_HID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
Definition: utids.c:72
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiUtExecute_CID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID_LIST **ReturnCidList)
Definition: utids.c:253
Definition: dlist.c:348

Referenced by AcpiEvPciConfigRegionSetup().

◆ AcpiEvPciBarRegionSetup()

ACPI_STATUS AcpiEvPciBarRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 450 of file evrgnini.c.

455 {
456  ACPI_FUNCTION_TRACE (EvPciBarRegionSetup);
457 
458 
460 }
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvPciConfigRegionSetup()

ACPI_STATUS AcpiEvPciConfigRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 179 of file evrgnini.c.

184 {
186  UINT64 PciValue;
187  ACPI_PCI_ID *PciId = *RegionContext;
188  ACPI_OPERAND_OBJECT *HandlerObj;
189  ACPI_NAMESPACE_NODE *ParentNode;
190  ACPI_NAMESPACE_NODE *PciRootNode;
191  ACPI_NAMESPACE_NODE *PciDeviceNode;
193 
194 
195  ACPI_FUNCTION_TRACE (EvPciConfigRegionSetup);
196 
197 
198  HandlerObj = RegionObj->Region.Handler;
199  if (!HandlerObj)
200  {
201  /*
202  * No installed handler. This shouldn't happen because the dispatch
203  * routine checks before we get here, but we check again just in case.
204  */
206  "Attempting to init a region %p, with no handler\n", RegionObj));
208  }
209 
210  *RegionContext = NULL;
212  {
213  if (PciId)
214  {
215  ACPI_FREE (PciId);
216  }
218  }
219 
220  ParentNode = RegionObj->Region.Node->Parent;
221 
222  /*
223  * Get the _SEG and _BBN values from the device upon which the handler
224  * is installed.
225  *
226  * We need to get the _SEG and _BBN objects relative to the PCI BUS device.
227  * This is the device the handler has been registered to handle.
228  */
229 
230  /*
231  * If the AddressSpace.Node is still pointing to the root, we need
232  * to scan upward for a PCI Root bridge and re-associate the OpRegion
233  * handlers with that device.
234  */
235  if (HandlerObj->AddressSpace.Node == AcpiGbl_RootNode)
236  {
237  /* Start search from the parent object */
238 
239  PciRootNode = ParentNode;
240  while (PciRootNode != AcpiGbl_RootNode)
241  {
242  /* Get the _HID/_CID in order to detect a RootBridge */
243 
244  if (AcpiEvIsPciRootBridge (PciRootNode))
245  {
246  /* Install a handler for this PCI root bridge */
247 
249  (ACPI_HANDLE) PciRootNode,
252  if (ACPI_FAILURE (Status))
253  {
254  if (Status == AE_SAME_HANDLER)
255  {
256  /*
257  * It is OK if the handler is already installed on the
258  * root bridge. Still need to return a context object
259  * for the new PCI_Config operation region, however.
260  */
261  }
262  else
263  {
265  "Could not install PciConfig handler "
266  "for Root Bridge %4.4s",
267  AcpiUtGetNodeName (PciRootNode)));
268  }
269  }
270  break;
271  }
272 
273  PciRootNode = PciRootNode->Parent;
274  }
275 
276  /* PCI root bridge not found, use namespace root node */
277  }
278  else
279  {
280  PciRootNode = HandlerObj->AddressSpace.Node;
281  }
282 
283  /*
284  * If this region is now initialized, we are done.
285  * (InstallAddressSpaceHandler could have initialized it)
286  */
287  if (RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)
288  {
290  }
291 
292  /* Region is still not initialized. Create a new context */
293 
294  PciId = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PCI_ID));
295  if (!PciId)
296  {
298  }
299 
300  /*
301  * For PCI_Config space access, we need the segment, bus, device and
302  * function numbers. Acquire them here.
303  *
304  * Find the parent device object. (This allows the operation region to be
305  * within a subscope under the device, such as a control method.)
306  */
307  PciDeviceNode = RegionObj->Region.Node;
308  while (PciDeviceNode && (PciDeviceNode->Type != ACPI_TYPE_DEVICE))
309  {
310  PciDeviceNode = PciDeviceNode->Parent;
311  }
312 
313  if (!PciDeviceNode)
314  {
315  ACPI_FREE (PciId);
317  }
318 
319  /*
320  * Get the PCI device and function numbers from the _ADR object
321  * contained in the parent's scope.
322  */
324  PciDeviceNode, &PciValue);
325 
326  /*
327  * The default is zero, and since the allocation above zeroed the data,
328  * just do nothing on failure.
329  */
330  if (ACPI_SUCCESS (Status))
331  {
332  PciId->Device = ACPI_HIWORD (ACPI_LODWORD (PciValue));
333  PciId->Function = ACPI_LOWORD (ACPI_LODWORD (PciValue));
334  }
335 
336  /* The PCI segment number comes from the _SEG method */
337 
339  PciRootNode, &PciValue);
340  if (ACPI_SUCCESS (Status))
341  {
342  PciId->Segment = ACPI_LOWORD (PciValue);
343  }
344 
345  /* The PCI bus number comes from the _BBN method */
346 
348  PciRootNode, &PciValue);
349  if (ACPI_SUCCESS (Status))
350  {
351  PciId->Bus = ACPI_LOWORD (PciValue);
352  }
353 
354  /* Complete/update the PCI ID for this device */
355 
356  Status = AcpiHwDerivePciId (PciId, PciRootNode, RegionObj->Region.Node);
357  if (ACPI_FAILURE (Status))
358  {
359  ACPI_FREE (PciId);
361  }
362 
363  *RegionContext = PciId;
365 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_LODWORD(Integer64)
Definition: actypes.h:530
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:414
#define METHOD_NAME__SEG
Definition: acnames.h:71
union acpi_operand_object * Handler
Definition: acobject.h:204
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1154
#define METHOD_NAME__ADR
Definition: acnames.h:49
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
#define AE_SAME_HANDLER
Definition: acexcep.h:133
UINT16 Bus
Definition: actypes.h:1329
#define ACPI_LOWORD(Integer)
Definition: actypes.h:528
ACPI_STATUS AcpiUtEvaluateNumericObject(const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value)
Definition: uteval.c:221
BOOLEAN AcpiEvIsPciRootBridge(ACPI_NAMESPACE_NODE *Node)
Definition: evrgnini.c:382
UINT16 Device
Definition: actypes.h:1330
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1223
UINT32 ACPI_STATUS
Definition: actypes.h:460
struct acpi_namespace_node * Parent
Definition: aclocal.h:192
#define AE_AML_OPERAND_TYPE
Definition: acexcep.h:182
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define METHOD_NAME__BBN
Definition: acnames.h:51
#define AOPOBJ_SETUP_COMPLETE
Definition: acobject.h:99
#define AE_INFO
Definition: acoutput.h:230
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_OBJECT_REGION Region
Definition: acobject.h:525
ACPI_STATUS AcpiInstallAddressSpaceHandler(ACPI_HANDLE Device, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler, ACPI_ADR_SPACE_SETUP Setup, void *Context)
Definition: evxfregn.c:79
_In_ HANDLE Handle
Definition: extypes.h:390
UINT16 Segment
Definition: actypes.h:1328
#define ACPI_DEFAULT_HANDLER
Definition: actypes.h:1202
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
Status
Definition: gdiplustypes.h:24
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:537
ACPI_STATUS AcpiHwDerivePciId(ACPI_PCI_ID *PciId, ACPI_HANDLE RootPciDevice, ACPI_HANDLE PciRegion)
Definition: hwpci.c:137
#define ACPI_HIWORD(Integer)
Definition: actypes.h:529
#define ACPI_TYPE_DEVICE
Definition: actypes.h:685
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_ADR_SPACE_PCI_CONFIG
Definition: actypes.h:854
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:306
UINT16 Function
Definition: actypes.h:1331
unsigned long long UINT64
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInstallSpaceHandler().

◆ AcpiEvSystemMemoryRegionSetup()

ACPI_STATUS AcpiEvSystemMemoryRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 70 of file evrgnini.c.

75 {
77  ACPI_MEM_SPACE_CONTEXT *LocalRegionContext;
78  ACPI_MEM_MAPPING *Mm;
79 
80 
81  ACPI_FUNCTION_TRACE (EvSystemMemoryRegionSetup);
82 
83 
85  {
86  if (*RegionContext)
87  {
88  LocalRegionContext = (ACPI_MEM_SPACE_CONTEXT *) *RegionContext;
89 
90  /* Delete memory mappings if present */
91 
92  while (LocalRegionContext->FirstMm)
93  {
94  Mm = LocalRegionContext->FirstMm;
95  LocalRegionContext->FirstMm = Mm->NextMm;
97  ACPI_FREE(Mm);
98  }
99  ACPI_FREE (LocalRegionContext);
100  *RegionContext = NULL;
101  }
103  }
104 
105  /* Create a new context */
106 
107  LocalRegionContext = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_MEM_SPACE_CONTEXT));
108  if (!(LocalRegionContext))
109  {
111  }
112 
113  /* Save the region length and address for use in the handler */
114 
115  LocalRegionContext->Length = RegionDesc->Region.Length;
116  LocalRegionContext->Address = RegionDesc->Region.Address;
117 
118  *RegionContext = LocalRegionContext;
120 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1154
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_SIZE Length
Definition: actypes.h:1339
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1223
smooth NULL
Definition: ftsmooth.c:416
ACPI_OBJECT_REGION Region
Definition: acobject.h:525
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_PHYSICAL_ADDRESS Address
Definition: actypes.h:1347
ACPI_MEM_MAPPING * FirstMm
Definition: actypes.h:1349
struct acpi_mem_mapping * NextMm
Definition: actypes.h:1340
UINT8 * LogicalAddress
Definition: actypes.h:1338
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_PHYSICAL_ADDRESS Address
Definition: acobject.h:206
#define AE_OK
Definition: acexcep.h:97
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128

Referenced by AcpiEvInstallSpaceHandler().