news 2026/7/31 20:50:12

ACPI!ACPIBuildProcessDevicePhasePr2函数分析之下一个状态是WORK_DONE_PSC不是WORK_DONE_CRS的原因

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!ACPIBuildProcessDevicePhasePr2函数分析之下一个状态是WORK_DONE_PSC不是WORK_DONE_CRS的原因

ACPI!ACPIBuildProcessDevicePhasePr2函数分析之下一个状态是WORK_DONE_PSC不是WORK_DONE_CRS的原因

ACPI!ACPIBuildProcessDevicePhaseCrs函数函数为什么没有运行?

ACPI!ACPIBuildProcessDevicePhasePr2函数之后应该是ACPI!ACPIBuildProcessDevicePhaseCrs函数对节点进行处理,但是不是。


第一部分:按照+1的原则应该是_PR2后应该是_CRS

NTSTATUS
ACPIBuildProcessDeviceGenericEval(
IN PACPI_BUILD_REQUEST BuildRequest
)
{

BuildRequest->NextWorkDone=BuildRequest->CurrentWorkDone+ 1;

1: kd> x acpi!AcpiBuildDevicePowerNameLookup
f7438068 ACPI!AcpiBuildDevicePowerNameLookup = unsigned long [23]
1: kd> dd f7438068
f7438068 00000000 00000000 00000000 00000000
f7438078 00000000 00000000 00000000 00000000
f7438088 00000000 444a455f 00000000 5752505f
f7438098 00000000 3052505f 00000000 3152505f
f74380a8 00000000 3252505f 00000000 5352435f
f74380b8 00000000 4353505f 00000000 f73fb840
f74380c8 00000000 00000000 00000000 f73fb840
f74380d8 00000000 f73fb94c f73fb98a f73fba36
1: kd> db f7438068
f7438068 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
f7438078 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
f7438088 00 00 00 00 5f 45 4a 44-00 00 00 00 5f 50 52 57 ...._EJD...._PRW
f7438098 00 00 00 00 5f 50 52 30-00 00 00 00 5f 50 52 31 ...._PR0...._PR1
f74380a8 00 00 00 00 5f 50 52 32-00 00 00 00 5f 43 52 53 ...._PR2...._CRS
f74380b8 00 00 00 00 5f 50 53 43-00 00 00 00 40 b8 3f f7 ...._PSC....@.?.
f74380c8 00 00 00 00 00 00 00 00-00 00 00 00 40 b8 3f f7 ............@.?.
f74380d8 00 00 00 00 4c b9 3f f7-8a b9 3f f7 36 ba 3f f7 ....L.?...?.6.?.

第二部分:

#define WORK_DONE_ADR WORK_DONE_STEP_1
#define WORK_DONE_ADR_OR_HID WORK_DONE_STEP_0
#define WORK_DONE_CID WORK_DONE_STEP_4
#define WORK_DONE_CRS WORK_DONE_STEP_16
#define WORK_DONE_EJD WORK_DONE_STEP_6
#define WORK_DONE_HID WORK_DONE_STEP_2
#define WORK_DONE_PR0 WORK_DONE_STEP_10
#define WORK_DONE_PR1 WORK_DONE_STEP_12
#define WORK_DONE_PR2 WORK_DONE_STEP_14
#define WORK_DONE_PRW WORK_DONE_STEP_8
#define WORK_DONE_PSC WORK_DONE_STEP_18
#define WORK_DONE_STA WORK_DONE_STEP_5
#define WORK_DONE_UID WORK_DONE_STEP_3

#define WORK_DONE_CRS WORK_DONE_STEP_16
#define WORK_DONE_PSC WORK_DONE_STEP_18

NTSTATUS
ACPIBuildProcessDevicePhasePr2(
IN PACPI_BUILD_REQUEST BuildRequest
)
/*++

This routine is called by the interpreter once it has evaluate the _PR2
method. This routine then determines the current power state of the
device

Path: PhasePr2 ---> PhasePsc
|-> PhasePsc+1


NTSTATUS
ACPIBuildProcessDevicePhasePr2(
IN PACPI_BUILD_REQUEST BuildRequest
)
{

ACPIBuildProcessDevicePhasePr2Exit:

//
// If the device is not physically present, then we cannot run the _CRS and
// _PSC. If the device is not present, the we cannot run those two methods,
// but we can fake it..
//
if (deviceExtension->Flags & DEV_TYPE_NOT_PRESENT) {

BuildRequest->CurrentObject = NULL;
BuildRequest->NextWorkDone = (WORK_DONE_PSC + 1);

} else {

//
// The next step is to run the _PSC
//
BuildRequest->NextWorkDone = WORK_DONE_PSC;

}


1: kd> dx -r1 ((ACPI!_ACPI_BUILD_REQUEST *)0x89996ba0)
((ACPI!_ACPI_BUILD_REQUEST *)0x89996ba0) : 0x89996ba0 [Type: _ACPI_BUILD_REQUEST *]
[+0x000] ListEntry [Type: _LIST_ENTRY]
[+0x008] Signature : 0x5f534750 [Type: unsigned long]
[+0x00c] Flags : 0x1 [Type: unsigned long]
[+0x00c] UFlags [Type: __unnamed]
[+0x010] WorkDone : 0x1 [Type: unsigned long]
[+0x014] CurrentWorkDone : 0x12 [Type: unsigned long]
[+0x018] NextWorkDone : 0x15 [Type: unsigned long] [+0x018] NextWorkDone : 0x15不是0x13!!!
[+0x01c] BuildContext : 0x899c0380 [Type: void *]
[+0x020] Status : 0 [Type: long]
[+0x024] CurrentObject : 0x0 [Type: _NSObj *]
[+0x028] CallBack : 0x0 [Type: void (*)(void *,void *,long)]
[+0x02c] CallBackContext : 0x0 [Type: void *]
[+0x030] DeviceRequest [Type: __unnamed]
[+0x030] RunRequest [Type: __unnamed]
[+0x030] SynchronizeRequest [Type: __unnamed]
[+0x044] Integer : 0xf [Type: unsigned long]
[+0x044] String : 0xf : Unable to read memory at Address 0xf [Type: unsigned char *]
[+0x044] TargetListEntry : 0xf [Type: _LIST_ENTRY *]


1: kd> g
Breakpoint 6 hit
eax=00000000 ebx=00000012 ecx=00000041 edx=00000002 esi=89996ba0 edi=80b019f4
eip=f73fb914 esp=f78aef6c ebp=f78aef84 iopl=0 nv up ei ng nz na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000286
ACPI!ACPIBuildProcessGenericList+0x50:
f73fb914 85db test ebx,ebx
1: kd> dx -r1 ((ACPI!_ACPI_BUILD_REQUEST *)0x89996ba0)
((ACPI!_ACPI_BUILD_REQUEST *)0x89996ba0) : 0x89996ba0 [Type: _ACPI_BUILD_REQUEST *]
[+0x000] ListEntry [Type: _LIST_ENTRY]
[+0x008] Signature : 0x5f534750 [Type: unsigned long]
[+0x00c] Flags : 0x1 [Type: unsigned long]
[+0x00c] UFlags [Type: __unnamed]
[+0x010] WorkDone : 0x15 [Type: unsigned long] 变成了0x15
[+0x014] CurrentWorkDone : 0x12 [Type: unsigned long]
[+0x018] NextWorkDone : 0x2 [Type: unsigned long]
[+0x01c] BuildContext : 0x899c0380 [Type: void *]
[+0x020] Status : 0 [Type: long]
[+0x024] CurrentObject : 0x0 [Type: _NSObj *]
[+0x028] CallBack : 0x0 [Type: void (*)(void *,void *,long)]
[+0x02c] CallBackContext : 0x0 [Type: void *]
[+0x030] DeviceRequest [Type: __unnamed]
[+0x030] RunRequest [Type: __unnamed]
[+0x030] SynchronizeRequest [Type: __unnamed]
[+0x044] Integer : 0xf [Type: unsigned long]
[+0x044] String : 0xf : Unable to read memory at Address 0xf [Type: unsigned char *]
[+0x044] TargetListEntry : 0xf [Type: _LIST_ENTRY *]

//
// Look at the dispatch table to see if there is a function to
// call
//
buildFunction = DispatchTable[ workDone ];


1: kd> g
Breakpoint 5 hit
eax=00000015 ebx=00000015 ecx=89996bb0 edx=00000001 esi=89996ba0 edi=80b019f4
eip=f73fb911 esp=f78aef68 ebp=f78aef84 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
ACPI!ACPIBuildProcessGenericList+0x4d:
f73fb911 ff55f4 call dword ptr [ebp-0Ch] ss:0010:f78aef78={ACPI!ACPIBuildProcessDeviceGenericEval (f73faf0a)}
1: kd> t
eax=00000015 ebx=00000015 ecx=89996bb0 edx=00000001 esi=89996ba0 edi=80b019f4
eip=f73faf0a esp=f78aef64 ebp=f78aef84 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
ACPI!ACPIBuildProcessDeviceGenericEval:
f73faf0a 55 push ebp
1: kd> dv
BuildRequest = 0x89996ba0
status = 0n8
1: kd> dx -r1 ((ACPI!_ACPI_BUILD_REQUEST *)0x89996ba0)
((ACPI!_ACPI_BUILD_REQUEST *)0x89996ba0) : 0x89996ba0 [Type: _ACPI_BUILD_REQUEST *]
[+0x000] ListEntry [Type: _LIST_ENTRY]
[+0x008] Signature : 0x5f534750 [Type: unsigned long]
[+0x00c] Flags : 0x1 [Type: unsigned long]
[+0x00c] UFlags [Type: __unnamed]
[+0x010] WorkDone : 0x1 [Type: unsigned long]
[+0x014] CurrentWorkDone : 0x15 [Type: unsigned long] 0x15不是0x13
[+0x018] NextWorkDone : 0x2 [Type: unsigned long]
[+0x01c] BuildContext : 0x899c0380 [Type: void *]
[+0x020] Status : 0 [Type: long]
[+0x024] CurrentObject : 0x0 [Type: _NSObj *]
[+0x028] CallBack : 0x0 [Type: void (*)(void *,void *,long)]
[+0x02c] CallBackContext : 0x0 [Type: void *]
[+0x030] DeviceRequest [Type: __unnamed]
[+0x030] RunRequest [Type: __unnamed]
[+0x030] SynchronizeRequest [Type: __unnamed]
[+0x044] Integer : 0xf [Type: unsigned long]
[+0x044] String : 0xf : Unable to read memory at Address 0xf [Type: unsigned char *]
[+0x044] TargetListEntry : 0xf [Type: _LIST_ENTRY *]

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

Pelco KBD300A 模拟器:20.搭建pytest集成测试基础框架 + 模拟器闭环测试

第 20 篇:搭建集成测试基础框架 模拟器闭环测试 下面我们将一步一步详细完成集成测试基础框架搭建,并实现模拟器闭环测试(串口收到数据 → 协议解析 → VirtualDevice 状态更新 → 可选返回响应)。 目标: 不依赖真…

作者头像 李华
网站建设 2026/7/31 12:20:45

1 篇看懂:以太网多参量传感器为什么能适配所有工业场景?

在工业智能化转型中,环境与设备监测的核心痛点是 “场景差异大、需求碎片化”—— 化工车间要防有毒气体泄漏,数据中心需稳控温湿度,仓储库房要适配多品类存储环境,传统单一功能传感器难以兼顾。而以太网多参量传感器凭借 “全功能…

作者头像 李华
网站建设 2026/7/31 12:21:02

不只是替代谷歌:为你带来新视角的11个搜索引擎与核心价值解析

如果你正在寻找一个替代谷歌的搜索引擎,你来对地方了。 读完本指南后,你将知道哪些是最佳的替代搜索引擎。以及为什么每个搜索引擎都可能更适合你。 我们开始吧。 1. Bing 如果你想要类似谷歌的搜索体验,并借助OpenAI驱动的AI结果&#xff0c…

作者头像 李华
网站建设 2026/7/31 12:23:04

springboot演唱会售票管理系统设计实现

背景分析 演唱会售票管理系统源于传统票务管理的低效与痛点。线下售票存在排队拥堵、黄牛倒票、数据统计滞后等问题;线上分散平台导致信息不透明、跨平台购票体验差。SpringBoot框架的成熟技术栈为系统开发提供了高效解决方案,其模块化设计、自动化配置…

作者头像 李华
网站建设 2026/7/31 12:20:46

基于springboot的水务管理系统设计实现

背景分析水务管理系统是智慧城市建设的重要组成部分,传统水务管理依赖人工记录和纸质档案,存在效率低、数据易丢失、响应滞后等问题。随着城市化进程加快,水资源供需矛盾加剧,亟需通过信息化手段提升水务管理能力。SpringBoot框架…

作者头像 李华
网站建设 2026/7/31 12:20:54

Canoga Perkins将突破型专用5G技术引入墨西哥克雷塔罗BLOQUE创新中心

作为全球领先的专用5G网络连接解决方案提供商,Canoga Perkins宣布在墨西哥克雷塔罗BLOQUE创新中心正式设立其首个海外专用5G客户体验中心。2026年1月16日,公司在“Experiencing SyncMetra”活动期间,现场演示了SyncMetra 100产品以及完整的端…

作者头像 李华