Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232027
b: refs/heads/master
c: 2d6d9fd
h: refs/heads/master
i:
  232025: 94e8669
  232023: 4432e23
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Jan 21, 2011
1 parent c0ac88d commit e89ecea
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 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: 8d99641f6c1af806cd5d9e6badce91910219a161
refs/heads/master: 2d6d9fd3a54a28c6f67f26eb6c74803307a1b11e
7 changes: 4 additions & 3 deletions trunk/drivers/acpi/nvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/acpi_io.h>
#include <acpi/acpiosxf.h>

/*
Expand Down Expand Up @@ -80,7 +81,7 @@ void suspend_nvs_free(void)
free_page((unsigned long)entry->data);
entry->data = NULL;
if (entry->kaddr) {
acpi_os_unmap_memory(entry->kaddr, entry->size);
iounmap(entry->kaddr);
entry->kaddr = NULL;
}
}
Expand Down Expand Up @@ -114,8 +115,8 @@ int suspend_nvs_save(void)

list_for_each_entry(entry, &nvs_list, node)
if (entry->data) {
entry->kaddr = acpi_os_map_memory(entry->phys_start,
entry->size);
entry->kaddr = acpi_os_ioremap(entry->phys_start,
entry->size);
if (!entry->kaddr) {
suspend_nvs_free();
return -ENOMEM;
Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/workqueue.h>
#include <linux/nmi.h>
#include <linux/acpi.h>
#include <linux/acpi_io.h>
#include <linux/efi.h>
#include <linux/ioport.h>
#include <linux/list.h>
Expand Down Expand Up @@ -302,9 +303,10 @@ void __iomem *__init_refok
acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
{
struct acpi_ioremap *map, *tmp_map;
unsigned long flags, pg_sz;
unsigned long flags;
void __iomem *virt;
phys_addr_t pg_off;
acpi_physical_address pg_off;
acpi_size pg_sz;

if (phys > ULONG_MAX) {
printk(KERN_ERR PREFIX "Cannot map memory that high\n");
Expand All @@ -320,7 +322,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)

pg_off = round_down(phys, PAGE_SIZE);
pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
virt = ioremap_cache(pg_off, pg_sz);
virt = acpi_os_ioremap(pg_off, pg_sz);
if (!virt) {
kfree(map);
return NULL;
Expand Down Expand Up @@ -642,7 +644,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
rcu_read_unlock();
if (!virt_addr) {
virt_addr = ioremap_cache(phys_addr, size);
virt_addr = acpi_os_ioremap(phys_addr, size);
unmap = 1;
}
if (!value)
Expand Down Expand Up @@ -678,7 +680,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
rcu_read_unlock();
if (!virt_addr) {
virt_addr = ioremap_cache(phys_addr, size);
virt_addr = acpi_os_ioremap(phys_addr, size);
unmap = 1;
}

Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
u32 *mask, u32 req);
extern void acpi_early_init(void);

int acpi_os_map_generic_address(struct acpi_generic_address *addr);
void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);

#else /* !CONFIG_ACPI */

#define acpi_disabled 1
Expand Down
16 changes: 16 additions & 0 deletions trunk/include/linux/acpi_io.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef _ACPI_IO_H_
#define _ACPI_IO_H_

#include <linux/io.h>
#include <acpi/acpi.h>

static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
acpi_size size)
{
return ioremap_cache(phys, size);
}

int acpi_os_map_generic_address(struct acpi_generic_address *addr);
void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);

#endif

0 comments on commit e89ecea

Please sign in to comment.