diff options
Diffstat (limited to 'drivers/acpi/apei/apei-base.c')
-rw-r--r-- | drivers/acpi/apei/apei-base.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 5577762daee1..6686b1eaf13e 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c | |||
@@ -243,7 +243,7 @@ static int pre_map_gar_callback(struct apei_exec_context *ctx, | |||
243 | u8 ins = entry->instruction; | 243 | u8 ins = entry->instruction; |
244 | 244 | ||
245 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) | 245 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) |
246 | return acpi_os_map_generic_address(&entry->register_region); | 246 | return apei_map_generic_address(&entry->register_region); |
247 | 247 | ||
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
@@ -276,7 +276,7 @@ static int post_unmap_gar_callback(struct apei_exec_context *ctx, | |||
276 | u8 ins = entry->instruction; | 276 | u8 ins = entry->instruction; |
277 | 277 | ||
278 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) | 278 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) |
279 | acpi_os_unmap_generic_address(&entry->register_region); | 279 | apei_unmap_generic_address(&entry->register_region); |
280 | 280 | ||
281 | return 0; | 281 | return 0; |
282 | } | 282 | } |
@@ -606,6 +606,19 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr, | |||
606 | return 0; | 606 | return 0; |
607 | } | 607 | } |
608 | 608 | ||
609 | int apei_map_generic_address(struct acpi_generic_address *reg) | ||
610 | { | ||
611 | int rc; | ||
612 | u32 access_bit_width; | ||
613 | u64 address; | ||
614 | |||
615 | rc = apei_check_gar(reg, &address, &access_bit_width); | ||
616 | if (rc) | ||
617 | return rc; | ||
618 | return acpi_os_map_generic_address(reg); | ||
619 | } | ||
620 | EXPORT_SYMBOL_GPL(apei_map_generic_address); | ||
621 | |||
609 | /* read GAR in interrupt (including NMI) or process context */ | 622 | /* read GAR in interrupt (including NMI) or process context */ |
610 | int apei_read(u64 *val, struct acpi_generic_address *reg) | 623 | int apei_read(u64 *val, struct acpi_generic_address *reg) |
611 | { | 624 | { |