当前位置: 首页 > news >正文

ACPI!ACPIBuildProcessGenericList函数中2次InterlockedCompareExchange函数作用是标记为WORK_DONE_PENDING下次直接略过

ACPI!ACPIBuildProcessGenericList函数中2次InterlockedCompareExchange函数作用是标记为WORK_DONE_PENDING下次直接略过


//
// Check to see if we have any work to do on the request
//
workDone = InterlockedCompareExchange(
&(buildRequest->WorkDone),
WORK_DONE_PENDING,
WORK_DONE_PENDING
);

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

//
// Just to help us along, if we are going to the failure
// path, then we should not update the Current Work Done field.
// This gives us an easy means of find which step failed
//
if (workDone != WORK_DONE_FAILURE) {

//
// Mark the node as being in the state 'workDone'
//
buildRequest->CurrentWorkDone = workDone;

}

//
// Mark the request as pending
//
workDone = InterlockedCompareExchange(
&(buildRequest->WorkDone),
WORK_DONE_PENDING,
workDone
);

//
// Call the function
//
status = (buildFunction)( buildRequest );

1: kd> bp ACPI!ACPIBuildDeviceDpc
1: kd> g
Breakpoint 34 hit
eax=00000000 ebx=f7737120 ecx=f7737988 edx=f7737980 esi=f73fc5b2 edi=f7737980
eip=f73fc5b2 esp=f78aefa0 ebp=f78aeff4 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!ACPIBuildDeviceDpc:
f73fc5b2 53 push ebx
1: kd> kc
#
00 ACPI!ACPIBuildDeviceDpc
01 nt!KiRetireDpcList
02 nt!KiDispatchInterrupt
WARNING: Frame IP not in any known module. Following frames may be wrong.
03 0x0
1: kd> dv
Dpc = 0x00000000
DpcContext = 0x00000000
SystemArgument1 = 0x00000000
SystemArgument2 = 0x804ee186


1: kd> x acpi!AcpiBuildQueueList
f743b890 ACPI!AcpiBuildQueueList = struct _LIST_ENTRY [ 0xf743b890 - 0xf743b890 ]
1: kd> dx -r1 (*((ACPI!_LIST_ENTRY *)0xf743b890))
(*((ACPI!_LIST_ENTRY *)0xf743b890)) [Type: _LIST_ENTRY]
[+0x000] Flink : 0xf743b890 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0xf743b890 [Type: _LIST_ENTRY *]


1: kd> x acpi!AcpiBuildRunMethodList
f743b870 ACPI!AcpiBuildRunMethodList = struct _LIST_ENTRY [ 0x89d39ac0 - 0x89d39840 ]


1: kd> g
Breakpoint 35 hit
eax=f743b870 ebx=80afae90 ecx=f743b898 edx=f7737980 esi=f743b898 edi=f7737980
eip=f73fb8c4 esp=f78aef88 ebp=f78aeff4 iopl=0 nv up ei ng nz na pe cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000287
ACPI!ACPIBuildProcessGenericList:
f73fb8c4 55 push ebp
1: kd> kc
#
00 ACPI!ACPIBuildProcessGenericList
01 ACPI!ACPIBuildDeviceDpc
02 nt!KiRetireDpcList
03 nt!KiDispatchInterrupt
WARNING: Frame IP not in any known module. Following frames may be wrong.
04 0x0
1: kd> dv
ListEntry = 0xf743b870 [ 0x89d39ac0 - 0x89d39840 ]
DispatchTable = 0xf74380e8
tempEntry = 0xf73fb8c5 [ 0xec83ec8b - 0x84d8b0c ]
allWorkComplete = 0x00 ''
buildFunction = 0x00000000

1: kd> dv
ListEntry = 0xf743b870 [ 0x89d39ac0 - 0x89d39840 ]
DispatchTable = 0xf74380e8
tempEntry = 0xf73fb8c5 [ 0xec83ec8b - 0x84d8b0c ]
allWorkComplete = 0x00 ''
buildFunction = 0x00000000
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0xf743b870)
((ACPI!_LIST_ENTRY *)0xf743b870) : 0xf743b870 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39ac0 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39840 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39ac0)
((ACPI!_LIST_ENTRY *)0x89d39ac0) : 0x89d39ac0 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39a70 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0xf743b870 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39a70)
((ACPI!_LIST_ENTRY *)0x89d39a70) : 0x89d39a70 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d399d0 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39ac0 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d399d0)
((ACPI!_LIST_ENTRY *)0x89d399d0) : 0x89d399d0 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39980 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39a70 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39980)
((ACPI!_LIST_ENTRY *)0x89d39980) : 0x89d39980 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39930 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d399d0 [Type: _LIST_ENTRY *]

