news 2026/4/30 6:29:29

ACPI!ACPIBuildProcessDevicePhasePsc函数分析对节点iSA的处理

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!ACPIBuildProcessDevicePhasePsc函数分析对节点iSA的处理

ACPI!ACPIBuildProcessDevicePhasePsc函数分析对节点iSA的处理

1: kd> g
Breakpoint 5 hit
eax=00000016 ebx=00000016 ecx=89984198 edx=00000001 esi=89984188 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!ACPIBuildProcessDevicePhasePsc (f73fb57c)}
1: kd> kc
#
00 ACPI!ACPIBuildProcessDevicePhasePsc
01 ACPI!ACPIBuildProcessGenericList
02 ACPI!ACPIBuildDeviceDpc
03 nt!KiRetireDpcList
04 nt!KiDispatchInterrupt
WARNING: Frame IP not in any known module. Following frames may be wrong.
05 0x0
1: kd> dv
BuildRequest = 0x89984188
matrixIndex = 0n8 (No matching enumerant)
i = 0n-1986510456 (No matching enumerant)

typedef enum _SYSTEM_POWER_STATE {
PowerSystemUnspecified = 0,
PowerSystemWorking = 1,
PowerSystemSleeping1 = 2,
PowerSystemSleeping2 = 3,
PowerSystemSleeping3 = 4,
PowerSystemHibernate = 5,
PowerSystemShutdown = 6,
PowerSystemMaximum = 7
} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;


1: kd> dv matrixIndex
matrixIndex = PowerSystemSleeping1 (0n2)
2 3 4 5

//
// For each S state, walk PR0 to PR2 until you find a resource that
// cannot be ON in S state. The next lighter D state is then the lightest
// D state for the given S state.
//
for ( ; matrixIndex <= PowerSystemHibernate ; matrixIndex++ ) {

//
// Loop on all members of the PowerNode
//
for (i = PowerDeviceD0; i <= PowerDeviceD2; i++ ) {


1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_ACPI_POWER_INFO *)0x899c0b18))
(*((ACPI!_ACPI_POWER_INFO *)0x899c0b18)) [Type: _ACPI_POWER_INFO]
[+0x000] Context : 0x0 [Type: void *]
[+0x004] PowerState : PowerDeviceUnspecified (0) [Type: _DEVICE_POWER_STATE]
[+0x008] DeviceNotifyHandler : 0x0 [Type: void (*)(void *,unsigned long)]
[+0x00c] HandlerContext : 0x0 [Type: void *]
[+0x010] PowerNode [Type: _ACPI_DEVICE_POWER_NODE * [4]]//这个
[+0x020] PowerObject [Type: _NSObj * [5]]
[+0x034] WakeBit : 0x0 [Type: unsigned long]
[+0x038] DevicePowerMatrix [Type: _DEVICE_POWER_STATE [7]]//这个
1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_ACPI_DEVICE_POWER_NODE * (*)[4])0x899c0b28))
(*((ACPI!_ACPI_DEVICE_POWER_NODE * (*)[4])0x899c0b28)) [Type: _ACPI_DEVICE_POWER_NODE * [4]]
[0] : 0x0 [Type: _ACPI_DEVICE_POWER_NODE *]
[1] : 0x0 [Type: _ACPI_DEVICE_POWER_NODE *]
[2] : 0x0 [Type: _ACPI_DEVICE_POWER_NODE *]
[3] : 0x0 [Type: _ACPI_DEVICE_POWER_NODE *]

1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_DEVICE_POWER_STATE (*)[7])0x899c0b50))
(*((ACPI!_DEVICE_POWER_STATE (*)[7])0x899c0b50)) [Type: _DEVICE_POWER_STATE [7]]
[0] : PowerDeviceUnspecified (0) [Type: _DEVICE_POWER_STATE]
[1] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[2] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[3] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[4] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[5] : PowerDeviceD3 (4) [Type: _DEVICE_POWER_STATE]
[6] : PowerDeviceD3 (4) [Type: _DEVICE_POWER_STATE]

1: kd> dd 0x899c0b50
899c0b50 00000000 00000001 00000001 00000001
899c0b60 00000001 00000004 00000004 00000000

typedef enum _DEVICE_POWER_STATE {
PowerDeviceUnspecified = 0,
PowerDeviceD0,
PowerDeviceD1,
PowerDeviceD2,
PowerDeviceD3,
PowerDeviceMaximum
} DEVICE_POWER_STATE, *PDEVICE_POWER_STATE;


1: kd> dv
BuildRequest = 0x00000004
matrixIndex = PowerSystemSleeping2 (0n3)
i = PowerDeviceD3 (0n4)

//
// If we have had a device node, but don't have now, that means
// that we found a D level that is compliant for this S-state
//
if (deviceNode == NULL) {

ACPIDevPrint( (
ACPI_PRINT_LOADING,
deviceExtension,
"ACPIBuildDeviceProcessPhasePsc: D%x <-> S%x\n",
(i - PowerDeviceD0),
matrixIndex - PowerSystemWorking
) );

//
// This device can be in Di state while in SmatrixIndex state
//
powerInfo->DevicePowerMatrix[matrixIndex] = i;
break;

1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_ACPI_POWER_INFO *)0x899c0b18))
(*((ACPI!_ACPI_POWER_INFO *)0x899c0b18)) [Type: _ACPI_POWER_INFO]
[+0x000] Context : 0x0 [Type: void *]
[+0x004] PowerState : PowerDeviceUnspecified (0) [Type: _DEVICE_POWER_STATE]
[+0x008] DeviceNotifyHandler : 0x0 [Type: void (*)(void *,unsigned long)]
[+0x00c] HandlerContext : 0x0 [Type: void *]
[+0x010] PowerNode [Type: _ACPI_DEVICE_POWER_NODE * [4]]
[+0x020] PowerObject [Type: _NSObj * [5]]
[+0x034] WakeBit : 0x0 [Type: unsigned long]
[+0x038] DevicePowerMatrix [Type: _DEVICE_POWER_STATE [7]]
[+0x054] SystemWakeLevel : PowerSystemUnspecified (0) [Type: _SYSTEM_POWER_STATE]


