ReactOS  0.4.14-dev-999-g61c8d34
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 478 of file evrgnini.c.

483 {
484  ACPI_FUNCTION_TRACE (EvCmosRegionSetup);
485 
486 
488 }
#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 507 of file evrgnini.c.

512 {
513  ACPI_FUNCTION_TRACE (EvDefaultRegionSetup);
514 
515 
517  {
518  *RegionContext = NULL;
519  }
520  else
521  {
522  *RegionContext = HandlerContext;
523  }
524 
526 }
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1222
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
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 568 of file evrgnini.c.

570 {
571  ACPI_OPERAND_OBJECT *HandlerObj;
572  ACPI_OPERAND_OBJECT *ObjDesc;
575 
576 
577  ACPI_FUNCTION_TRACE (EvInitializeRegion);
578 
579 
580  if (!RegionObj)
581  {
583  }
584 
585  if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED)
586  {
588  }
589 
590  RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
591 
592  Node = RegionObj->Region.Node->Parent;
593  SpaceId = RegionObj->Region.SpaceId;
594 
595  /*
596  * The following loop depends upon the root Node having no parent
597  * ie: AcpiGbl_RootNode->Parent being set to NULL
598  */
599  while (Node)
600  {
601  /* Check to see if a handler exists */
602 
603  HandlerObj = NULL;
604  ObjDesc = AcpiNsGetAttachedObject (Node);
605  if (ObjDesc)
606  {
607  /* Can only be a handler if the object exists */
608 
609  switch (Node->Type)
610  {
611  case ACPI_TYPE_DEVICE:
612  case ACPI_TYPE_PROCESSOR:
613  case ACPI_TYPE_THERMAL:
614 
615  HandlerObj = ObjDesc->CommonNotify.Handler;
616  break;
617 
618  default:
619 
620  /* Ignore other objects */
621 
622  break;
623  }
624 
625  HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj);
626  if (HandlerObj)
627  {
628  /* Found correct handler */
629 
631  "Found handler %p for region %p in obj %p\n",
632  HandlerObj, RegionObj, ObjDesc));
633 
634  (void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE);
635 
636  /*
637  * Tell all users that this region is usable by
638  * running the _REG method
639  */
644  }
645  }
646 
647  /* This node does not have the handler we need; Pop up one level */
648 
649  Node = Node->Parent;
650  }
651 
652  /*
653  * If we get here, there is no handler for this region. This is not
654  * fatal because many regions get created before a handler is installed
655  * for said region.
656  */
658  "No handler for RegionType %s(%X) (RegionObj %p)\n",
659  AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));
660 
662 }
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:880
#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:124
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 136 of file evrgnini.c.

141 {
142  ACPI_FUNCTION_TRACE (EvIoSpaceRegionSetup);
143 
144 
146  {
147  *RegionContext = NULL;
148  }
149  else
150  {
151  *RegionContext = HandlerContext;
152  }
153 
155 }
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1222
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
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 379 of file evrgnini.c.

