news 2026/4/3 12:57:50

为了得到节点P2P0的Bus号需要先得到节点PCI0的_BBN=BaseBusNumber

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
为了得到节点P2P0的Bus号需要先得到节点PCI0的_BBN=BaseBusNumber

为了得到节点P2P0的Bus号需要先得到节点PCI0的_BBN=BaseBusNumber

1: kd> g
Breakpoint 65 hit
ACPI!DispatchCtxtQueue+0xaf:
f742042d 57 push edi
1: kd> g
Breakpoint 39 hit
ACPI!RunContext:
f741d710 55 push ebp
1: kd> kc
#
00 ACPI!RunContext
01 ACPI!DispatchCtxtQueue
02 ACPI!StartTimeSlicePassive
03 ACPI!ACPIWorker
04 nt!PspSystemThreadStartup
05 nt!KiThreadStartup
1: kd> dv
pctxt = 0x8985a000
pctxtSave = 0xf741d711
pkthSave = 0x00000008
rc = 0n-1987731456
1: kd> dx -r1 ((ACPI!_ctxt *)0x8985a000)
((ACPI!_ctxt *)0x8985a000) : 0x8985a000 [Type: _ctxt *]
[+0x000] dwSig : 0x54585443 [Type: unsigned long]
[+0x004] pbCtxtEnd : 0x8985c000 : 0x43 [Type: unsigned char *]
[+0x008] listCtxt [Type: _List]
[+0x010] listQueue [Type: _List]
[+0x018] pplistCtxtQueue : 0x0 [Type: _List * *]
[+0x01c] plistResources : 0x0 [Type: _List *]
[+0x020] dwfCtxt : 0x128 [Type: unsigned long]
[+0x024] pnsObj : 0x8996cdf0 [Type: _NSObj *]
[+0x028] pnsScope : 0x8996cdf0 [Type: _NSObj *]
[+0x02c] powner : 0x0 [Type: _objowner *]
[+0x030] pcall : 0x0 [Type: _call *]
[+0x034] pnctxt : 0x0 [Type: _nestedctxt *]
[+0x038] dwSyncLevel : 0x0 [Type: unsigned long]
[+0x03c] pbOp : 0x0 [Type: unsigned char *]
[+0x040] Result [Type: _ObjData]
[+0x054] pfnAsyncCallBack : 0xf7407364 [Type: void (__cdecl*)(_NSObj *,long,_ObjData *,void *)]
[+0x058] pdataCallBack : 0x898a829c [Type: _ObjData *]
[+0x05c] pvContext : 0x898a8270 [Type: void *]
[+0x060] Timer [Type: _KTIMER]
[+0x088] Dpc [Type: _KDPC]
[+0x0a8] pheapCurrent : 0x8985a0bc [Type: _heap *]
[+0x0ac] CtxtData [Type: _ctxtdata]
[+0x0bc] LocalHeap [Type: _heap]
1: kd> dx -r1 (*((ACPI!_heap *)0x8985a0bc))
(*((ACPI!_heap *)0x8985a0bc)) [Type: _heap]
[+0x000] dwSig : 0x50414548 [Type: unsigned long]
[+0x004] pbHeapEnd : 0x8985bfe4 : 0x50 [Type: unsigned char *]
[+0x008] pheapHead : 0x8985a0bc [Type: _heap *]
[+0x00c] pheapNext : 0x0 [Type: _heap *]
[+0x010] pbHeapTop : 0x8985a0d4 : 0x0 [Type: unsigned char *]
[+0x014] plistFreeHeap : 0x0 [Type: _List *]
[+0x018] Heap [Type: _heapobjhdr]
1: kd> dt framehdr 0x8985bfe4
ACPI!FRAMEHDR
+0x000 dwSig : 0x54534f50
+0x004 dwLen : 0x1c
+0x008 dwfFrame : 0
+0x00c pfnParse : 0xf741ef2b long ACPI!ProcessEvalObj+0
1: kd> g
Breakpoint 45 hit
ACPI!RunContext+0x11f:
f741d82f ff570c call dword ptr [edi+0Ch]
1: kd> g
Breakpoint 11 hit
ACPI!RunContext+0x142:
f741d852 e83bceffff call ACPI!AcquireMutex (f741a692)
1: kd> g
Breakpoint 54 hit
ACPI!RunContext+0x1f0:
f741d900 e8af1e0000 call ACPI!AsyncCallBack (f741f7b4)
1: kd> g
Breakpoint 63 hit
ACPI!GetPciAddressWorker:
f740ceea 55 push ebp
1: kd> kc
#
00 ACPI!GetPciAddressWorker
01 ACPI!ACPIGetWorkerForInteger
02 ACPI!AsyncCallBack
03 ACPI!RunContext
04 ACPI!DispatchCtxtQueue
05 ACPI!StartTimeSlicePassive
06 ACPI!ACPIWorker
07 nt!PspSystemThreadStartup
08 nt!KiThreadStartup
1: kd> dv
AcpiObject = 0x8996cdf0
Status = 0n0
Result = 0x00000000
Context = 0x898a8848
buffer = unsigned char [64] ""
1: kd> dt GET_ADDRESS_CONTEXT 0x898a8848
ACPI!GET_ADDRESS_CONTEXT
+0x000 PciObject : 0x8996cd78 _NSObj
+0x004 Bus : 0x899c146c ""
+0x008 Slot : 0x899c1470 _PCI_SLOT_NUMBER
+0x00c ParentBus : 0 ''
+0x010 ParentSlot : _PCI_SLOT_NUMBER
+0x014 Flags : 8 #define PCISUPP_CHECKED_ADR 8
+0x018 Address : 0x110000 得到了_ADR=0x110000
+0x01c BaseBusNumber : 0
+0x020 RunCompletion : 0n0
+0x024 CompletionRoutine : 0xf740ceea void ACPI!GetPciAddressWorker+0
+0x028 CompletionContext : 0x899c1460 Void
1: kd> dx -id 0,0,899a2278 -r1 ((ACPI!unsigned char *)0x899c146c)
((ACPI!unsigned char *)0x899c146c) : 0x899c146c : 0x0 [Type: unsigned char *]
0x0 [Type: unsigned char]
1: kd> dt _PCI_SLOT_NUMBER 0x899c1470 -r
hal!_PCI_SLOT_NUMBER
+0x000 u : __unnamed
+0x000 bits : __unnamed
+0x000 DeviceNumber : 0y00000 (0)
+0x000 FunctionNumber : 0y000
+0x000 Reserved : 0y000000000000000000000000 (0)
+0x000 AsULONG : 0


