news 2026/3/10 5:58:58

ACPI!WriteCookAccess函数分析到ACPI!InternalOpRegionHandler到ACPI!PciConfigSpaceHandler

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!WriteCookAccess函数分析到ACPI!InternalOpRegionHandler到ACPI!PciConfigSpaceHandler

ACPI!WriteCookAccess函数分析到ACPI!InternalOpRegionHandler到ACPI!PciConfigSpaceHandler
1: kd> kc
#
00 ACPI!WriteCookAccess
01 ACPI!RunContext
02 ACPI!InsertReadyQueue
03 ACPI!RestartCtxtPassive
04 ACPI!ACPIWorker
05 nt!PspSystemThreadStartup
06 nt!KiThreadStartup
1: kd> dv
pctxt = 0x8997c000
pwca = 0x8997dc08
rc = 0n0
oldIrql = 0x00 ''
busy = 0n-1986536440
dwOldFlags = 8

POPREGIONOBJ pop = (POPREGIONOBJ)pwca->pnsBase->ObjData.pbDataBuff;

1: kd> dx -r1 ((ACPI!_wrcookacc *)0x8997dc08)
((ACPI!_wrcookacc *)0x8997dc08) : 0x8997dc08 [Type: _wrcookacc *]
[+0x000] FrameHdr [Type: _framehdr]
[+0x010] pnsBase : 0x899b0b50 [Type: _NSObj *]
[+0x014] prsa : 0x89996d68 [Type: _rsaccess *]
[+0x018] dwAddr : 0xd8 [Type: unsigned long]
[+0x01c] dwSize : 0x4 [Type: unsigned long]
[+0x020] dwData : 0x40e98102 [Type: unsigned long]
[+0x024] dwDataMask : 0xffffffff [Type: unsigned long]
[+0x028] dwDataTmp : 0x0 [Type: unsigned long]
[+0x02c] fPreserve : 0x0 [Type: unsigned char]
1: kd> dx -r1 ((ACPI!_rsaccess *)0x89996d68)
((ACPI!_rsaccess *)0x89996d68) : 0x89996d68 [Type: _rsaccess *]
[+0x000] prsaNext : 0x0 [Type: _rsaccess *]
[+0x004] dwRegionSpace : 0x2 [Type: unsigned long]
[+0x008] pfnCookAccess : 0xf74280d6[Type: long (__cdecl*)(unsigned long,_NSObj *,unsigned long,unsigned long,unsigned long *,unsigned long,void (__cdecl*)(void *),void *)]
[+0x00c] uipCookParam : 0x899bfea0 [Type: unsigned long]
[+0x010] pfnRawAccess : 0x0 [Type: long (__cdecl*)(unsigned long,_FieldUnitObj *,_ObjData *,unsigned long,void (__cdecl*)(void *),void *)]
[+0x014] uipRawParam : 0x0 [Type: unsigned long]
1: kd> u f74280d6
ACPI!InternalOpRegionHandler [d:\srv03rtm\base\busdrv\acpi\driver\shared\acpioprg.c @ 113]:
f74280d6 55 push ebp
f74280d7 8bec mov ebp,esp
f74280d9 56 push esi
f74280da 57 push edi
f74280db 8b7d0c mov edi,dword ptr [ebp+0Ch]
f74280de 8b7708 mov esi,dword ptr [edi+8]
f74280e1 56 push esi
f74280e2 57 push edi
1: kd> dx -r1 ((ACPI!_NSObj *)0x899b0b50)
((ACPI!_NSObj *)0x899b0b50) : 0x899b0b50 [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899affac [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x30304552 [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899b0a90 [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x899affac [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
1: kd> db 0x899b0b50
899b0b50 90 0a 9b 89 94 0b 9b 89-ac ff 9a 89 00 00 00 00 ................
899b0b60 52 45 30 30 30 f3 9a 89-90 0a 9b 89 00 00 0a 00 RE000...........
899b0b70 00 00 00 00 00 00 00 00-18 00 00 00 34 01 9b 89 ............4...
899b0b80 ac ff 9a 89 00 00 00 00-48 4e 53 4f 44 00 00 00 ........HNSOD...
899b0b90 00 f0 9a 89 50 0b 9b 89-d8 0b 9b 89 ac ff 9a 89 ....P...........
899b0ba0 00 00 00 00 00 00 00 00-30 f3 9a 89 50 0b 9b 89 ........0...P...
899b0bb0 00 00 83 00 00 00 00 00-00 00 00 00 04 00 00 00 ................
899b0bc0 28 0b 9b 89 00 00 00 00-00 00 00 00 48 4e 53 4f (...........HNSO
1: kd> dx -r1 (*((ACPI!_ObjData *)0x899b0b6c))
(*((ACPI!_ObjData *)0x899b0b6c)) [Type: _ObjData]
[+0x000] dwfData : 0x0 [Type: unsigned short]
[+0x002] dwDataType : 0xa [Type: unsigned short]
[+0x004] dwRefCount : 0x0 [Type: unsigned long]
[+0x004] pdataBase : 0x0 [Type: _ObjData *]
[+0x008] dwDataValue : 0x0 [Type: unsigned long]
[+0x008] uipDataValue : 0x0 [Type: unsigned long]
[+0x008] pnsAlias : 0x0 [Type: _NSObj *]
[+0x008] pdataAlias : 0x0 [Type: _ObjData *]
[+0x008] powner : 0x0 [Type: void *]
[+0x00c] dwDataLen : 0x18 [Type: unsigned long]
[+0x010] pbDataBuff : 0x899b0134 : 0xd8 [Type: unsigned char *]
1: kd> dt opregionobj 0x899b0134
ACPI!OPREGIONOBJ
+0x000 uipOffset : 0xd8
+0x004 dwLen : 4
+0x008 bRegionSpace : 0x2 ''
+0x009 reserved : [3] ""
+0x00c RegionBusy : 0n0
+0x010 listLock : 0
+0x014 plistWaiters : (null)


pwca->FrameHdr.dwfFrame++;
ASSERT(!(pctxt->dwfCtxt & CTXTF_READY));
rc = pwca->prsa->pfnCookAccess(RSACCESS_READ, pwca->pnsBase,
(ULONG_PTR)pwca->dwAddr,
pwca->dwSize,
&pwca->dwDataTmp,
pwca->prsa->uipCookParam,
RestartCtxtCallback,
&pctxt->CtxtData);


1: kd> dx -r1 ((ACPI!_wrcookacc *)0x8997dc08)
((ACPI!_wrcookacc *)0x8997dc08) : 0x8997dc08 [Type: _wrcookacc *]
[+0x000] FrameHdr [Type: _framehdr]
[+0x010] pnsBase : 0x899b0b50 [Type: _NSObj *]
[+0x014] prsa : 0x89996d68 [Type: _rsaccess *]
[+0x018] dwAddr : 0xd8 [Type: unsigned long]
[+0x01c] dwSize : 0x4 [Type: unsigned long]
[+0x020] dwData : 0x40e98102 [Type: unsigned long]
[+0x024] dwDataMask : 0xffffffff [Type: unsigned long]
[+0x028] dwDataTmp : 0x0 [Type: unsigned long]
[+0x02c] fPreserve : 0x0 [Type: unsigned char]
1: kd> dx -r1 ((ACPI!_rsaccess *)0x89996d68)
((ACPI!_rsaccess *)0x89996d68) : 0x89996d68 [Type: _rsaccess *]
[+0x000] prsaNext : 0x0 [Type: _rsaccess *]
[+0x004] dwRegionSpace : 0x2 [Type: unsigned long]
[+0x008] pfnCookAccess : 0xf74280d6 [Type: long (__cdecl*)(unsigned long,_NSObj *,unsigned long,unsigned long,unsigned long *,unsigned long,void (__cdecl*)(void *),void *)]
[+0x00c] uipCookParam : 0x899bfea0 [Type: unsigned long]
[+0x010] pfnRawAccess : 0x0 [Type: long (__cdecl*)(unsigned long,_FieldUnitObj *,_ObjData *,unsigned long,void (__cdecl*)(void *),void *)]
[+0x014] uipRawParam : 0x0 [Type: unsigned long]

1: kd> dt ACPI!_ctxt 0x8997c000
+0x000 dwSig : 0x54585443
+0x004 pbCtxtEnd : 0x8997e000 "TSER"
+0x008 listCtxt : _List
+0x010 listQueue : _List
+0x018 pplistCtxtQueue : (null)
+0x01c plistResources : 0x8997c198 _List
+0x020 dwfCtxt : 0x130
+0x024 pnsObj : 0x899b4938 _NSObj
+0x028 pnsScope : 0x899b40ac _NSObj
+0x02c powner : 0x8997c1ac _objowner
+0x030 pcall : 0x8997dd18 _call
+0x034 pnctxt : (null)
+0x038 dwSyncLevel : 0xf
+0x03c pbOp : 0x899b4122 ""
+0x040 Result : _ObjData
+0x054 pfnAsyncCallBack : 0xf7407364 void ACPI!ACPIGetWorkerForInteger+0
+0x058 pdataCallBack : 0x899c634c _ObjData
+0x05c pvContext : 0x899c6320 Void
+0x060 Timer : _KTIMER
+0x088 Dpc : _KDPC
+0x0a8 pheapCurrent : 0x8997c0bc _heap
+0x0ac CtxtData : _ctxtdata
+0x0bc LocalHeap : _heap
1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_ctxtdata *)0x8997c0ac))
(*((ACPI!_ctxtdata *)0x8997c0ac)) [Type: _ctxtdata]
[+0x000] dwData1 : 0x0 [Type: void *]
[+0x004] dwData2 : 0x0 [Type: void *]
[+0x008] dwData3 : 0x0 [Type: void *]
[+0x00c] dwData4 : 0x0 [Type: void *]


1: kd> kc
#
00 ACPI!InternalOpRegionHandler
01 ACPI!WriteCookAccess
02 ACPI!RunContext
03 ACPI!InsertReadyQueue
04 ACPI!RestartCtxtPassive
05 ACPI!ACPIWorker
06 nt!PspSystemThreadStartup
07 nt!KiThreadStartup
1: kd> dv
dwAccType = 1
pnsOpRegion = 0x899b0b50
dwAddr = 0xd8
dwSize = 4
pdwData = 0x8997dc28
Context = 0x899bfea0
CompletionHandler = 0xf7420914
IntContext = 0x8997c0ac


1: kd> dt OPREGIONHANDLER 0x899bfea0
ACPI!OPREGIONHANDLER
+0x000 Handler : 0xf740d970 long ACPI!PciConfigSpaceHandler+0
+0x004 HandlerContext : (null)
+0x008 AccessType : 6
+0x00c RegionSpace : 2

1: kd>dt OPREGIONHANDLER 0x899bfea0
ACPI!OPREGIONHANDLER
+0x000 Handler : 0xf740d970 long ACPI!PciConfigSpaceHandler+0
+0x004 HandlerContext : (null)
+0x008 AccessType : 6
+0x00c RegionSpace : 2
1: kd> dx -r1 ((ACPI!_NSObj *)0x899b0b50)
((ACPI!_NSObj *)0x899b0b50) : 0x899b0b50 [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899affac [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x0 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x30304552 [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x899b0a90 [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x899affac [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
1: kd> dx -r1 ((ACPI!_NSObj *)0x899affac)
((ACPI!_NSObj *)0x899affac) : 0x899affac [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x899af0f0 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x899b0024 [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]
1: kd> db 0x899affac
899affac 4c ff 9a 89 ac 40 9b 89-f0 f0 9a 89 24 00 9b 89 L....@......$...
899affbc 50 43 49 30 30 f3 9a 89-4c ff 9a 89 00 00 06 00 PCI00...L.......
899affcc 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
899affdc 58 0d 9c 89 00 00 00 00-48 4f 52 47 34 00 00 00 X.......HORG4...
899affec 00 f0 9a 89 50 00 00 00-30 00 00 00 02 00 00 00 ....P...0.......
899afffc 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
899b000c 00 00 00 00 00 00 00 00-00 00 00 00 48 4e 53 4f ............HNSO
899b001c 44 00 00 00 00 f0 9a 89-64 a0 91 89 68 00 9b 89 D.......d...h...


1: kd> kc
#
00 ACPI!PciConfigSpaceHandler
01 ACPI!InternalOpRegionHandler
02 ACPI!WriteCookAccess
03 ACPI!RunContext
04 ACPI!InsertReadyQueue
05 ACPI!RestartCtxtPassive
06 ACPI!ACPIWorker
07 nt!PspSystemThreadStartup
08 nt!KiThreadStartup
1: kd> dv
AccessType = 1
OpRegion = 0x899b0b50
Address = 0xd8
Size = 4
Data = 0x8997dc28
Context = 0
CompletionHandler = 0xf7420914
CompletionContext = 0x8997c0ac

第二部分:CompletionContext代表PCTXT

1: kd> u f7420914
ACPI!RestartCtxtCallback [d:\srv03rtm\base\busdrv\acpi\driver\amlinew\sched.c @ 401]:
f7420914 55 push ebp
f7420915 8bec mov ebp,esp
f7420917 56 push esi
f7420918 8b7508 mov esi,dword ptr [ebp+8]
f742091b 57 push edi
f742091c 6a01 push 1
f742091e bf603f43f7 mov edi,offset ACPI!`string' (f7433f60)
f7420923 57 push edi


VOID EXPORT RestartCtxtCallback(PCTXTDATA pctxtdata)
{
TRACENAME("RESTARTCTXTCALLBACK")
PCTXT pctxt = CONTAINING_RECORD(pctxtdata, CTXT, CtxtData);

ENTER(2, ("RestartCtxtCallback(pctxt=%x)\n", pctxt));

ASSERT(pctxt->dwSig == SIG_CTXT);
LOGSCHEDEVENT('RSCB', (ULONG_PTR)pctxt, 0, 0);
RestartContext(pctxt,
(BOOLEAN)((pctxt->dwfCtxt & CTXTF_ASYNC_EVAL) == 0));

EXIT(2, ("RestartCtxtCallback!\n"));
} //RestartCtxtCallback


1: kd> dt CTXT 0x8997c0ac-ac
ACPI!CTXT
+0x000 dwSig : 0x54585443
+0x004 pbCtxtEnd : 0x8997e000 "TSER"
+0x008 listCtxt : _List
+0x010 listQueue : _List
+0x018 pplistCtxtQueue : (null)
+0x01c plistResources : 0x8997c198 _List
+0x020 dwfCtxt : 0x130
+0x024 pnsObj : 0x899b4938 _NSObj
+0x028 pnsScope : 0x899b40ac _NSObj
+0x02c powner : 0x8997c1ac _objowner
+0x030 pcall : 0x8997dd18 _call
+0x034 pnctxt : (null)
+0x038 dwSyncLevel : 0xf
+0x03c pbOp : 0x899b4122 ""
+0x040 Result : _ObjData
+0x054 pfnAsyncCallBack : 0xf7407364 void ACPI!ACPIGetWorkerForInteger+0
+0x058 pdataCallBack : 0x899c634c _ObjData
+0x05c pvContext : 0x899c6320 Void
+0x060 Timer : _KTIMER
+0x088 Dpc : _KDPC
+0x0a8 pheapCurrent : 0x8997c0bc _heap
+0x0ac CtxtData : _ctxtdata
+0x0bc LocalHeap : _heap

1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_heap *)0x8997c0bc))
(*((ACPI!_heap *)0x8997c0bc)) [Type: _heap]
[+0x000] dwSig : 0x50414548 [Type: unsigned long]
[+0x004] pbHeapEnd : 0x8997dc08: 0x57 [Type: unsigned char *]
[+0x008] pheapHead : 0x8997c0bc [Type: _heap *]
[+0x00c] pheapNext : 0x0 [Type: _heap *]
[+0x010] pbHeapTop : 0x8997c1f0 : 0x0 [Type: unsigned char *]
[+0x014] plistFreeHeap : 0x0 [Type: _List *]
[+0x018] Heap [Type: _heapobjhdr]
1: kd> dt framehdr 0x8997dc08
ACPI!FRAMEHDR
+0x000 dwSig : 0x41435257
+0x004 dwLen : 0x30
+0x008 dwfFrame : 3
+0x00c pfnParse : 0xf7417c1d long ACPI!WriteCookAccess+0

会再次回到ACPI!WriteCookAccess!!!

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/3/6 3:48:23

西门子罗宾康IGBT模块LDZ10503116

西门子罗宾康IGBT模块LDZ10503116技术详解一、产品概述西门子罗宾康LDZ10503116是一款高压绝缘栅双极型晶体管(IGBT)功率模块,专为工业级中高压变频器设计。该模块采用第三代硅基半导体技术,额定参数为 1700V/105A ,封…

作者头像 李华
网站建设 2026/3/8 12:53:33

Gitee:中国企业数字化转型的核心技术引擎

Gitee:中国企业数字化转型的核心技术引擎 在中国企业加速数字化转型的背景下,项目管理软件的市场需求呈现爆发式增长。根据IDC最新报告,2025年中国DevOps市场规模将达到120亿元,年复合增长率高达38%。在这个快速发展的赛道上&…

作者头像 李华
网站建设 2026/3/9 15:57:46

springboot高校专业实习管理系统(11738)

有需要的同学,源代码和配套文档领取,加文章最下方的名片哦 一、项目演示 项目演示视频 二、资料介绍 完整源代码(前后端源代码SQL脚本)配套文档(LWPPT开题报告)远程调试控屏包运行 三、技术介绍 Java…

作者头像 李华
网站建设 2026/3/4 18:03:14

2014-2025年城市房住不炒政策数据DID

数据简介 “房住不炒” 是 2016 年 12 月中央经济工作会议首次明确提出的房地产市场核心定位,其核心要义是强调房子的居住属性而非投资投机属性,通过综合运用金融、土地、财税、投资、立法等手段,建立符合国情、适应市场规律的基础性制度和长…

作者头像 李华
网站建设 2026/3/7 10:27:37

2001-2024年地级市互联网普及率

数据简介 互联网普及率(Internet Penetration Rate)是指某一特定区域内,使用互联网的人口占该区域总人口的百分比,是衡量互联网在社会中渗透程度和普及水平的关键指标,反映互联网基础设施覆盖、民众使用意愿与能力等多…

作者头像 李华