📄 exregion.c
字号:
case ACPI_WRITE: switch (BitWidth) { case 8: ACPI_SET8 (LogicalAddrPtr) = (UINT8) *Value; break; case 16: ACPI_SET16 (LogicalAddrPtr) = (UINT16) *Value; break; case 32: ACPI_SET32 ( LogicalAddrPtr) = (UINT32) *Value; break; case 64: ACPI_SET64 (LogicalAddrPtr) = (UINT64) *Value; break; default: /* BitWidth was already validated */ break; } break; default: Status = AE_BAD_PARAMETER; break; } return_ACPI_STATUS (Status);}/******************************************************************************* * * FUNCTION: AcpiExSystemIoSpaceHandler * * PARAMETERS: Function - Read or Write operation * Address - Where in the space to read or write * BitWidth - Field width in bits (8, 16, or 32) * Value - Pointer to in or out value * HandlerContext - Pointer to Handler's context * RegionContext - Pointer to context specific to the * accessed region * * RETURN: Status * * DESCRIPTION: Handler for the System IO address space (Op Region) * ******************************************************************************/ACPI_STATUSAcpiExSystemIoSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext){ ACPI_STATUS Status = AE_OK; UINT32 Value32; ACPI_FUNCTION_TRACE (ExSystemIoSpaceHandler); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n", BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address))); /* Decode the function parameter */ switch (Function) { case ACPI_READ: Status = AcpiOsReadPort ((ACPI_IO_ADDRESS) Address, &Value32, BitWidth); *Value = Value32; break; case ACPI_WRITE: Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) Address, (UINT32) *Value, BitWidth); break; default: Status = AE_BAD_PARAMETER; break; } return_ACPI_STATUS (Status);}/******************************************************************************* * * FUNCTION: AcpiExPciConfigSpaceHandler * * PARAMETERS: Function - Read or Write operation * Address - Where in the space to read or write * BitWidth - Field width in bits (8, 16, or 32) * Value - Pointer to in or out value * HandlerContext - Pointer to Handler's context * RegionContext - Pointer to context specific to the * accessed region * * RETURN: Status * * DESCRIPTION: Handler for the PCI Config address space (Op Region) * ******************************************************************************/ACPI_STATUSAcpiExPciConfigSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext){ ACPI_STATUS Status = AE_OK; ACPI_PCI_ID *PciId; UINT16 PciRegister; ACPI_FUNCTION_TRACE (ExPciConfigSpaceHandler); /* * The arguments to AcpiOs(Read|Write)PciConfiguration are: * * PciSegment is the PCI bus segment range 0-31 * PciBus is the PCI bus number range 0-255 * PciDevice is the PCI device number range 0-31 * PciFunction is the PCI device function number * PciRegister is the Config space register range 0-255 bytes * * Value - input value for write, output address for read * */ PciId = (ACPI_PCI_ID *) RegionContext; PciRegister = (UINT16) (UINT32) Address; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device, PciId->Function, PciRegister)); switch (Function) { case ACPI_READ: *Value = 0; Status = AcpiOsReadPciConfiguration (PciId, PciRegister, Value, BitWidth); break; case ACPI_WRITE: Status = AcpiOsWritePciConfiguration (PciId, PciRegister, *Value, BitWidth); break; default: Status = AE_BAD_PARAMETER; break; } return_ACPI_STATUS (Status);}/******************************************************************************* * * FUNCTION: AcpiExCmosSpaceHandler * * PARAMETERS: Function - Read or Write operation * Address - Where in the space to read or write * BitWidth - Field width in bits (8, 16, or 32) * Value - Pointer to in or out value * HandlerContext - Pointer to Handler's context * RegionContext - Pointer to context specific to the * accessed region * * RETURN: Status * * DESCRIPTION: Handler for the CMOS address space (Op Region) * ******************************************************************************/ACPI_STATUSAcpiExCmosSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext){ ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE (ExCmosSpaceHandler); return_ACPI_STATUS (Status);}/******************************************************************************* * * FUNCTION: AcpiExPciBarSpaceHandler * * PARAMETERS: Function - Read or Write operation * Address - Where in the space to read or write * BitWidth - Field width in bits (8, 16, or 32) * Value - Pointer to in or out value * HandlerContext - Pointer to Handler's context * RegionContext - Pointer to context specific to the * accessed region * * RETURN: Status * * DESCRIPTION: Handler for the PCI BarTarget address space (Op Region) * ******************************************************************************/ACPI_STATUSAcpiExPciBarSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext){ ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE (ExPciBarSpaceHandler); return_ACPI_STATUS (Status);}/******************************************************************************* * * FUNCTION: AcpiExDataTableSpaceHandler * * PARAMETERS: Function - Read or Write operation * Address - Where in the space to read or write * BitWidth - Field width in bits (8, 16, or 32) * Value - Pointer to in or out value * HandlerContext - Pointer to Handler's context * RegionContext - Pointer to context specific to the * accessed region * * RETURN: Status * * DESCRIPTION: Handler for the Data Table address space (Op Region) * ******************************************************************************/ACPI_STATUSAcpiExDataTableSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext){ ACPI_FUNCTION_TRACE (ExDataTableSpaceHandler); /* Perform the memory read or write */ switch (Function) { case ACPI_READ: ACPI_MEMCPY (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address), ACPI_DIV_8 (BitWidth)); break; case ACPI_WRITE: default: return_ACPI_STATUS (AE_SUPPORT); } return_ACPI_STATUS (AE_OK);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -