Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24037
b: refs/heads/master
c: 9f4fd61
h: refs/heads/master
i:
  24035: 6a16eef
v: v3
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Mar 26, 2006
1 parent 1510dda commit 0818afd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23dd842c0033dbb05248c42929c3c526c55386de
refs/heads/master: 9f4fd61fa7c13ea905dac18b9baa766a35b88485
54 changes: 11 additions & 43 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,22 +180,14 @@ acpi_status
acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
void __iomem ** virt)
{
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);
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);

if (!*virt)
return AE_NO_MEMORY;
Expand Down Expand Up @@ -407,18 +399,8 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
{
u32 dummy;
void __iomem *virt_addr;
int iomem = 0;

if (efi_enabled) {
if (EFI_MEMORY_WB & efi_mem_attributes(phys_addr)) {
/* HACK ALERT! We can use readb/w/l on real memory too.. */
virt_addr = (void __iomem *)phys_to_virt(phys_addr);
} else {
iomem = 1;
virt_addr = ioremap(phys_addr, width);
}
} else
virt_addr = (void __iomem *)phys_to_virt(phys_addr);
virt_addr = ioremap(phys_addr, width);
if (!value)
value = &dummy;

Expand All @@ -436,10 +418,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
BUG();
}

if (efi_enabled) {
if (iomem)
iounmap(virt_addr);
}
iounmap(virt_addr);

return AE_OK;
}
Expand All @@ -448,18 +427,8 @@ acpi_status
acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
{
void __iomem *virt_addr;
int iomem = 0;

if (efi_enabled) {
if (EFI_MEMORY_WB & efi_mem_attributes(phys_addr)) {
/* HACK ALERT! We can use writeb/w/l on real memory too */
virt_addr = (void __iomem *)phys_to_virt(phys_addr);
} else {
iomem = 1;
virt_addr = ioremap(phys_addr, width);
}
} else
virt_addr = (void __iomem *)phys_to_virt(phys_addr);
virt_addr = ioremap(phys_addr, width);

switch (width) {
case 8:
Expand All @@ -475,8 +444,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
BUG();
}

if (iomem)
iounmap(virt_addr);
iounmap(virt_addr);

return AE_OK;
}
Expand Down

0 comments on commit 0818afd

Please sign in to comment.