ReactOS 0.4.15-dev-7924-g5949c20
nsxfname.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "acparser.h"
#include "amlcode.h"
Include dependency graph for nsxfname.c:

Go to the source code of this file.

Macros

#define EXPORT_ACPI_INTERFACES
 
#define _COMPONENT   ACPI_NAMESPACE
 

Functions

static charAcpiNsCopyDeviceId (ACPI_PNP_DEVICE_ID *Dest, ACPI_PNP_DEVICE_ID *Source, char *StringArea)
 
ACPI_STATUS AcpiGetHandle (ACPI_HANDLE Parent, ACPI_STRING Pathname, ACPI_HANDLE *RetHandle)
 
ACPI_STATUS AcpiGetName (ACPI_HANDLE Handle, UINT32 NameType, ACPI_BUFFER *Buffer)
 
ACPI_STATUS AcpiGetObjectInfo (ACPI_HANDLE Handle, ACPI_DEVICE_INFO **ReturnBuffer)
 
ACPI_STATUS AcpiInstallMethod (UINT8 *Buffer)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_NAMESPACE

Definition at line 54 of file nsxfname.c.

◆ EXPORT_ACPI_INTERFACES

#define EXPORT_ACPI_INTERFACES

Definition at line 45 of file nsxfname.c.

Function Documentation

◆ AcpiGetHandle()

ACPI_STATUS AcpiGetHandle ( ACPI_HANDLE  Parent,
ACPI_STRING  Pathname,
ACPI_HANDLE RetHandle 
)

Definition at line 85 of file nsxfname.c.

89{
92 ACPI_NAMESPACE_NODE *PrefixNode = NULL;
93
94
96
97
98 /* Parameter Validation */
99
100 if (!RetHandle || !Pathname)
101 {
102 return (AE_BAD_PARAMETER);
103 }
104
105 /* Convert a parent handle to a prefix node */
106
107 if (Parent)
108 {
109 PrefixNode = AcpiNsValidateHandle (Parent);
110 if (!PrefixNode)
111 {
112 return (AE_BAD_PARAMETER);
113 }
114 }
115
116 /*
117 * Valid cases are:
118 * 1) Fully qualified pathname
119 * 2) Parent + Relative pathname
120 *
121 * Error for <null Parent + relative path>
122 */
124 {
125 /* Pathname is fully qualified (starts with '\') */
126
127 /* Special case for root-only, since we can't search for it */
128
130 {
131 *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode);
132 return (AE_OK);
133 }
134 }
135 else if (!PrefixNode)
136 {
137 /* Relative path with null prefix is disallowed */
138
139 return (AE_BAD_PARAMETER);
140 }
141
142 /* Find the Node and convert to a handle */
143
145 if (ACPI_SUCCESS (Status))
146 {
147 *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
148 }
149
150 return (Status);
151}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define AE_OK
Definition: acexcep.h:97
#define ACPI_IS_ROOT_PREFIX(c)
Definition: acmacros.h:401
#define ACPI_NS_ROOT_PATH
Definition: acnames.h:95
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
ACPI_STATUS AcpiNsGetNode(ACPI_NAMESPACE_NODE *PrefixNode, const char *ExternalPathname, UINT32 Flags, ACPI_NAMESPACE_NODE **OutNode)
Definition: nsutils.c:863
#define ACPI_NS_NO_UPSEARCH
Definition: acnamesp.h:62
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx 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 Pathname
Definition: acpixf.h:704
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx 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 Parent
Definition: acpixf.h:732
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define NULL
Definition: types.h:112
Status
Definition: gdiplustypes.h:25
Definition: dlist.c:348

Referenced by acpi_bus_get_flags(), acpi_bus_get_power_flags(), AcpiEvaluateObjectTyped(), AcpiEvExecuteOrphanRegMethod(), AcpiNsInitializeDevices(), and AcpiUtGetMutexObject().

◆ AcpiGetName()

ACPI_STATUS AcpiGetName ( ACPI_HANDLE  Handle,
UINT32  NameType,
ACPI_BUFFER Buffer 
)

Definition at line 173 of file nsxfname.c.

