news 2026/6/10 2:36:28

ACPI!GetPciAddressWorker函数中的hal!HalGetBusDataByOffset参数是父总线号和父插槽号--重要

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!GetPciAddressWorker函数中的hal!HalGetBusDataByOffset参数是父总线号和父插槽号--重要

ACPI!GetPciAddressWorker函数中的hal!HalGetBusDataByOffset参数是父总线号和父插槽号

第0部分:

//
// Read the config space for this device.
//
bytesRead = HalGetBusDataByOffset(PCIConfiguration,
state->ParentBus,父总线
state->ParentSlot.u.AsULONG,父插槽
buffer,
0,
PCI_COMMON_HDR_LENGTH);

第一部分:


关键断点:
bp ACPI!GetPciAddressWorker+0x127
bp ACPI!GetPciAddressWorker+0x12d
关键断点:

第二部分:

1: kd> g
| | | | | | | AsyncCallBack(pctxt=895c6000,rc=0,Obj=\_SB.PCI0._BBN,pdataCallBack=8996826c,pvContext=89968240)
AMLI:| | | | | | | | AMLIFreeDataBuffs(pdata=8996826c,icData=1)
AMLI:| | | | | | | | | FreeDataBuffs(adata=8996826c,icData=1)
AMLI:| | | | | | | | | FreeDataBuff!
AMLI:| | | | | | | | AMLIFreeDataBuffs!
Breakpoint 6 hit
eax=00000000 ebx=00000000 ecx=8996cd78 edx=00000013 esi=895901f8 edi=00000103
eip=804f25ee esp=f791abdc ebp=f791ac48 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
hal!HalGetBusDataByOffset:
804f25ee 55 push ebp
1: kd> kc
#
00 hal!HalGetBusDataByOffset
01 ACPI!GetPciAddressWorker
02 ACPI!GetPciAddressWorker
03 ACPI!ACPIGetWorkerForInteger
04 ACPI!AsyncCallBack
05 ACPI!RunContext
06 ACPI!DispatchCtxtQueue
07 ACPI!StartTimeSlicePassive
08 ACPI!ACPIWorker
09 nt!PspSystemThreadStartup
0a nt!KiThreadStartup

1: kd> dv
BusDataType = PCIConfiguration (0n4)
BusNumber = 0
SlotNumber = 0x11
Buffer = 0xf791ac04
Offset = 0
Length = 0x40
bus = struct _BUS_HANDLER

1: kd> gu

*** ISR at f7409b10 took over .5 second
eax=00000040 ebx=00000000 ecx=00000000 edx=00000000 esi=895901f8 edi=00000103
eip=f740d017 esp=f791abf8 ebp=f791ac48 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+0x12d:
f740d017 85c0 test eax,eax
1: kd> p
eax=00000040 ebx=00000000 ecx=00000000 edx=00000000 esi=895901f8 edi=00000103
eip=f740d019 esp=f791abf8 ebp=f791ac48 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
ACPI!GetPciAddressWorker+0x12f:
f740d019 0f84a1000000 je ACPI!GetPciAddressWorker+0x1d6 (f740d0c0) [br=0]


1: kd> dt acpi!pci_common_config 0xf791ac04
+0x000 VendorID : 0x15ad
+0x002 DeviceID : 0x790
+0x004 Command : 7
+0x006 Status : 0x290
+0x008 RevisionID : 0x2 ''
+0x009 ProgIf : 0x1 ''
+0x00a SubClass : 0x4 ''
+0x00b BaseClass : 0x6 ''
+0x00c CacheLineSize : 0x8 ''
+0x00d LatencyTimer : 0x40 '@'
+0x00e HeaderType : 0x1 ''关键数据:PCI_BRIDGE_TYPE 是PCI桥!!!
+0x00f BIST : 0 ''
+0x010 u : __unnamed
+0x040 DeviceSpecific : [192] "RE???"

pciConfig = (PPCI_COMMON_CONFIG)buffer;