//
// Now that we have built the matrix, we can figure out what D-level the
// device can support wake with.
//
powerInfo->DeviceWakeLevel =
powerInfo->DevicePowerMatrix[powerInfo->SystemWakeLevel];

1: kd> dx -id 0,0,899a2278 -r1 (*((ACPI!_DEVICE_POWER_STATE (*)[7])0x899c0b50))
(*((ACPI!_DEVICE_POWER_STATE (*)[7])0x899c0b50)) [Type: _DEVICE_POWER_STATE [7]]
[0] : PowerDeviceUnspecified (0) [Type: _DEVICE_POWER_STATE]
[1] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[2] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[3] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[4] : PowerDeviceD0 (1) [Type: _DEVICE_POWER_STATE]
[5] : PowerDeviceD3 (4) [Type: _DEVICE_POWER_STATE]
[6] : PowerDeviceD3 (4) [Type: _DEVICE_POWER_STATE]


typedef enum _SYSTEM_POWER_STATE {
PowerSystemUnspecified = 0,
PowerSystemWorking = 1,
PowerSystemSleeping1 = 2, 2
PowerSystemSleeping2 = 3, 3
PowerSystemSleeping3 = 4, 4
PowerSystemHibernate = 5, 5
PowerSystemShutdown = 6,
PowerSystemMaximum = 7
} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;

外循环循环4次,内循环循环3次,共循环12次。

typedef enum _DEVICE_POWER_STATE {
PowerDeviceUnspecified = 0,
PowerDeviceD0, 1
PowerDeviceD1, 2
PowerDeviceD2, 3
PowerDeviceD3,
PowerDeviceMaximum
} DEVICE_POWER_STATE, *PDEVICE_POWER_STATE;

for ( ; matrixIndex <= PowerSystemHibernate ; matrixIndex++ ) {

//
// Loop on all members of the PowerNode
//
for (i = PowerDeviceD0; i <= PowerDeviceD2; i++ ) {

//
// Are there any resources to look at?
//
deviceNode = powerInfo->PowerNode[i];
if (deviceNode == NULL) {

continue;

}

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

MariaDB 备份与恢复完整指南

文章目录 MariaDB 备份与恢复完整指南 一、环境准备与测试数据创建 1. 检查 MariaDB 状态 2. 创建测试数据库和数据 二、使用 mysqldump 进行逻辑备份 1. 基本备份命令 2. 高级备份选项 3. 自动备份脚本 三、使用 mariadb-backup 进行物理备份 1. 安装 mariadb-backup 2. 完整备…

作者头像 李华
网站建设 2026/4/29 19:00:32

【AI大模型】如何真正“不花一分钱”部署一个属于你的大模型

看了那么多chatGPT的文章&#xff0c;作为一名不精通算法的开发&#xff0c;也对大模型心痒痒。但想要部署自己的大模型&#xff0c;且不说没有算法相关的经验了&#xff0c;光是大模型占用的算力资源&#xff0c;手头的个人电脑其实也很难独立部署。就算使用算法压缩后的大模型…

作者头像 李华
网站建设 2026/4/27 11:24:59

工业设备智能运检监测管理系统方案

在工业企业的日常运营中&#xff0c;设备管理领域普遍遭遇着多重挑战&#xff1a;设备运维成本居高不下&#xff0c;安全隐患的防控工作困难重重&#xff0c;检修维护的效率难以提升&#xff0c;以及一旦发生事故&#xff0c;追溯原因的过程繁琐且复杂。尤为关键的是&#xff0…

作者头像 李华
网站建设 2026/4/28 13:33:40

开源知识库---MaxKB:一款基于 LLM 大语言模型的知识库问答系统

MaxKB 是一款基于 LLM 大语言模型的知识库问答系统。MaxKB Max Knowledge Base&#xff0c;旨在成为企业的最强大脑。 •开箱即用&#xff1a;支持直接上传文档、自动爬取在线文档&#xff0c;支持文本自动拆分、向量化&#xff0c;智能问答交互体验好&#xff1b;•无缝嵌入…

作者头像 李华
网站建设 2026/4/17 0:22:58

我越来越确定,未来最大的电商平台,一定是拼多多

我的创业故事&#xff1a;《87年出生&#xff0c;我开了家一人公司&#xff0c;年营收百万》 大家好&#xff0c;我是微笑哥。 兄弟们&#xff0c;我最近晚上睡不着&#xff0c;不是因为失恋&#xff0c;也不是因为房贷&#xff0c;而是因为一个念头在我脑子里反复横跳&#xf…

作者头像 李华
网站建设 2026/4/22 9:01:33

springboot智能社交网络平台系统设计实现

背景与意义 技术背景 Spring Boot作为Java生态中快速开发框架的代表&#xff0c;简化了传统Spring应用的配置和部署流程。其自动化配置、内嵌服务器和依赖管理特性&#xff0c;为社交网络平台的高并发、分布式架构提供了技术基础。微服务架构的普及使得Spring Boot成为构建模…

作者头像 李华