diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/io-mapping.h | 17 | ||||
| -rw-r--r-- | include/linux/page-flags.h | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 0adb0f91568c..97eb928b4924 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -49,23 +49,30 @@ static inline struct io_mapping * | |||
| 49 | io_mapping_create_wc(resource_size_t base, unsigned long size) | 49 | io_mapping_create_wc(resource_size_t base, unsigned long size) |
| 50 | { | 50 | { |
| 51 | struct io_mapping *iomap; | 51 | struct io_mapping *iomap; |
| 52 | 52 | pgprot_t prot; | |
| 53 | if (!is_io_mapping_possible(base, size)) | ||
| 54 | return NULL; | ||
| 55 | 53 | ||
| 56 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); | 54 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); |
| 57 | if (!iomap) | 55 | if (!iomap) |
| 58 | return NULL; | 56 | goto out_err; |
| 57 | |||
| 58 | if (iomap_create_wc(base, size, &prot)) | ||
| 59 | goto out_free; | ||
| 59 | 60 | ||
| 60 | iomap->base = base; | 61 | iomap->base = base; |
| 61 | iomap->size = size; | 62 | iomap->size = size; |
| 62 | iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL)); | 63 | iomap->prot = prot; |
| 63 | return iomap; | 64 | return iomap; |
| 65 | |||
| 66 | out_free: | ||
| 67 | kfree(iomap); | ||
| 68 | out_err: | ||
| 69 | return NULL; | ||
| 64 | } | 70 | } |
| 65 | 71 | ||
| 66 | static inline void | 72 | static inline void |
| 67 | io_mapping_free(struct io_mapping *mapping) | 73 | io_mapping_free(struct io_mapping *mapping) |
| 68 | { | 74 | { |
| 75 | iomap_free(mapping->base, mapping->size); | ||
| 69 | kfree(mapping); | 76 | kfree(mapping); |
| 70 | } | 77 | } |
| 71 | 78 | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e2e5ce543595..2b87acfc5f87 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -99,7 +99,7 @@ enum pageflags { | |||
| 99 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 99 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
| 100 | PG_mlocked, /* Page is vma mlocked */ | 100 | PG_mlocked, /* Page is vma mlocked */ |
| 101 | #endif | 101 | #endif |
| 102 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 102 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
| 103 | PG_uncached, /* Page has been mapped as uncached */ | 103 | PG_uncached, /* Page has been mapped as uncached */ |
| 104 | #endif | 104 | #endif |
| 105 | __NR_PAGEFLAGS, | 105 | __NR_PAGEFLAGS, |
| @@ -257,7 +257,7 @@ PAGEFLAG_FALSE(Mlocked) | |||
| 257 | SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) | 257 | SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) |
| 258 | #endif | 258 | #endif |
| 259 | 259 | ||
| 260 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 260 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
| 261 | PAGEFLAG(Uncached, uncached) | 261 | PAGEFLAG(Uncached, uncached) |
| 262 | #else | 262 | #else |
| 263 | PAGEFLAG_FALSE(Uncached) | 263 | PAGEFLAG_FALSE(Uncached) |