1: kd> dt ACPI_BUILD_REQUEST 0x89d39ac0
+0x000 ListEntry : _LIST_ENTRY [ 0x89d39a70 - 0xf743b870 ]
+0x008 Signature : 0x5f534750
+0x00c Flags : 0xc
+0x00c UFlags : __unnamed
+0x010 WorkDone : 1
+0x014 CurrentWorkDone : 3
+0x018 NextWorkDone : 4
+0x01c BuildContext : 0x89df4288 Void
+0x020 Status : 0n0
+0x024 CurrentObject : (null)
+0x028 CallBack : (null)
+0x02c CallBackContext : (null)
+0x030 DeviceRequest : __unnamed
+0x030 RunRequest : __unnamed
+0x030 SynchronizeRequest : __unnamed
+0x044 Integer : 0
+0x044 String : (null)
+0x044 TargetListEntry : (null)
1: kd> dt ACPI_BUILD_REQUEST 0x89d39a70
+0x000 ListEntry : _LIST_ENTRY [ 0x89d399d0 - 0x89d39ac0 ]
+0x008 Signature : 0x5f534750
+0x00c Flags : 0xc
+0x00c UFlags : __unnamed
+0x010 WorkDone : 1
+0x014 CurrentWorkDone : 3
+0x018 NextWorkDone : 4
+0x01c BuildContext : 0x89da2008 Void
+0x020 Status : 0n0
+0x024 CurrentObject : (null)
+0x028 CallBack : (null)
+0x02c CallBackContext : (null)
+0x030 DeviceRequest : __unnamed
+0x030 RunRequest : __unnamed
+0x030 SynchronizeRequest : __unnamed
+0x044 Integer : 0
+0x044 String : (null)
+0x044 TargetListEntry : (null)
1: kd> dt ACPI_BUILD_REQUEST 0x89d399d0
+0x000 ListEntry : _LIST_ENTRY [ 0x89d39980 - 0x89d39a70 ]
+0x008 Signature : 0x5f534750
+0x00c Flags : 0xc
+0x00c UFlags : __unnamed
+0x010 WorkDone : 1
+0x014 CurrentWorkDone : 3
+0x018 NextWorkDone : 4
+0x01c BuildContext : 0x89da2c40 Void
+0x020 Status : 0n0
+0x024 CurrentObject : (null)
+0x028 CallBack : (null)
+0x02c CallBackContext : (null)
+0x030 DeviceRequest : __unnamed
+0x030 RunRequest : __unnamed
+0x030 SynchronizeRequest : __unnamed
+0x044 Integer : 0
+0x044 String : (null)
+0x044 TargetListEntry : (null)


1: kd> dt ACPI_BUILD_REQUEST 0x89d39980
+0x000 ListEntry : _LIST_ENTRY [ 0x89d39930 - 0x89d399d0 ]
+0x008 Signature : 0x5f534750
+0x00c Flags : 0xc
+0x00c UFlags : __unnamed
+0x010 WorkDone : 1
+0x014 CurrentWorkDone : 5
+0x018 NextWorkDone : 2
+0x01c BuildContext : 0x89dea908 Void
+0x020 Status : 0n0
+0x024 CurrentObject : (null)
+0x028 CallBack : (null)
+0x02c CallBackContext : (null)
+0x030 DeviceRequest : __unnamed
+0x030 RunRequest : __unnamed
+0x030 SynchronizeRequest : __unnamed
+0x044 Integer : 0xf
+0x044 String : 0x0000000f "--- memory read error at address 0x0000000f ---"
+0x044 TargetListEntry : 0x0000000f _LIST_ENTRY