#define PCISUPP_CHECKED_ADR 8

Device (P2P0)
{
Name (_ADR, 0x00110000) // _ADR: Address

Device (PE40)
{
Name (_ADR, 0x00150000) // _ADR: Address


//
// First, determine the slot number.
//
if (!(state->Flags & PCISUPP_CHECKED_ADR)) { //已经得到了PCISUPP_CHECKED_ADR

//
// Get the _ADR.
//
state->Flags |= PCISUPP_CHECKED_ADR;
status = ACPIGetNSAddressAsync(
state->PciObject,
GetPciAddressWorker,
(PVOID)state,
&(state->Address),
NULL
);

if (status == STATUS_PENDING) {
return status;
}

if (!NT_SUCCESS(status)) {
goto GetPciAddressWorkerExit;
}
}

if (!(state->Flags & PCISUPP_GOT_SLOT_INFO)) {

//
// Build a PCI_SLOT_NUMBER out of the integer returned
// from the interpretter.
//
state->Slot->u.bits.FunctionNumber = (state->Address) & 0x7;
state->Slot->u.bits.DeviceNumber = ( (state->Address) >> 16) & 0x1f;
state->Flags |= PCISUPP_GOT_SLOT_INFO;

}

1: kd> dt _PCI_SLOT_NUMBER 0x899c1470 -r
hal!_PCI_SLOT_NUMBER
+0x000 u : __unnamed
+0x000 bits : __unnamed
+0x000 DeviceNumber : 0y10001 (0x11)
+0x000 FunctionNumber : 0y000
+0x000 Reserved : 0y000000000000000000000000 (0)
+0x000 AsULONG : 0x11


1: kd> dt GET_ADDRESS_CONTEXT 0x898a8848
ACPI!GET_ADDRESS_CONTEXT
+0x000 PciObject : 0x8996cd78 _NSObj
+0x004 Bus : 0x899c146c ""
+0x008 Slot : 0x899c1470 _PCI_SLOT_NUMBER
+0x00c ParentBus : 0 ''
+0x010 ParentSlot : _PCI_SLOT_NUMBER
+0x014 Flags : 0x108 #define PCISUPP_GOT_SLOT_INFO 0x100
+0x018 Address : 0x110000
+0x01c BaseBusNumber : 0
+0x020 RunCompletion : 0n1
+0x024 CompletionRoutine : 0xf740ceea void ACPI!GetPciAddressWorker+0
+0x028 CompletionContext : 0x899c1460 Void


//
// Next, get the bus number, if possible.
//
*state->Bus = 0; // default value, in case we have to guess

//
// Check first to see if this bus has a _HID.
// (It might be a root PCI bridge.)
//
bus = state->PciObject;
tempObj = ACPIAmliGetNamedChild(bus, PACKED_HID);
if (!tempObj) {

//
// This device had no _HID. So look up
// to the parent and see if it is a
// root PCI bridge.
//
bus = state->PciObject->pnsParent; 0x899affac
tempObj = ACPIAmliGetNamedChild(bus, PACKED_HID); 关键地方:eax=899b0024
1: kd> p
eax=899b0024 ebx=899affac ecx=4449485f edx=00000011 esi=898a8848 edi=00000103
eip=f740cfc7 esp=f791ac60 ebp=f791acb0 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!GetPciAddressWorker+0xdd:
f740cfc7 85c0 test eax,eax


}


1: kd> db 899b0024
899b0024 64 a0 91 89 68 00 9b 89-ac ff 9a 89 00 00 00 00 d...h...........
899b0034 5f 48 49 44 30 f3 9a 89-ac ff 9a 89 00 00 01 00 _HID0...........

1: kd> dt nsobj 899b0024
ACPI!NSOBJ
+0x000 list : _List
+0x008 pnsParent : 0x899affac _NSObj
+0x00c pnsFirstChild : (null)
+0x010 dwNameSeg : 0x4449485f
+0x014 hOwner : 0x899af330 Void
+0x018 pnsOwnedNext : 0x899affac _NSObj
+0x01c ObjData : _ObjData
+0x030 Context : (null)
+0x034 dwRefCount : 0
1: kd> db 0x899affac
899affac 4c ff 9a 89 ac 40 9b 89-f0 f0 9a 89 24 00 9b 89 L....@......$...
899affbc 50 43 49 30 30 f3 9a 89-4c ff 9a 89 00 00 06 00 PCI00...L.......


//
// Is there a _BBN to run? 有的。
//
tempObj = ACPIAmliGetNamedChild(bus, PACKED_BBN); eax=899b00ac

1: kd> p
eax=899b00ac ebx=899affac ecx=4e42425f edx=00000011 esi=898a8848 edi=00000103
eip=f740d041 esp=f791ac60 ebp=f791acb0 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!GetPciAddressWorker+0x157:
f740d041 85c0 test eax,eax
1: kd> db 899b00ac
899b00ac 68 00 9b 89 f0 00 9b 89-ac ff 9a 89 00 00 00 00 h...............
899b00bc 5f 42 42 4e 30 f3 9a 89-68 00 9b 89 00 00 01 00 _BBN0...h.......

if (tempObj) {

//
// This device must be the child of a root PCI bus. 关键断言。
//P2P0是the child of a root PCI bus.
if (!(state->Flags & PCISUPP_CHECKED_BBN)) {

state->Flags |= PCISUPP_CHECKED_BBN;
status = ACPIGetNSIntegerAsync(
bus,
PACKED_BBN,
GetPciAddressWorker,
(PVOID)state,
&(state->BaseBusNumber),
NULL
);
#define PCISUPP_CHECKED_BBN 0x2000


1: kd> dt GET_ADDRESS_CONTEXT 0x898a8848
ACPI!GET_ADDRESS_CONTEXT
+0x000 PciObject : 0x8996cd78 _NSObj
+0x004 Bus : 0x899c146c ""
+0x008 Slot : 0x899c1470 _PCI_SLOT_NUMBER
+0x00c ParentBus : 0 ''
+0x010 ParentSlot : _PCI_SLOT_NUMBER
+0x014 Flags : 0x2108
+0x018 Address : 0x110000
+0x01c BaseBusNumber : 0
+0x020 RunCompletion : 0n1
+0x024 CompletionRoutine : 0xf740ceea void ACPI!GetPciAddressWorker+0
+0x028 CompletionContext : 0x899c1460 Void


1: kd> t
Breakpoint 71 hit
eax=00000000 ebx=899affac ecx=898a8864 edx=00000011 esi=898a8848 edi=00000103
eip=f74076b8 esp=f791ac38 ebp=f791acb0 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!ACPIGet:
f74076b8 55 push ebp
1: kd> kc
#
00 ACPI!ACPIGet
01 ACPI!GetPciAddressWorker
02 ACPI!ACPIGetWorkerForInteger
03 ACPI!AsyncCallBack
04 ACPI!RunContext
05 ACPI!DispatchCtxtQueue
06 ACPI!StartTimeSlicePassive
07 ACPI!ACPIWorker
08 nt!PspSystemThreadStartup
09 nt!KiThreadStartup
1: kd> dv
Target = 0x899affac
ObjectID = 0x4e42425f

1: kd> db 0x899affac
899affac 4c ff 9a 89 ac 40 9b 89-f0 f0 9a 89 24 00 9b 89 L....@......$...
899affbc 50 43 49 30 30 f3 9a 89-4c ff 9a 89 00 00 06 00 PCI00...L.......

1: kd> r
eax=00000000 ebx=899affac ecx=898a8864 edx=00000011 esi=898a8848 edi=00000103
eip=f74076b8 esp=f791ac38 ebp=f791acb0 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!ACPIGet:
f74076b8 55 push ebp
1: kd> db f791ac38
f791ac38 75 d0 40 f7 ac ff 9a 89-5f 42 42 4e 02 00 04 48 u.@....._BBN...H

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

base-url填写错误怎么办?Open-AutoGLM连接问题解析

base-url填写错误怎么办?Open-AutoGLM连接问题解析 你兴冲冲地克隆了 Open-AutoGLM 仓库,装好了 ADB,连上了手机,也把大模型服务跑起来了——可一执行 python main.py,终端却弹出一串报错:ConnectionError…

作者头像 李华
网站建设 2026/3/27 15:38:54

elastix:重新定义医疗图像配准的开源解决方案

elastix:重新定义医疗图像配准的开源解决方案 【免费下载链接】elastix Official elastix repository 项目地址: https://gitcode.com/gh_mirrors/el/elastix 如何解决CT与MRI图像的精准对齐难题?如何在肿瘤放疗规划中实现多模态影像的无缝融合&a…

作者头像 李华
网站建设 2026/3/28 17:19:19

【指南】Qwen3-30B-A3B训练数据工程:从格式标准化到质量提升

【指南】Qwen3-30B-A3B训练数据工程:从格式标准化到质量提升 【免费下载链接】Qwen3-30B-A3B Qwen3-30B-A3B具有以下特点: 类型:因果语言模型 训练阶段:预训练和后训练 参数数量:总计 305 亿,其中已激活 33…

作者头像 李华
网站建设 2026/3/24 22:12:35

实测YOLOv13n.pt下载速度,内置镜像源提速90%

实测YOLOv13n.pt下载速度,内置镜像源提速90% 在目标检测项目启动的前五分钟,你是否经历过这样的场景:敲下 model YOLO("yolov13n.pt"),终端却卡在 [>................] 5.2% 长达数分钟?进度条纹丝不动…

作者头像 李华
网站建设 2026/3/31 15:28:20

突破设备限制:全平台游戏串流开源方案详解

突破设备限制:全平台游戏串流开源方案详解 【免费下载链接】Sunshine Sunshine: Sunshine是一个自托管的游戏流媒体服务器,支持通过Moonlight在各种设备上进行低延迟的游戏串流。 项目地址: https://gitcode.com/GitHub_Trending/su/Sunshine 游戏…

作者头像 李华