177{
179
180
181 /* Parameter validation */
182
184 {
185 return (AE_BAD_PARAMETER);
186 }
187
189 if (ACPI_FAILURE (Status))
190 {
191 return (Status);
192 }
193
194 /*
195 * Wants the single segment ACPI name.
196 * Validate handle and convert to a namespace Node
197 */
199 if (ACPI_FAILURE (Status))
200 {
201 return (Status);
202 }
203
206 {
207 /* Get the full pathname (From the namespace root) */
208
211 }
212 else
213 {
214 /* Get the single name */
215
217 }
218
220 return (Status);
221}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
ACPI_STATUS AcpiNsHandleToName(ACPI_HANDLE TargetHandle, ACPI_BUFFER *Buffer)
Definition: nsnames.c:133
ACPI_STATUS AcpiNsHandleToPathname(ACPI_HANDLE TargetHandle, ACPI_BUFFER *Buffer, BOOLEAN NoTrailing)
Definition: nsnames.c:187
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 NameType
Definition: acpixf.h:658
#define ACPI_FULL_PATHNAME_NO_TRAILING
Definition: actypes.h:1064
#define ACPI_NAME_TYPE_MAX
Definition: actypes.h:1065
#define ACPI_FULL_PATHNAME
Definition: actypes.h:1062
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtValidateBuffer(ACPI_BUFFER *Buffer)
Definition: utalloc.c:290
Definition: bufpool.h:45
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
ULONG Handle
Definition: gdb_input.c:15

Referenced by acpi_bus_add(), acpi_power_get_state(), acpi_util_eval_error(), and EvalConvertObjectReference().

◆ AcpiGetObjectInfo()

ACPI_STATUS AcpiGetObjectInfo ( ACPI_HANDLE  Handle,
ACPI_DEVICE_INFO **  ReturnBuffer 
)

Definition at line 287 of file nsxfname.c.

