{
if (efi_enabled) {
addr->pointer_type = ACPI_PHYSICAL_POINTER;
- if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
- addr->pointer.physical = efi.acpi20;
- else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
- addr->pointer.physical = efi.acpi;
+ if (efi.acpi20)
+ addr->pointer.physical =
+ (acpi_physical_address) virt_to_phys(efi.acpi20);
+ else if (efi.acpi)
+ addr->pointer.physical =
+ (acpi_physical_address) virt_to_phys(efi.acpi);
else {
printk(KERN_ERR PREFIX
"System description tables not found\n");
acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
void __iomem ** virt)
{
- 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);
}
- /*
- * ioremap checks to ensure this is in reserved space
- */
- *virt = ioremap((unsigned long)phys, size);
if (!*virt)
return AE_NO_MEMORY;
{
u32 dummy;
void __iomem *virt_addr;
+ int iomem = 0;
- virt_addr = ioremap(phys_addr, width);
+ 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);
if (!value)
value = &dummy;
BUG();
}
- iounmap(virt_addr);
+ if (efi_enabled) {
+ if (iomem)
+ iounmap(virt_addr);
+ }
return AE_OK;
}
acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
{
void __iomem *virt_addr;
+ int iomem = 0;
- virt_addr = ioremap(phys_addr, width);
+ 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);
switch (width) {
case 8:
BUG();
}
- iounmap(virt_addr);
+ if (iomem)
+ iounmap(virt_addr);
return AE_OK;
}
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
handle, units, timeout));
- if (in_atomic() || acpi_in_resume)
+ if (in_atomic())
timeout = 0;
switch (timeout) {
u32 acpi_os_get_thread_id(void)
{
- if (!in_atomic() && !acpi_in_resume)
+ if (!in_atomic())
return current->pid;
return 0;
void *acpi_os_acquire_object(acpi_cache_t * cache)
{
- void *object;
-
- if (acpi_in_resume)
- object = kmem_cache_alloc(cache, GFP_ATOMIC);
- else
- object = kmem_cache_alloc(cache, GFP_KERNEL);
+ void *object = kmem_cache_alloc(cache, GFP_KERNEL);
WARN_ON(!object);
return object;
}