河源市网站建设_网站建设公司_内容更新_seo优化
2026/1/19 18:39:23 网站建设 项目流程

关于处理节点BAT1的时候会调用ACPI!GetOpRegionScope和处理节点BAT2的时候就不用调用ACPI!GetOpRegionScope函数了!!!

第一部分:时间上在前。

https://chenghao.blog.csdn.net/article/details/157065028
处理节点BAT1的时候回调用ACPI!GetOpRegionScope
1: kd> kc
#
00 ACPI!AsyncEvalObject
01 ACPI!AMLIAsyncEvalObject
02 ACPI!ACPIGet
03 ACPI!IsPciDeviceWorker
04 ACPI!IsPciDevice
05 ACPI!GetOpRegionScopeWorker
06 ACPI!GetOpRegionScope
07 ACPI!PciConfigSpaceHandlerWorker

08 ACPI!PciConfigSpaceHandler
09 ACPI!InternalOpRegionHandler
0a ACPI!WriteCookAccess
0b ACPI!RunContext
0c ACPI!InsertReadyQueue
0d ACPI!RestartCtxtPassive
0e ACPI!ACPIWorker
0f nt!PspSystemThreadStartup
10 nt!KiThreadStartup


NTSTATUS
EXPORT
PciConfigSpaceHandlerWorker(
IN PNSOBJ AcpiObject,
IN NTSTATUS CompletionStatus,
IN POBJDATA Result,
IN PVOID Context
)
{

if (!state->OpRegion->Context) {

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

state->Flags |= PCISUPP_GOT_SCOPE;

status = GetOpRegionScope(state->OpRegion,
PciConfigSpaceHandlerWorker,
(PVOID)state,
&((PNSOBJ)(state->OpRegion->Context)));

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

if (!NT_SUCCESS(status)) {
status = STATUS_SUCCESS;
goto PciConfigSpaceHandlerWorkerDone;
}
}
}

第二部分:时间上在后。


处理节点BAT2的时候就不用调用ACPI!GetOpRegionScope函数了!!!


1: kd> kc
#
00 ACPI!GetPciAddress
01 ACPI!PciConfigSpaceHandlerWorker

02 ACPI!PciConfigSpaceHandler
03 ACPI!InternalOpRegionHandler
04 ACPI!WriteCookAccess
05 ACPI!RunContext
06 ACPI!InsertReadyQueue
07 ACPI!RestartCtxtPassive
08 ACPI!ACPIWorker
09 nt!PspSystemThreadStartup
0a nt!KiThreadStartup

NTSTATUS
EXPORT
PciConfigSpaceHandlerWorker(
IN PNSOBJ AcpiObject,
IN NTSTATUS CompletionStatus,
IN POBJDATA Result,
IN PVOID Context
)
{

//
// If we have not seen this OpRegion before, we need to
// fill in the dwContext with the PNSOBJ of the
// PCI device which the OpRegion relates to.
//

if (!state->OpRegion->Context) {

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

state->Flags |= PCISUPP_GOT_SCOPE;

status = GetOpRegionScope(state->OpRegion,
PciConfigSpaceHandlerWorker,
(PVOID)state,
&((PNSOBJ)(state->OpRegion->Context)));

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

if (!NT_SUCCESS(status)) {
status = STATUS_SUCCESS;
goto PciConfigSpaceHandlerWorkerDone;
}
}
}

//
// Identify the PCI device, that device's extension,
// and the pointer to the interface within the PCI
// driver that does PCI config space reads and writes.
//

state->PciObj = (PNSOBJ)state->OpRegion->Context;

pciDeviceFilter = (PDEVICE_EXTENSION)state->PciObj->Context;

if (pciDeviceFilter == NULL) {

//
// The device has not been initialized yet, we cannot perform
// PCI config cycles to it. Fail gracefully and return all 0xFF
//
bytes = 0;
status = STATUS_SUCCESS;
goto PciConfigSpaceHandlerWorkerDone;
}

ASSERT(pciDeviceFilter);

interface = pciDeviceFilter->Filter.Interface;

ASSERT(interface ? (interface->Size == sizeof(BUS_INTERFACE_STANDARD)) : TRUE);

//
// If interface is non-zero, we have enumerated this PCI
// device. So use the PCI driver to do config ops.
// If it is zero, make some attempt to figure out what
// device this request is for. The result will be
// used in calls to the HAL.
//

if (!interface) {

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

state->Flags |= PCISUPP_GOT_SLOT_INFO;

status = GetPciAddress(state->PciObj,
PciConfigSpaceHandlerWorker,
(PVOID)state,
&state->Bus,
&state->Slot);

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询