diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/highmem.h | 1 | ||||
| -rw-r--r-- | include/linux/mm.h | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 370177037315..042e6ddfcf8a 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -26,6 +26,7 @@ static inline void *kmap(struct page *page) { return page_address(page); } #define kmap_atomic(page, idx) page_address(page) #define kunmap_atomic(addr, idx) do { } while (0) +#define kmap_atomic_to_page(ptr) virt_to_page(ptr) #endif /* CONFIG_HIGHMEM */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 5e01743a0bc6..4dfac9d2cb5c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -159,9 +159,9 @@ struct page { struct list_head lru; /* Pageout list, eg. active_list; protected by zone->lru_lock !! */ union { - struct pte_chain * chain; /* Reverse pte mapping pointer. + struct pte_chain *chain;/* Reverse pte mapping pointer. * protected by PG_chainlock */ - pte_t * direct; + pte_addr_t direct; } pte; unsigned long private; /* mapping-private opaque data */ @@ -322,6 +322,16 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num) #endif /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */ /* + * Return true if this page is mapped into pagetables. Subtle: test pte.direct + * rather than pte.chain. Because sometimes pte.direct is 64-bit, and .chain + * is only 32-bit. + */ +static inline int page_mapped(struct page *page) +{ + return page->pte.direct != 0; +} + +/* * Error return values for the *_nopage functions */ #define NOPAGE_SIGBUS (NULL) |