if (pciConfig->HeaderType != PCI_BRIDGE_TYPE) {


#define PCI_BRIDGE_TYPE 0x01
#define PCI_CARDBUS_BRIDGE_TYPE 0x02


+0x000 type1 : _PCI_HEADER_TYPE_1
+0x000 BaseAddresses : [2] 0
+0x008 PrimaryBus : 0 '' +0x008 PrimaryBus : 0
+0x009 SecondaryBus : 0x2 '' +0x009 SecondaryBus : 0x2 ''
+0x00a SubordinateBus : 0x2 '' +0x00a SubordinateBus : 0x2 ''

+0x00b SecondaryLatency : 0x44 'D'
+0x00c IOBase : 0xf0 ''
+0x00d IOLimit : 0 ''
+0x00e SecondaryStatus : 0x280
+0x010 MemoryBase : 0xfff0
+0x012 MemoryLimit : 0
+0x014 PrefetchBase : 0xfff1
+0x016 PrefetchLimit : 1
+0x018 PrefetchBaseUpper32 : 0
+0x01c PrefetchLimitUpper32 : 0
+0x020 IOBaseUpper16 : 0
+0x022 IOLimitUpper16 : 0
+0x024 CapabilitiesPtr : 0x40 '@'
+0x025 Reserved1 : [3] ""
+0x028 ROMBaseAddress : 0
+0x02c InterruptLine : 0xff ''
+0x02d InterruptPin : 0 ''
+0x02e BridgeControl : 4

F:\srv03rtm>grep "u.type1.SecondaryBus" -nr F:\srv03rtm\base\busdrv\acpi |grep -v "inary"
F:\srv03rtm\base\busdrv\acpi/driver/nt/pciopregion.c:317: if (pciData.u.type1.SecondaryBus != 0) {
F:\srv03rtm\base\busdrv\acpi/driver/nt/pciopregion.c:323: HalSetMaxLegacyPciBusNumber(pciData.u.type1.SecondaryBus);
F:\srv03rtm\base\busdrv\acpi/driver/nt/pciopregion.c:1135: *state->Bus = pciConfig->u.type1.SecondaryBus;


//
// Success. Record the actual bus number of
// the secondary PCI bus and exit.
// 成功,记录真正的总线号。
*state->Bus = pciConfig->u.type1.SecondaryBus;

status = STATUS_SUCCESS;
goto GetPciAddressWorkerExit; 不会运行下面的// Is there a _BBN to run?

}

//
// Is there a _BBN to run?
//
tempObj = ACPIAmliGetNamedChild(bus, PACKED_BBN);
if (tempObj) {


1: kd> p
eax=00000040 ebx=00000000 ecx=00000000 edx=00000000 esi=895901f8 edi=00000103
eip=f740d029 esp=f791abf8 ebp=f791ac48 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+0x13f:
f740d029 8b4604 mov eax,dword ptr [esi+4] ds:0023:895901fc=89986fc0
1: kd> p
eax=89986fc0 ebx=00000000 ecx=00000000 edx=00000000 esi=895901f8 edi=00000103
eip=f740d02c esp=f791abf8 ebp=f791ac48 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+0x142:
f740d02c 8a4dd5 mov cl,byte ptr [ebp-2Bh] ss:0010:f791ac1d=02
1: kd> p
eax=89986fc0 ebx=00000000 ecx=00000002 edx=00000000 esi=895901f8 edi=00000103
eip=f740d02f esp=f791abf8 ebp=f791ac48 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+0x145:
f740d02f 8808 mov byte ptr [eax],cl ds:0023:89986fc0=00
1: kd> dd 89986fc0
89986fc0 00000000 00000000 00000000 00000000
89986fd0 00000000 00000000 00000000 00000000
89986fe0 00000000 00000000 00000000 00000000
89986ff0 00000000 8996e010 00000000 00000000
89987000 0a690000 20707249 03400006 00000000
89987010 00000000 00000000 89987018 89987018
89987020 00000000 00000000 15140000 00000000
89987030 00000000 00000000 00000000 00000000
1: kd> dt GET_ADDRESS_CONTEXT 895901f8
ACPI!GET_ADDRESS_CONTEXT
+0x000 PciObject : 0x8996e010 _NSObj
+0x004 Bus : 0x89986fc0 ""
+0x008 Slot : 0x89986fbc _PCI_SLOT_NUMBER
+0x00c ParentBus : 0 ''
+0x010 ParentSlot : _PCI_SLOT_NUMBER
+0x014 Flags : 0x128
+0x018 Address : 0x30000
+0x01c BaseBusNumber : 0
+0x020 RunCompletion : 0n2
+0x024 CompletionRoutine : 0xf740d62c void ACPI!PciConfigSpaceHandlerWorker+0
+0x028 CompletionContext : 0x89986f88 Void
1: kd> dx -id 0,0,899a2278 -r1 ((ACPI!unsigned char *)0x89986fc0)
((ACPI!unsigned char *)0x89986fc0) : 0x89986fc0 : 0x0 [Type: unsigned char *]
0x0 [Type: unsigned char]

1: kd> p
eax=89986fc0 ebx=00000000 ecx=00000002 edx=00000000 esi=895901f8 edi=00000103
eip=f740d031 esp=f791abf8 ebp=f791ac48 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+0x147:
f740d031 e98a000000 jmp ACPI!GetPciAddressWorker+0x1d6 (f740d0c0)
1: kd> dt GET_ADDRESS_CONTEXT 895901f8
ACPI!GET_ADDRESS_CONTEXT
+0x000 PciObject : 0x8996e010 _NSObj
+0x004 Bus : 0x89986fc0 "???"
+0x008 Slot : 0x89986fbc _PCI_SLOT_NUMBER
+0x00c ParentBus : 0 ''
+0x010 ParentSlot : _PCI_SLOT_NUMBER
+0x014 Flags : 0x128
+0x018 Address : 0x30000
+0x01c BaseBusNumber : 0
+0x020 RunCompletion : 0n2
+0x024 CompletionRoutine : 0xf740d62c void ACPI!PciConfigSpaceHandlerWorker+0
+0x028 CompletionContext : 0x89986f88 Void
1: kd> dx -id 0,0,899a2278 -r1 ((ACPI!unsigned char *)0x89986fc0)
((ACPI!unsigned char *)0x89986fc0) : 0x89986fc0 : 0x2 [Type: unsigned char *]
0x2 [Type: unsigned char] 总线号=2

1: kd> dx -id 0,0,899a2278 -r1 ((ACPI!_NSObj *)0x8996e010)
((ACPI!_NSObj *)0x8996e010) : 0x8996e010 [Type: _NSObj *]
[+0x000] list [Type: _List]
[+0x008] pnsParent : 0x8996cd78 [Type: _NSObj *]
[+0x00c] pnsFirstChild : 0x8996e054 [Type: _NSObj *]
[+0x010] dwNameSeg : 0x30463453 [Type: unsigned long]
[+0x014] hOwner : 0x899af330 [Type: void *]
[+0x018] pnsOwnedNext : 0x8996dfcc [Type: _NSObj *]
[+0x01c] ObjData [Type: _ObjData]
[+0x030] Context : 0x89968688 [Type: void *]
[+0x034] dwRefCount : 0x0 [Type: unsigned long]
1: kd> db 0x8996e010
8996e010 38 dc 96 89 e8 e3 96 89-78 cd 96 89 54 e0 96 89 8.......x...T...
8996e020 53 34 46 30 30 f3 9a 89-cc df 96 89 00 00 06 00 S4F00...........
8996e030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
8996e040 88 86 96 89 00 00 00 00-48 4e 53 4f 44 00 00 00 ........HNSOD...
8996e050 00 90 96 89 a4 e3 96 89-98 e0 96 89 10 e0 96 89 ................
8996e060 00 00 00 00 5f 41 44 52-30 f3 9a 89 10 e0 96 89 ...._ADR0.......
8996e070 00 00 01 00 00 00 00 00-00 00 03 00 00 00 00 00 ................
8996e080 00 00 00 00 00 00 00 00-00 00 00 00 48 4e 53 4f ............HNSO
1: kd> db 0x8996cd78
8996cd78 38 cc 96 89 88 4f 97 89-ac ff 9a 89 f0 cd 96 89 8....O..........
8996cd88 50 32 50 30 30 f3 9a 89-38 cc 96 89 00 00 06 00 P2P00...8.......
8996cd98 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
8996cda8 a0 8e 96 89 00 00 00 00-48 4f 52 47 34 00 00 00 ........HORG4...
8996cdb8 00 90 96 89 00 00 00 00-04 00 00 00 02 00 00 00 ................
8996cdc8 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
8996cdd8 00 00 00 00 00 00 00 00-00 00 00 00 48 4e 53 4f ............HNSO
8996cde8 44 00 00 00 00 90 96 89-b0 4b 97 89 b4 ce 96 89 D........K......


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

Device (S4F0)
{
Name (_ADR, 0x00030000) // _ADR: Address
Name (_SUN, 0x23) // _SUN: Slot User Number
OperationRegion (REGS, PCI_Config, 0x00, 0x04)
Field (REGS, DWordAcc, NoLock, Preserve)
{
ID, 32
}

Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (BSTA (ID))
}

1: kd> dt _PCI_SLOT_NUMBER 0x89986fbc -r
hal!_PCI_SLOT_NUMBER
+0x000 u : __unnamed
+0x000 bits : __unnamed
+0x000 DeviceNumber : 0y00011 (0x3)
+0x000 FunctionNumber : 0y000
+0x000 Reserved : 0y000000000000000000000000 (0)
+0x000 AsULONG : 3


1: kd> kc
#
00 ACPI!GetPciAddressWorker
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> kv
# ChildEBP RetAddr Args to Child
00 f791ac48 f740d0d2 899b00ac 00000000 00000000 ACPI!GetPciAddressWorker+0x147 (FPO: [Non-Fpo]) (CONV: cdecl) [d:\srv03rtm\base\busdrv\acpi\driver\nt\pciopregion.c @ 1138]
01 f791acb0 f7407433 899b00ac 00000000 00000000 ACPI!GetPciAddressWorker+0x1e8 (FPO: [Non-Fpo]) (CONV: cdecl) [d:\srv03rtm\base\busdrv\acpi\driver\nt\pciopregion.c @ 1207]
02 f791acd8 f741f89b 899b00ac 00000000 8996826c ACPI!ACPIGetWorkerForInteger+0xcf (FPO: [Non-Fpo]) (CONV: cdecl) [d:\srv03rtm\base\busdrv\acpi\driver\nt\get.c @ 4814]
03 f791ad10 f741d905 f7407364 00000000 f743a934 ACPI!AsyncCallBack+0xe7 (FPO: [Non-Fpo]) (CONV: cdecl) [d:\srv03rtm\base\busdrv\acpi\driver\amlinew\sync.c @ 81]
04 f791ad34 f742042d 00000000 f7433d3c f743a928 ACPI!RunContext+0x1f5 (FPO: [Non-Fpo]) (CONV: cdecl) [d:\srv03rtm\base\busdrv\acpi\driver\amlinew\ctxt.c @ 649]
05 f791ad4c f74204ec f743a950 f743b318 f743a9b8 ACPI!DispatchCtxtQueue+0xaf (FPO: [Non-Fpo]) (CONV: cdecl) [d:\srv03rtm\base\busdrv\acpi\driver\amlinew\sched.c @ 150]
06 f791ad64 f74133c5 f743a928 00000000 89981ca0 ACPI!StartTimeSlicePassive+0x57 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\busdrv\acpi\driver\amlinew\sched.c @ 107]
07 f791adac 80d391f0 00000000 00000000 00000000 ACPI!ACPIWorker+0xbf (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\busdrv\acpi\driver\nt\worker.c @ 302]
08 f791addc 80b00d52 f7413306 00000000 00000000 nt!PspSystemThreadStartup+0x2e (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\ps\create.c @ 2213]
09 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16 [d:\srv03rtm\base\ntos\ke\i386\threadbg.asm @ 81]


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

AI万能分类器5分钟上手:小白用云端GPU,3步出结果

AI万能分类器5分钟上手:小白用云端GPU,3步出结果 引言:当行政小姐姐遇上AI分类器 每天处理上百张报销单的行政人员,最头疼的就是手动分类——餐饮发票、交通票据、办公用品单据混在一起,眼睛看花了还容易出错。现在&…

作者头像 李华
网站建设 2026/6/6 22:16:39

MiDaS模型实战:建筑场景深度估计应用案例

MiDaS模型实战:建筑场景深度估计应用案例 1. 引言:AI 单目深度估计的现实价值 在计算机视觉领域,从单张2D图像中恢复3D空间结构一直是极具挑战性的任务。传统方法依赖多视角几何或激光雷达等硬件设备,成本高且部署复杂。近年来&…

作者头像 李华
网站建设 2026/6/7 1:55:56

万能分类器应用案例:从商品分类到内容审核的10种用法

万能分类器应用案例:从商品分类到内容审核的10种用法 引言 在电商运营中,商品分类和内容审核是每天都要面对的"必修课"。想象一下,当618大促来临时,每秒涌入成千上万的商品上新和用户评论,传统人工分类就像…

作者头像 李华
网站建设 2026/6/6 19:26:11

33语种互译新标杆|腾讯开源HY-MT1.5-7B翻译模型实战指南

33语种互译新标杆|腾讯开源HY-MT1.5-7B翻译模型实战指南 在多语言交流日益频繁的今天,高质量、低延迟的机器翻译系统已成为跨语言沟通的核心基础设施。腾讯混元团队推出的 HY-MT1.5-7B 翻译模型,正是面向这一需求打造的新一代大模型翻译解决…

作者头像 李华