news 2026/5/1 11:43:39

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/5/1 9:38:44

IMU如何成为机器人自主移动的核心传感器

IMU是机器人感知自身运动状态的核心传感器,通过内置的加速度计与陀螺仪测量机器人的加速度与角速度,经算法解算后为机器人的控制、导航、平衡等功能提供关键数据,广泛应用于轮式机器人、足式机器人、无人机、机械臂等各类机器人系统中。核心功…

作者头像 李华
网站建设 2026/5/1 8:36:21

解析得物商品详情:API 接口调用实践与数据结构分析

得物平台(原毒APP)作为国内领先的潮流电商平台,其商品数据具有很高的价值。对于开发者而言,了解如何通过其提供的 API 接口获取商品详情信息,是进行数据分析、比价工具开发、库存监控等应用的基础。本文将聚焦于得物平…

作者头像 李华
网站建设 2026/5/1 5:26:11

车辆轨迹系统设计与实现

车辆轨迹系统设计与实现 一、设计背景与意义 车辆轨迹追踪在智能交通、物流车队管理、私家车防盗、网约车监管等领域具有重要应用价值。传统轨迹记录方式依赖车载终端与后台服务器简单交互,存在定位精度低、数据传输延迟、轨迹补全能力弱等问题,难以满足…

作者头像 李华
网站建设 2026/5/1 10:58:38

黑芝麻智能华山A2000 BaRT工具链:全场景智驾模型高效编译与部署

一、引言 随着智驾模型参数规模与计算复杂度指数级增长,大模型应用与车端硬件、性能功耗的矛盾愈发凸显,成为技术量产的关键瓶颈。在此背景下,黑芝麻智能华山A2000 BaRT 工具链以 MLIR 框架为基础,为辅助驾驶模型规模化、高性能、…

作者头像 李华
网站建设 2026/5/1 9:42:01

本年度必看!最佳信息登记二维码推荐榜单

在数字化的时代,信息登记二维码扮演着越来越重要的角色。通过二维码,企业、政府和个人可以高效管理信息,提升登记的便捷性和准确性。本文将从多个角度分析最佳信息登记二维码工具。每种工具都有其独特的功能和适用场景,让我们轻松…

作者头像 李华
网站建设 2026/5/1 10:47:53

django+Pythonuniapp的鲜花知识分享与销售商城系统的设计与实现小程序

文章目录 系统概述技术架构核心功能模块创新点应用价值 系统设计与实现的思路主要技术与实现手段源码lw获取/同行可拿货,招校园代理 :文章底部获取博主联系方式! 系统概述 该系统基于Django后端框架与Python语言开发,结合UniApp跨平台前端技…

作者头像 李华