381 {
383  ACPI_PNP_DEVICE_ID *Hid;
385  UINT32 i;
386  BOOLEAN Match;
387 
388 
389  /* Get the _HID and check for a PCI Root Bridge */
390 
391  Status = AcpiUtExecute_HID (Node, &Hid);
392  if (ACPI_FAILURE (Status))
393  {
394  return (FALSE);
395  }
396 
397  Match = AcpiUtIsPciRootBridge (Hid->String);
398  ACPI_FREE (Hid);
399 
400  if (Match)
401  {
402  return (TRUE);
403  }
404 
405  /* The _HID did not match. Get the _CID and check for a PCI Root Bridge */
406 
407  Status = AcpiUtExecute_CID (Node, &Cid);
408  if (ACPI_FAILURE (Status))
409  {
410  return (FALSE);
411  }
412 
413  /* Check all _CIDs in the returned list */
414 
415  for (i = 0; i < Cid->Count; i++)
416  {
417  if (AcpiUtIsPciRootBridge (Cid->Ids[i].String))
418  {
419  ACPI_FREE (Cid);
420  return (TRUE);
421  }
422  }
423 
424  ACPI_FREE (Cid);
425  return (FALSE);
426 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define TRUE
Definition: types.h:120
ACPI_PNP_DEVICE_ID Ids[1]
Definition: actypes.h:1273
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
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 447 of file evrgnini.c.

452 {
453  ACPI_FUNCTION_TRACE (EvPciBarRegionSetup);
454 
455 
457 }
#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 176 of file evrgnini.c.

181 {
183  UINT64 PciValue;
184  ACPI_PCI_ID *PciId = *RegionContext;
185  ACPI_OPERAND_OBJECT *HandlerObj;
186  ACPI_NAMESPACE_NODE *ParentNode;
187  ACPI_NAMESPACE_NODE *PciRootNode;
188  ACPI_NAMESPACE_NODE *PciDeviceNode;
190 
191 
192  ACPI_FUNCTION_TRACE (EvPciConfigRegionSetup);
193 
194 
195  HandlerObj = RegionObj->Region.Handler;
196  if (!HandlerObj)
197  {
198  /*
199  * No installed handler. This shouldn't happen because the dispatch
200  * routine checks before we get here, but we check again just in case.
201  */
203  "Attempting to init a region %p, with no handler\n", RegionObj));
205  }
206 
207  *RegionContext = NULL;
209  {
210  if (PciId)
211  {
212  ACPI_FREE (PciId);
213  }
215  }
216 
217  ParentNode = RegionObj->Region.Node->Parent;
218 
219  /*
220  * Get the _SEG and _BBN values from the device upon which the handler
221  * is installed.
222  *
223  * We need to get the _SEG and _BBN objects relative to the PCI BUS device.
224  * This is the device the handler has been registered to handle.
225  */
226 
227  /*
228  * If the AddressSpace.Node is still pointing to the root, we need
229  * to scan upward for a PCI Root bridge and re-associate the OpRegion
230  * handlers with that device.
231  */
232  if (HandlerObj->AddressSpace.Node == AcpiGbl_RootNode)
233  {
234  /* Start search from the parent object */
235 
236  PciRootNode = ParentNode;
237  while (PciRootNode != AcpiGbl_RootNode)
238  {
239  /* Get the _HID/_CID in order to detect a RootBridge */
240 
241  if (AcpiEvIsPciRootBridge (PciRootNode))
242  {
243  /* Install a handler for this PCI root bridge */
244 
246  (ACPI_HANDLE) PciRootNode,
249  if (ACPI_FAILURE (Status))
250  {
251  if (Status == AE_SAME_HANDLER)
252  {
253  /*
254  * It is OK if the handler is already installed on the
255  * root bridge. Still need to return a context object
256  * for the new PCI_Config operation region, however.
257  */
258  }
259  else
260  {
262  "Could not install PciConfig handler "
263  "for Root Bridge %4.4s",
264  AcpiUtGetNodeName (PciRootNode)));
265  }
266  }
267  break;
268  }
269 
270  PciRootNode = PciRootNode->Parent;
271  }
272 
273  /* PCI root bridge not found, use namespace root node */
274  }
275  else
276  {
277  PciRootNode = HandlerObj->AddressSpace.Node;
278  }
279 
280  /*
281  * If this region is now initialized, we are done.
282  * (InstallAddressSpaceHandler could have initialized it)
283  */
284  if (RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)
285  {
287  }
288 
289  /* Region is still not initialized. Create a new context */
290 
291  PciId = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PCI_ID));
292  if (!PciId)
293  {
295  }
296 
297  /*
298  * For PCI_Config space access, we need the segment, bus, device and
299  * function numbers. Acquire them here.
300  *
301  * Find the parent device object. (This allows the operation region to be
302  * within a subscope under the device, such as a control method.)
303  */
304  PciDeviceNode = RegionObj->Region.Node;
305  while (PciDeviceNode && (PciDeviceNode->Type != ACPI_TYPE_DEVICE))
306  {
307  PciDeviceNode = PciDeviceNode->Parent;
308  }
309 
310  if (!PciDeviceNode)
311  {
312  ACPI_FREE (PciId);
314  }
315 
316  /*
317  * Get the PCI device and function numbers from the _ADR object
318  * contained in the parent's scope.
319  */
321  PciDeviceNode, &PciValue);
322 
323  /*
324  * The default is zero, and since the allocation above zeroed the data,
325  * just do nothing on failure.
326  */
327  if (ACPI_SUCCESS (Status))
328  {
329  PciId->Device = ACPI_HIWORD (ACPI_LODWORD (PciValue));
330  PciId->Function = ACPI_LOWORD (ACPI_LODWORD (PciValue));
331  }
332 
333  /* The PCI segment number comes from the _SEG method */
334 
336  PciRootNode, &PciValue);
337  if (ACPI_SUCCESS (Status))
338  {
339  PciId->Segment = ACPI_LOWORD (PciValue);
340  }
341 
342  /* The PCI bus number comes from the _BBN method */
343 
345  PciRootNode, &PciValue);
346  if (ACPI_SUCCESS (Status))
347  {
348  PciId->Bus = ACPI_LOWORD (PciValue);
349  }
350 
351  /* Complete/update the PCI ID for this device */
352 
353  Status = AcpiHwDerivePciId (PciId, PciRootNode, RegionObj->Region.Node);
354  if (ACPI_FAILURE (Status))
355  {
356  ACPI_FREE (PciId);
358  }
359 
360  *RegionContext = PciId;
362 }
#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
#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:1328
#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:379
UINT16 Device
Definition: actypes.h:1329
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1222
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
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
#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:1327
#define ACPI_DEFAULT_HANDLER
Definition: actypes.h:1201
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#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
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_ADR_SPACE_PCI_CONFIG
Definition: actypes.h:854
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
UINT16 Function
Definition: actypes.h:1330
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 
79 
80  ACPI_FUNCTION_TRACE (EvSystemMemoryRegionSetup);
81 
82 
84  {
85  if (*RegionContext)
86  {
87  LocalRegionContext = (ACPI_MEM_SPACE_CONTEXT *) *RegionContext;
88 
89  /* Delete a cached mapping if present */
90 
91  if (LocalRegionContext->MappedLength)
92  {
93  AcpiOsUnmapMemory (LocalRegionContext->MappedLogicalAddress,
94  LocalRegionContext->MappedLength);
95  }
96  ACPI_FREE (LocalRegionContext);
97  *RegionContext = NULL;
98  }
100  }
101 
102  /* Create a new context */
103 
104  LocalRegionContext = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_MEM_SPACE_CONTEXT));
105  if (!(LocalRegionContext))
106  {
108  }
109 
110  /* Save the region length and address for use in the handler */
111 
112  LocalRegionContext->Length = RegionDesc->Region.Length;
113  LocalRegionContext->Address = RegionDesc->Region.Address;
114 
115  *RegionContext = LocalRegionContext;
117 }
#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
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1222
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
smooth NULL
Definition: ftsmooth.c:416
ACPI_SIZE MappedLength
Definition: actypes.h:1340
ACPI_OBJECT_REGION Region
Definition: acobject.h:525
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_PHYSICAL_ADDRESS Address
Definition: actypes.h:1337
#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
UINT8 * MappedLogicalAddress
Definition: actypes.h:1339
#define AE_OK
Definition: acexcep.h:97
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128

Referenced by AcpiEvInstallSpaceHandler().