// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: evrgnini- ACPI address_space (op_region) init * * Copyright (C) 2000 - 2023, Intel Corp. * *****************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acevents.h" #include "acnamesp.h" #include "acinterp.h" #define _COMPONENT … ACPI_MODULE_NAME("evrgnini") /******************************************************************************* * * FUNCTION: acpi_ev_system_memory_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Setup a system_memory operation region * ******************************************************************************/ acpi_status acpi_ev_system_memory_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_io_space_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Setup a IO operation region * ******************************************************************************/ acpi_status acpi_ev_io_space_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_pci_config_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Setup a PCI_Config operation region * * MUTEX: Assumes namespace is not locked * ******************************************************************************/ acpi_status acpi_ev_pci_config_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_is_pci_root_bridge * * PARAMETERS: node - Device node being examined * * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge * * DESCRIPTION: Determine if the input device represents a PCI Root Bridge by * examining the _HID and _CID for the device. * ******************************************************************************/ u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) { … } /******************************************************************************* * * FUNCTION: acpi_ev_pci_bar_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Setup a pci_BAR operation region * * MUTEX: Assumes namespace is not locked * ******************************************************************************/ acpi_status acpi_ev_pci_bar_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_cmos_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Setup a CMOS operation region * * MUTEX: Assumes namespace is not locked * ******************************************************************************/ acpi_status acpi_ev_cmos_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_data_table_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Setup a data_table_region * * MUTEX: Assumes namespace is not locked * ******************************************************************************/ acpi_status acpi_ev_data_table_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_default_region_setup * * PARAMETERS: handle - Region we are interested in * function - Start or stop * handler_context - Address space handler context * region_context - Region specific context * * RETURN: Status * * DESCRIPTION: Default region initialization * ******************************************************************************/ acpi_status acpi_ev_default_region_setup(acpi_handle handle, u32 function, void *handler_context, void **region_context) { … } /******************************************************************************* * * FUNCTION: acpi_ev_initialize_region * * PARAMETERS: region_obj - Region we are initializing * * RETURN: Status * * DESCRIPTION: Initializes the region, finds any _REG methods and saves them * for execution at a later time * * Get the appropriate address space handler for a newly * created region. * * This also performs address space specific initialization. For * example, PCI regions must have an _ADR object that contains * a PCI address in the scope of the definition. This address is * required to perform an access to PCI config space. * * MUTEX: Interpreter should be unlocked, because we may run the _REG * method for this region. * * NOTE: Possible incompliance: * There is a behavior conflict in automatic _REG execution: * 1. When the interpreter is evaluating a method, we can only * automatically run _REG for the following case: * operation_region (OPR1, 0x80, 0x1000010, 0x4) * 2. When the interpreter is loading a table, we can also * automatically run _REG for the following case: * operation_region (OPR1, 0x80, 0x1000010, 0x4) * Though this may not be compliant to the de-facto standard, the * logic is kept in order not to trigger regressions. And keeping * this logic should be taken care by the caller of this function. * ******************************************************************************/ acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj) { … }