1: kd> dx -r1 (*((ACPI!_LIST_ENTRY *)0xf743b870))
(*((ACPI!_LIST_ENTRY *)0xf743b870)) [Type: _LIST_ENTRY]
[+0x000] Flink : 0x89d39ac0 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39840 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39ac0)
((ACPI!_LIST_ENTRY *)0x89d39ac0) : 0x89d39ac0 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39a70 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0xf743b870 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39a70)
((ACPI!_LIST_ENTRY *)0x89d39a70) : 0x89d39a70 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d399d0 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39ac0 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d399d0)
((ACPI!_LIST_ENTRY *)0x89d399d0) : 0x89d399d0 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39930 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39a70 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39930)
((ACPI!_LIST_ENTRY *)0x89d39930) : 0x89d39930 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d398e0 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d399d0 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d398e0)
((ACPI!_LIST_ENTRY *)0x89d398e0) : 0x89d398e0 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d39890 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d39930 [Type: _LIST_ENTRY *]
1: kd> dx -r1 ((ACPI!_LIST_ENTRY *)0x89d39890)
((ACPI!_LIST_ENTRY *)0x89d39890) : 0x89d39890 [Type: _LIST_ENTRY *]
[+0x000] Flink : 0x89d396b0 [Type: _LIST_ENTRY *]
[+0x004] Blink : 0x89d398e0 [Type: _LIST_ENTRY *]


1: kd> g
Breakpoint 37 hit
eax=00000001 ebx=89d39940 ecx=00000000 edx=00000001 esi=89d398e0 edi=80b019f4
eip=f73fb8e1 esp=f78aef6c ebp=f78aef84 iopl=0 nv up ei ng nz na po cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000283
ACPI!ACPIBuildProcessGenericList+0x1d:
f73fb8e1 8b06 mov eax,dword ptr [esi] ds:0023:89d398e0=89d39890
1: kd> dt ACPI_BUILD_REQUEST 89d398e0
+0x000 ListEntry : _LIST_ENTRY [ 0x89d39890 - 0x89d39930 ]
+0x008 Signature : 0x5f534750
+0x00c Flags : 0xc
+0x00c UFlags : __unnamed
+0x010 WorkDone : 4
+0x014 CurrentWorkDone : 3
+0x018 NextWorkDone : 2
+0x01c BuildContext : 0x89d41a28 Void
+0x020 Status : 0n0
+0x024 CurrentObject : (null)
+0x028 CallBack : (null)
+0x02c CallBackContext : (null)
+0x030 DeviceRequest : __unnamed
+0x030 RunRequest : __unnamed
+0x030 SynchronizeRequest : __unnamed
+0x044 Integer : 0
+0x044 String : (null)
+0x044 TargetListEntry : (null)


ACPI_BUILD_REQUEST结构中的WorkDone什么时候变成4的?

VOID EXPORT
ACPIBuildCompleteMustSucceed(
IN PNSOBJ AcpiObject,
IN NTSTATUS Status,
IN POBJDATA ObjectData,
IN PVOID Context
)
/*++

Routine Description:

This is a generic completion handler. If the interperter has successfully
execute the method, it completes the request to the next desired WORK_DONE,
otherwise, it fails the request

Arguments:

AcpiObject - Points to the control that was run
Status - Result of the method
ObjectData - Information about the result
Context - PACPI_BUILD_REQUEST

Return Value:

VOID

--*/
{
PACPI_BUILD_REQUEST buildRequest = (PACPI_BUILD_REQUEST) Context;
ULONG nextWorkDone = buildRequest->NextWorkDone;

//
// Device what state we should transition to next
//
if (!NT_SUCCESS(Status)) {

//
// Remember why we failed, and mark the request as being failed
//
buildRequest->Status = Status;

//
// Death
//
KeBugCheckEx(
ACPI_BIOS_ERROR,
ACPI_FAILED_MUST_SUCCEED_METHOD,
(ULONG_PTR) AcpiObject,
Status,
(AcpiObject ? AcpiObject->dwNameSeg : 0)
);

} else {

//
// Note: we don't have a race condition here because only one
// routine can be processing a request at any given time. Thus it
// is safe for us to specify a new next phase
//
buildRequest->NextWorkDone = WORK_DONE_FAILURE;

//
// Transition to the next stage
//
ACPIBuildCompleteCommon(
&(buildRequest->WorkDone),
nextWorkDone
);

}

}


VOID
ACPIBuildCompleteCommon(
IN PULONG OldWorkDone,
IN ULONG NewWorkDone
)
/*++

Routine Description:

Since the completion routines all have to do some bit of common work to
get the DPC firing again, this routine reduces the code duplication

Arguments:

OldWorkDone - Pointer to the old amount of work done
NewWorkDone - The new amount of work that has been completed

NOTENOTE: There is an implicit assumption that the current value of
WorkDone in the request is WORK_DONE_PENDING. If that is
not the case, we will fail to transition to the next stage,
which means that we will loop forever.

Return Value:

None

--*/
{
KIRQL oldIrql;

//
// Update the state of the request
//
InterlockedCompareExchange( OldWorkDone, NewWorkDone,WORK_DONE_PENDING);//这个时候buildRequest->WorkDone变成了4

http://www.jsqmd.com/news/262451/

相关文章:

  • 告别查重焦虑!虎贲等考 AI 降重降 AIGC:一次操作双重达标,论文合规不丢质
  • 2026学历提升攻略:口碑学校引领未来方向,国家开放大学招生/自考培训/学历提升/专升本报名,学历提升机构口碑推荐榜 - 品牌推荐师
  • 从Demo到上线:IndexTTS-2-LLM企业级部署步骤详解
  • 2026年市面上有名的河道护坡石笼网公司有哪些,柔韧抗压石笼网/镀锌低碳钢丝石笼网,河道护坡石笼网供应商口碑推荐 - 品牌推荐师
  • 课程论文不用熬大夜!虎贲等考 AI:一键解锁从选题到定稿的高效通关术
  • DeepSeek-R1-Distill-Qwen-1.5B应用实战:智能写作助手开发
  • 塑料管道制造商怎么选,四川都得利管业性价比高吗? - 工业品牌热点
  • 2026年学历提升评测:如何选择口碑好的学校?自考培训/国家开放大学招生/学历提升/专升本报名,学历提升机构推荐 - 品牌推荐师
  • 年终盘点:2025年频谱仪品牌口碑榜,谁主沉浮?光通信测量仪表/通信干扰模拟器/光时域反射仪/电子对抗设备/以太网测试仪频谱仪公司找哪家 - 品牌推荐师
  • 也许是一篇鲜花
  • 2025年本地市场信赖的贯入式砂浆检测仪供应商排行,钢砧/数显砂浆回弹仪/数显高强回弹仪/钢筋锈蚀仪/微型十字板仪检测仪公司推荐排行 - 品牌推荐师
  • 微软出品果然稳!VibeVoice语音合成真实测评
  • 详细介绍:Bridge – Creative Elementor and WooCommerce WordPress Theme
  • Qwen2.5-0.5B实战:智能旅游推荐系统实现
  • 2026年保健食品集合店供应链优选,品质有保障!进口热销品集合店/保健食品加盟,保健食品集合店批发口碑排行 - 品牌推荐师
  • 明天发布,荣耀Magic8 RSR真机已到门店,配置参数提前公布
  • 告别数据分析 “劝退” 难题!虎贲等考 AI 让科研小白秒变数据大神
  • 展馆装修选哪家?2026年热门口碑公司揭晓,会展/展会布置/展位设计/展厅制作/展览/展会搭建,展馆装修企业有哪些 - 品牌推荐师
  • 荣耀笔记本哪个系列最好最省电?选购指南与特色评测
  • 嵇康《與山巨源絕交書》:仲尼兼愛,不羞執鞭
  • 从0开始学语音情感分析,这个镜像让我少走很多弯路
  • AtCoder Beginner Contest竞赛题解 | AtCoder Beginner Contest 436
  • 10338_基于SSM的在线小说阅读网站
  • AI 写论文哪个软件最好?实测虎贲等考 AI:毕业论文通关的效率神器
  • 计算机毕业设计hadoop+spark+hive美食推荐系统 美食可视化 大数据毕业设计(源码+文档+PPT+讲解)
  • 救命神器9个AI论文平台,专科生毕业论文轻松搞定!
  • Python+vue3+django地铁站点管理系统 地铁线路推荐系统
  • Python+vue3+django个人健康管理系统的设计与实现
  • 韓愈《原道》:“博愛之謂仁”
  • 新时代轨道交通的发展趋势、挑战与战略路径