ACPI!_NSObj结构的链表结构和全局变量ACPI!gpnsNameSpaceRoot
//
// First pass, mark the objects defunc'd.
//
for (pns = powner->pnsObjList; pns != NULL; pns = pns->pnsOwnedNext) {
pns->ObjData.dwfData |= DATAF_NSOBJ_DEFUNC;
}
//
// Second pass, find the device in the list to be removed
//
for (pns = powner->pnsObjList; pns != NULL; pns = pnsNext) {
pnsNext = pns->pnsOwnedNext;
if (pns->ObjData.dwDataType == OBJTYPE_DEVICE ||
pns->ObjData.dwDataType == OBJTYPE_POWERRES ||
pns->ObjData.dwDataType == OBJTYPE_THERMALZONE ||
pns->ObjData.dwDataType == OBJTYPE_PROCESSOR) {
if (pnsPrev) {
pnsPrev->pnsOwnedNext = pns->pnsOwnedNext;
} else {
powner->pnsObjList = pns->pnsOwnedNext;
}
//dwDataType values
typedef enum _OBJTYPES {
OBJTYPE_UNKNOWN = 0,
OBJTYPE_INTDATA,
OBJTYPE_STRDATA,
OBJTYPE_BUFFDATA,
OBJTYPE_PKGDATA,
OBJTYPE_FIELDUNIT,
OBJTYPE_DEVICE, 6
VOID EXPORT ListInsertTail(PLIST plist, PPLIST pplistHead)
{
ASSERT(pplistHead != NULL);
ENTER((4, "ListInsertTail(plist=%p,plistHead=%p)\n", plist, *pplistHead));
ASSERT(plist != NULL);
if (*pplistHead == NULL)
{
//
// List is empty, so this becomes the head.
//
*pplistHead = plist;
plist->plistPrev = plist->plistNext = plist;
}
else
{
plist->plistNext = *pplistHead;
plist->plistPrev = (*pplistHead)->plistPrev;
(*pplistHead)->plistPrev->plistNext = plist;
(*pplistHead)->plistPrev = plist;
}
EXIT((4, "ListInsertTail! (plistHead=%p)\n", *pplistHead));
} //ListInsertTail
参考:
0: kd> dt _nsobj 0x899af134
ACPI!_NSObj
+0x000 list : _List
+0x008 pnsParent : 0x899af024 _NSObj
+0x00c pnsFirstChild : (null)
+0x010 dwNameSeg : 0x5f49535f
+0x014 hOwner : (null)
+0x018 pnsOwnedNext : (null)
+0x01c ObjData : _ObjData
+0x030 Context : (null)
+0x034 dwRefCount : 0
0: kd> dt HEAPOBJHDR 0x899af134-c
ACPI!HEAPOBJHDR
+0x000 dwSig : 0x4f534e48
+0x004 dwLen : 0x44
+0x008 pheap : 0x899af000 _heap
+0x00c list : _List
0: kd> ?c+38
Evaluate expression: 68 = 00000044
参考:
0: kd> dt HEAPOBJHDR 0x899af57c-c
ACPI!HEAPOBJHDR
+0x000 dwSig : 0x4f534e48
+0x004 dwLen : 0x44
+0x008 pheap : 0x899af000 _heap
+0x00c list : _List
0: kd> db 0x899af57c-c
899af570 48 4e 53 4f 44 00 00 00-00 f0 9a 89 74 f4 9a 89 HNSOD.......t...
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_List *)0x899af57c)
((ACPI!_List *)0x899af57c) : 0x899af57c [Type: _List *]
[+0x000] plistPrev : 0x899af474 [Type: _List *]
[+0x004] plistNext : 0x899af5c0 [Type: _List *]
0: kd> dt HEAPOBJHDR 0x899af5c0-c
ACPI!HEAPOBJHDR
+0x000 dwSig : 0x4f534e48
+0x004 dwLen : 0x44
+0x008 pheap : 0x899af000 _heap
+0x00c list : _List
0: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_List *)0x899af5c0))
(*((ACPI!_List *)0x899af5c0)) [Type: _List]
[+0x000] plistPrev : 0x899af57c [Type: _List *]
[+0x004] plistNext : 0x899af604 [Type: _List *]
0: kd> db 0x899af5c0-c
899af5b4 48 4e 53 4f 44 00 00 00-00 f0 9a 89 7c f5 9a 89 HNSOD.......|...
0: kd> dt HEAPOBJHDR 0x899af604-c
ACPI!HEAPOBJHDR
+0x000 dwSig : 0x4f534e48
+0x004 dwLen : 0x44
+0x008 pheap : 0x899af000 _heap
+0x00c list : _List
0: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_List *)0x899af604))
(*((ACPI!_List *)0x899af604)) [Type: _List]
[+0x000] plistPrev : 0x899af5c0 [Type: _List *]
[+0x004] plistNext : 0x899af668 [Type: _List *]
0: kd> dt HEAPOBJHDR 0x899af668-c
ACPI!HEAPOBJHDR
+0x000 dwSig : 0x4f534e48
+0x004 dwLen : 0x44
+0x008 pheap : 0x899af000 _heap
+0x00c list : _List
0: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_List *)0x899af668))
(*((ACPI!_List *)0x899af668)) [Type: _List]
[+0x000] plistPrev : 0x899af604 [Type: _List *]
[+0x004] plistNext : 0x899af6cc [Type: _List *]
0: kd> x acpi!*owner*
f743a8e8 ACPI!gplistObjOwners = 0x899af330
f743a9d0 ACPI!gmutOwnerList = struct _mutex
f741acfc ACPI!InsertOwnerObjList (struct _objowner *, struct _NSObj *)
f741aa29 ACPI!NewObjOwner (struct _heap *, struct _objowner **)
f741ab03 ACPI!FreeObjOwner (struct _objowner *, unsigned char)
f742ace0 ACPI!RtlDeleteOwnersRanges (_RtlDeleteOwnersRanges@8)
f742b224 ACPI!_imp__RtlDeleteOwnersRanges = <no type information>
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_List *)0x899af330)
((ACPI!_List *)0x899af330) : 0x899af330 [Type: _List *]
[+0x000] plistPrev : 0x899af330 [Type: _List *]
[+0x004] plistNext : 0x899af330 [Type: _List *]
0: kd> dt _OBJOWNER 0x899af330
ACPI!_objowner
+0x000 list : _List
+0x008 dwSig : 0x524e574f
+0x00c pnsObjList : 0x899affac _NSObj
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x899affac) 1
((ACPI!_NSObj *)0x899affac) : 0x899affac [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x30494350 [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899aff4c [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x899c0d58 [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x899aff4c) 2
((ACPI!_NSObj *)0x899aff4c) : 0x899aff4c [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x4c4d454f [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899afccc [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x0 [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x899afccc) 3
((ACPI!_NSObj *)0x899afccc) : 0x899afccc [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x494e495f [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899afc88 [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x0 [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x899afc88) 4
((ACPI!_NSObj *)0x899afc88) : 0x899afc88 [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x47414c46 [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899afc44 [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x0 [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x899afc44) 5
((ACPI!_NSObj *)0x899afc44) : 0x899afc44 [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x534f4f54 [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899afbe0 [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x0 [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
0: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x899afbe0) 6
((ACPI!_NSObj *)0x899afbe0) : 0x899afbe0 [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x4448534d [Type: unsigned long]
[+0x014] hOwne