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/28 20:35:37

硬件学习笔记--95 RC充电时间计算及模型

1. 电路模型最基本的RC充电电路模型如下&#xff1a;一个直流电压源 V2一个阻值为 R1 的电阻&#xff08;限流/充电电阻&#xff09;一个初始未充电&#xff08;电压为0&#xff09;的电容 C1&#xff0c;与电阻串联。在时间 t0 时&#xff0c;开关S闭合&#xff0c;开始通过电…

作者头像 李华
网站建设 2026/4/24 20:50:01

微调大型语言模型:根据您的需求定制Llama 3 8B

自2022年11月发布以来&#xff0c;ChatGPT引发了关于大型语言模型&#xff08;LLMs&#xff09;和一般人工智能能力的广泛讨论。现在很少有人没听说过ChatGPT或尝试过它。尽管像GPT、Gemini或Claude这样的工具非常强大&#xff0c;拥有数百&#xff08;甚至数千&#xff09;亿的…

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

接受外包Offer前一定要清楚的4件事

这是十三月的第 20 篇原创笔记Hello 我是十三月。最近有一些刚毕业的小朋友私信我&#xff0c;说工作贼难找&#xff0c;能不能先去一个软件外包公司先苟着&#xff0c;之后的事情等行情好些了再说。去外包公司当然没什么不可以&#xff0c;成年人能基于实际做出判断和选择&…

作者头像 李华
网站建设 2026/4/29 5:24:29

大模型RAG | 进阶RAG-提升RAG效果

在本博客中&#xff0c;我将解决这些挑战&#xff0c;更重要的是&#xff0c;我们将深入研究提高RAG性能的解决方案&#xff0c;使其可用于生产环境。 图片来源&#xff1a;https://arxiv.org/pdf/2401.05856.pdf 我将讨论来自不同研究论文的各种优化技术。这些技术中的大多数…

作者头像 李华
网站建设 2026/4/18 21:25:34

计算机毕业设计之springboot基于springboot的医院后台管理系统

相比于以前的传统手工管理方式&#xff0c;智能化的管理方式可以大幅降低医院的运营人员成本&#xff0c;实现了医院后台的标准化、制度化、程序化的管理&#xff0c;有效地防止了医院后台的随意管理&#xff0c;提高了信息的处理速度和精确度&#xff0c;能够及时、准确地查询…

作者头像 李华
网站建设 2026/4/25 17:49:47

教育论文的“数据炼金术”:书匠策AI如何把数字变成学术黄金

在学术写作的江湖里&#xff0c;数据是论文的“血液”&#xff0c;但如何让冰冷的数据“开口说话”&#xff0c;却让无数研究者头疼。有人困在数据收集的“无米之炊”里&#xff0c;有人被SPSS的代码“加密语言”劝退&#xff0c;还有人对着满屏的数字发呆&#xff0c;不知如何…

作者头像 李华