290{
293 ACPI_PNP_DEVICE_ID_LIST *CidList = NULL;
297 char *NextIdString;
300 UINT8 ParamCount= 0;
301 UINT16 Valid = 0;
302 UINT32 InfoSize;
303 UINT32 i;
305
306
307 /* Parameter validation */
308
309 if (!Handle || !ReturnBuffer)
310 {
311 return (AE_BAD_PARAMETER);
312 }
313
315 if (ACPI_FAILURE (Status))
316 {
317 return (Status);
318 }
319
321 if (!Node)
322 {
324 return (AE_BAD_PARAMETER);
325 }
326
327 /* Get the namespace node data while the namespace is locked */
328
329 InfoSize = sizeof (ACPI_DEVICE_INFO);
330 Type = Node->Type;
331 Name = Node->Name.Integer;
332
333 if (Node->Type == ACPI_TYPE_METHOD)
334 {
335 ParamCount = Node->Object->Method.ParamCount;
336 }
337
339 if (ACPI_FAILURE (Status))
340 {
341 return (Status);
342 }
343
344 if ((Type == ACPI_TYPE_DEVICE) ||
346 {
347 /*
348 * Get extra info for ACPI Device/Processor objects only:
349 * Run the Device _HID, _UID, _CLS, and _CID methods.
350 *
351 * Note: none of these methods are required, so they may or may
352 * not be present for this device. The Info->Valid bitfield is used
353 * to indicate which methods were found and run successfully.
354 */
355
356 /* Execute the Device._HID method */
357
358 Status = AcpiUtExecute_HID (Node, &Hid);
359 if (ACPI_SUCCESS (Status))
360 {
361 InfoSize += Hid->Length;
362 Valid |= ACPI_VALID_HID;
363 }
364
365 /* Execute the Device._UID method */
366
367 Status = AcpiUtExecute_UID (Node, &Uid);
368 if (ACPI_SUCCESS (Status))
369 {
370 InfoSize += Uid->Length;
371 Valid |= ACPI_VALID_UID;
372 }
373
374 /* Execute the Device._CID method */
375
376 Status = AcpiUtExecute_CID (Node, &CidList);
377 if (ACPI_SUCCESS (Status))
378 {
379 /* Add size of CID strings and CID pointer array */
380
381 InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST));
382 Valid |= ACPI_VALID_CID;
383 }
384
385 /* Execute the Device._CLS method */
386
387 Status = AcpiUtExecute_CLS (Node, &Cls);
388 if (ACPI_SUCCESS (Status))
389 {
390 InfoSize += Cls->Length;
391 Valid |= ACPI_VALID_CLS;
392 }
393 }
394
395 /*
396 * Now that we have the variable-length data, we can allocate the
397 * return buffer
398 */
399 Info = ACPI_ALLOCATE_ZEROED (InfoSize);
400 if (!Info)
401 {
403 goto Cleanup;
404 }
405
406 /* Get the fixed-length data */
407
408 if ((Type == ACPI_TYPE_DEVICE) ||
410 {
411 /*
412 * Get extra info for ACPI Device/Processor objects only:
413 * Run the _ADR and, SxW, and _SxD methods.
414 *
415 * Notes: none of these methods are required, so they may or may
416 * not be present for this device. The Info->Valid bitfield is used
417 * to indicate which methods were found and run successfully.
418 */
419
420 /* Execute the Device._ADR method */
421
423 &Info->Address);
424 if (ACPI_SUCCESS (Status))
425 {
426 Valid |= ACPI_VALID_ADR;
427 }
428
429 /* Execute the Device._SxW methods */
430
433 Info->LowestDstates);
434 if (ACPI_SUCCESS (Status))
435 {
436 Valid |= ACPI_VALID_SXWS;
437 }
438
439 /* Execute the Device._SxD methods */
440
443 Info->HighestDstates);
444 if (ACPI_SUCCESS (Status))
445 {
446 Valid |= ACPI_VALID_SXDS;
447 }
448 }
449
450 /*
451 * Create a pointer to the string area of the return buffer.
452 * Point to the end of the base ACPI_DEVICE_INFO structure.
453 */
454 NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids);
455 if (CidList)
456 {
457 /* Point past the CID PNP_DEVICE_ID array */
458
459 NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_PNP_DEVICE_ID));
460 }
461
462 /*
463 * Copy the HID, UID, and CIDs to the return buffer. The variable-length
464 * strings are copied to the reserved area at the end of the buffer.
465 *
466 * For HID and CID, check if the ID is a PCI Root Bridge.
467 */
468 if (Hid)
469 {
470 NextIdString = AcpiNsCopyDeviceId (&Info->HardwareId,
471 Hid, NextIdString);
472
473 if (AcpiUtIsPciRootBridge (Hid->String))
474 {
475 Info->Flags |= ACPI_PCI_ROOT_BRIDGE;
476 }
477 }
478
479 if (Uid)
480 {
481 NextIdString = AcpiNsCopyDeviceId (&Info->UniqueId,
482 Uid, NextIdString);
483 }
484
485 if (CidList)
486 {
487 Info->CompatibleIdList.Count = CidList->Count;
488 Info->CompatibleIdList.ListSize = CidList->ListSize;
489
490 /* Copy each CID */
491
492 for (i = 0; i < CidList->Count; i++)
493 {
494 NextIdString = AcpiNsCopyDeviceId (&Info->CompatibleIdList.Ids[i],
495 &CidList->Ids[i], NextIdString);
496
497 if (AcpiUtIsPciRootBridge (CidList->Ids[i].String))
498 {
499 Info->Flags |= ACPI_PCI_ROOT_BRIDGE;
500 }
501 }
502 }
503
504 if (Cls)
505 {
506 (void) AcpiNsCopyDeviceId (&Info->ClassCode,
507 Cls, NextIdString);
508 }
509
510 /* Copy the fixed-length data */
511
512 Info->InfoSize = InfoSize;
513 Info->Type = Type;
514 Info->Name = Name;
515 Info->ParamCount = ParamCount;
516 Info->Valid = Valid;
517
518 *ReturnBuffer = Info;
519 Status = AE_OK;
520
521
522Cleanup:
523 if (Hid)
524 {
525 ACPI_FREE (Hid);
526 }
527 if (Uid)
528 {
529 ACPI_FREE (Uid);
530 }
531 if (CidList)
532 {
533 ACPI_FREE (CidList);
534 }
535 if (Cls)
536 {
537 ACPI_FREE (Cls);
538 }
539 return (Status);
540}
unsigned short UINT16
unsigned char UINT8
unsigned int UINT32
Type
Definition: Type.h:7
#define AE_NO_MEMORY
Definition: acexcep.h:112
const char * AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS]
Definition: utglobal.c:72
const char * AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS]
Definition: utglobal.c:81
#define METHOD_NAME__ADR
Definition: acnames.h:49
#define ACPI_TYPE_PROCESSOR
Definition: actypes.h:699
UINT32 ACPI_OBJECT_TYPE
Definition: actypes.h:685
#define ACPI_VALID_HID
Definition: actypes.h:1330
struct acpi_device_info ACPI_DEVICE_INFO
#define ACPI_VALID_SXDS
Definition: actypes.h:1334
struct acpi_pnp_device_id_list ACPI_PNP_DEVICE_ID_LIST
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_TYPE_DEVICE
Definition: actypes.h:693
#define ACPI_VALID_CID
Definition: actypes.h:1332
#define ACPI_VALID_ADR
Definition: actypes.h:1329
#define ACPI_VALID_CLS
Definition: actypes.h:1333
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
UINT32 ACPI_NAME
Definition: actypes.h:461
#define ACPI_VALID_UID
Definition: actypes.h:1331
#define ACPI_PCI_ROOT_BRIDGE
Definition: actypes.h:1325
#define ACPI_TYPE_METHOD
Definition: actypes.h:695
#define ACPI_VALID_SXWS
Definition: actypes.h:1335
ACPI_STATUS AcpiUtExecutePowerMethods(ACPI_NAMESPACE_NODE *DeviceNode, const char **MethodNames, UINT8 MethodCount, UINT8 *OutValues)
Definition: uteval.c:332
BOOLEAN AcpiUtIsPciRootBridge(char *Id)
Definition: utmisc.c:66
ACPI_STATUS AcpiUtExecute_UID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
Definition: utids.c:160
ACPI_STATUS AcpiUtExecute_CID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID_LIST **ReturnCidList)
Definition: utids.c:253
ACPI_STATUS AcpiUtExecute_HID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
Definition: utids.c:72
ACPI_STATUS AcpiUtExecute_CLS(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
Definition: utids.c:406
ACPI_STATUS AcpiUtEvaluateNumericObject(const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value)
Definition: uteval.c:221
struct NameRec_ * Name
Definition: cdprocs.h:460
union node Node
Definition: types.h:1255
static const WCHAR Cleanup[]
Definition: register.c:80
#define ACPI_NUM_SxD_METHODS
Definition: acconfig.h:234
#define ACPI_NUM_SxW_METHODS
Definition: acconfig.h:235
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
static char * AcpiNsCopyDeviceId(ACPI_PNP_DEVICE_ID *Dest, ACPI_PNP_DEVICE_ID *Source, char *StringArea)
Definition: nsxfname.c:241
ACPI_PNP_DEVICE_ID Ids[]
Definition: actypes.h:1297
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by acpi_bus_add().

◆ AcpiInstallMethod()

ACPI_STATUS AcpiInstallMethod ( UINT8 Buffer)

Definition at line 561 of file nsxfname.c.

563{
565 UINT8 *AmlBuffer;
566 UINT8 *AmlStart;
567 char *Path;
569 ACPI_OPERAND_OBJECT *MethodObj;
570 ACPI_PARSE_STATE ParserState;
571 UINT32 AmlLength;
573 UINT8 MethodFlags;
575
576
577 /* Parameter validation */
578
579 if (!Buffer)
580 {
581 return (AE_BAD_PARAMETER);
582 }
583
584 /* Table must be a DSDT or SSDT */
585
586 if (!ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT) &&
588 {
589 return (AE_BAD_HEADER);
590 }
591
592 /* First AML opcode in the table must be a control method */
593
594 ParserState.Aml = Buffer + sizeof (ACPI_TABLE_HEADER);
595 Opcode = AcpiPsPeekOpcode (&ParserState);
596 if (Opcode != AML_METHOD_OP)
597 {
598 return (AE_BAD_PARAMETER);
599 }
600
601 /* Extract method information from the raw AML */
602
603 ParserState.Aml += AcpiPsGetOpcodeSize (Opcode);
604 ParserState.PkgEnd = AcpiPsGetNextPackageEnd (&ParserState);
605 Path = AcpiPsGetNextNamestring (&ParserState);
606
607 MethodFlags = *ParserState.Aml++;
608 AmlStart = ParserState.Aml;
609 AmlLength = (UINT32) ACPI_PTR_DIFF (ParserState.PkgEnd, AmlStart);
610
611 /*
612 * Allocate resources up-front. We don't want to have to delete a new
613 * node from the namespace if we cannot allocate memory.
614 */
615 AmlBuffer = ACPI_ALLOCATE (AmlLength);
616 if (!AmlBuffer)
617 {
618 return (AE_NO_MEMORY);
619 }
620
622 if (!MethodObj)
623 {
624 ACPI_FREE (AmlBuffer);
625 return (AE_NO_MEMORY);
626 }
627
628 /* Lock namespace for AcpiNsLookup, we may be creating a new node */
629
631 if (ACPI_FAILURE (Status))
632 {
633 goto ErrorExit;
634 }
635
636 /* The lookup either returns an existing node or creates a new one */
637
640
642
643 if (ACPI_FAILURE (Status)) /* NsLookup */
644 {
646 {
647 goto ErrorExit;
648 }
649
650 /* Node existed previously, make sure it is a method node */
651
652 if (Node->Type != ACPI_TYPE_METHOD)
653 {
654 Status = AE_TYPE;
655 goto ErrorExit;
656 }
657 }
658
659 /* Copy the method AML to the local buffer */
660
661 memcpy (AmlBuffer, AmlStart, AmlLength);
662
663 /* Initialize the method object with the new method's information */
664
665 MethodObj->Method.AmlStart = AmlBuffer;
666 MethodObj->Method.AmlLength = AmlLength;
667
668 MethodObj->Method.ParamCount = (UINT8)
669 (MethodFlags & AML_METHOD_ARG_COUNT);
670
671 if (MethodFlags & AML_METHOD_SERIALIZED)
672 {
674
675 MethodObj->Method.SyncLevel = (UINT8)
676 ((MethodFlags & AML_METHOD_SYNC_LEVEL) >> 4);
677 }
678
679 /*
680 * Now that it is complete, we can attach the new method object to
681 * the method Node (detaches/deletes any existing object)
682 */
684
685 /*
686 * Flag indicates AML buffer is dynamic, must be deleted later.
687 * Must be set only after attach above.
688 */
690
691 /* Remove local reference to the method object */
692
693 AcpiUtRemoveReference (MethodObj);
694 return (Status);
695
696
698
699 ACPI_FREE (AmlBuffer);
700 ACPI_FREE (MethodObj);
701 return (Status);
702}
PRTL_UNICODE_STRING_BUFFER Path
#define AE_BAD_HEADER
Definition: acexcep.h:168
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
#define AE_TYPE
Definition: acexcep.h:116
@ ACPI_IMODE_LOAD_PASS1
Definition: aclocal.h:167
#define ANOBJ_ALLOCATED_BUFFER
Definition: aclocal.h:221
ACPI_STATUS AcpiNsLookup(ACPI_GENERIC_STATE *ScopeInfo, char *Name, ACPI_OBJECT_TYPE Type, ACPI_INTERPRETER_MODE InterpreterMode, UINT32 Flags, ACPI_WALK_STATE *WalkState, ACPI_NAMESPACE_NODE **RetNode)
Definition: nsaccess.c:328
#define ACPI_NS_ERROR_IF_FOUND
Definition: acnamesp.h:66
#define ACPI_NS_DONT_OPEN_SCOPE
Definition: acnamesp.h:64
ACPI_STATUS AcpiNsAttachObject(ACPI_NAMESPACE_NODE *Node, ACPI_OPERAND_OBJECT *Object, ACPI_OBJECT_TYPE Type)
Definition: nsobject.c:76
#define ACPI_METHOD_SERIALIZED
Definition: acobject.h:238
UINT16 AcpiPsPeekOpcode(ACPI_PARSE_STATE *state)
Definition: psparse.c:108
char * AcpiPsGetNextNamestring(ACPI_PARSE_STATE *ParserState)
Definition: psargs.c:172
UINT8 * AcpiPsGetNextPackageEnd(ACPI_PARSE_STATE *ParserState)
Definition: psargs.c:138
UINT32 AcpiPsGetOpcodeSize(UINT32 Opcode)
Definition: psparse.c:78
#define ACPI_SIG_DSDT
Definition: actbl.h:67
struct acpi_table_header ACPI_TABLE_HEADER
#define ACPI_SIG_SSDT
Definition: actbl.h:75
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:564
#define ACPI_PTR_DIFF(a, b)
Definition: actypes.h:548
#define ACPI_ALLOCATE(a)
Definition: actypes.h:384
#define AcpiUtCreateInternalObject(t)
Definition: acutils.h:681
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:790
#define AML_METHOD_ARG_COUNT
Definition: amlcode.h:505
#define AML_METHOD_SERIALIZED
Definition: amlcode.h:506
#define AML_METHOD_OP
Definition: amlcode.h:64
#define AML_METHOD_SYNC_LEVEL
Definition: amlcode.h:507
ASMGENDATA Table[]
Definition: genincdata.c:61
_In_ PVOID _In_ ULONG Opcode
Definition: hubbusif.h:331
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT8 * AmlStart
Definition: acobject.h:221
ACPI_OBJECT_COMMON_HEADER UINT8 InfoFlags
Definition: acobject.h:216
UINT8 * PkgEnd
Definition: aclocal.h:1105
static VOID ErrorExit(LPTSTR lpszMessage)
Definition: telnetd.c:647
ACPI_OBJECT_METHOD Method
Definition: acobject.h:525

◆ AcpiNsCopyDeviceId()

static char * AcpiNsCopyDeviceId ( ACPI_PNP_DEVICE_ID Dest,
ACPI_PNP_DEVICE_ID Source,
char StringArea 
)
static

Definition at line 241 of file nsxfname.c.

245{
246 /* Create the destination PNP_DEVICE_ID */
247
248 Dest->String = StringArea;
249 Dest->Length = Source->Length;
250
251 /* Copy actual string and return a pointer to the next string area */
252
253 memcpy (StringArea, Source->String, Source->Length);
254 return (StringArea + Source->Length);
255}
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169

Referenced by AcpiGetObjectInfo().