- if (phys > ULONG_MAX) {
- printk(KERN_ERR PREFIX "Cannot map memory that high\n");
- return AE_BAD_PARAMETER;
+ if (efi_enabled) {
+ if (EFI_MEMORY_WB & efi_mem_attributes(phys)) {
+ *virt = (void __iomem *)phys_to_virt(phys);
+ } else {
+ *virt = ioremap(phys, size);
+ }
+ } else {
+ if (phys > ULONG_MAX) {
+ printk(KERN_ERR PREFIX "Cannot map memory that high\n");
+ return AE_BAD_PARAMETER;
+ }
+ /*
+ * ioremap checks to ensure this is in reserved space
+ */
+ *virt = ioremap((unsigned long)phys, size);