mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 02:50:53 +07:00
ACPI: OSL: Change the type of acpi_os_map_generic_address() return value
Modify acpi_os_map_generic_address() to return the pointer returned by acpi_os_map_iomem() which represents the logical address corresponding to the struct acpi_generic_address argument passed to it or NULL if that address cannot be obtained (for example, the argument does not represent an address in system memory or it could not be mapped by the OS). Among other things, that will allow the ACPI OS layer to pass the logical addresses of the FADT GPE blocks 0 and 1 to ACPICA going forward. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
7a8379eb41
commit
6915564dc5
@ -632,7 +632,11 @@ int apei_map_generic_address(struct acpi_generic_address *reg)
|
||||
rc = apei_check_gar(reg, &address, &access_bit_width);
|
||||
if (rc)
|
||||
return rc;
|
||||
return acpi_os_map_generic_address(reg);
|
||||
|
||||
if (!acpi_os_map_generic_address(reg))
|
||||
return -ENXIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(apei_map_generic_address);
|
||||
|
||||
|
@ -447,24 +447,19 @@ void __ref acpi_os_unmap_memory(void *virt, acpi_size size)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
|
||||
|
||||
int acpi_os_map_generic_address(struct acpi_generic_address *gas)
|
||||
void __iomem *acpi_os_map_generic_address(struct acpi_generic_address *gas)
|
||||
{
|
||||
u64 addr;
|
||||
void __iomem *virt;
|
||||
|
||||
if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
/* Handle possible alignment issues */
|
||||
memcpy(&addr, &gas->address, sizeof(addr));
|
||||
if (!addr || !gas->bit_width)
|
||||
return -EINVAL;
|
||||
return NULL;
|
||||
|
||||
virt = acpi_os_map_iomem(addr, gas->bit_width / 8);
|
||||
if (!virt)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
return acpi_os_map_iomem(addr, gas->bit_width / 8);
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_os_map_generic_address);
|
||||
|
||||
@ -1756,10 +1751,11 @@ acpi_status __init acpi_os_initialize(void)
|
||||
* Use acpi_os_map_generic_address to pre-map the reset
|
||||
* register if it's in system memory.
|
||||
*/
|
||||
int rv;
|
||||
void *rv;
|
||||
|
||||
rv = acpi_os_map_generic_address(&acpi_gbl_FADT.reset_register);
|
||||
pr_debug(PREFIX "%s: map reset_reg status %d\n", __func__, rv);
|
||||
pr_debug(PREFIX "%s: map reset_reg %s\n", __func__,
|
||||
rv ? "successful" : "failed");
|
||||
}
|
||||
acpi_os_initialized = true;
|
||||
|
||||
|
@ -21,7 +21,7 @@ void __iomem __ref
|
||||
void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
|
||||
void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
|
||||
|
||||
int acpi_os_map_generic_address(struct acpi_generic_address *addr);
|
||||
void __iomem *acpi_os_map_generic_address(struct acpi_generic_address *addr);
|
||||
void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user