diff options
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r-- | include/linux/mmzone.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 03a5a6eb0ffa..adae3c915938 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -109,12 +109,14 @@ enum zone_type { | |||
109 | * <16M. | 109 | * <16M. |
110 | */ | 110 | */ |
111 | ZONE_DMA, | 111 | ZONE_DMA, |
112 | #ifdef CONFIG_ZONE_DMA32 | ||
112 | /* | 113 | /* |
113 | * x86_64 needs two ZONE_DMAs because it supports devices that are | 114 | * x86_64 needs two ZONE_DMAs because it supports devices that are |
114 | * only able to do DMA to the lower 16M but also 32 bit devices that | 115 | * only able to do DMA to the lower 16M but also 32 bit devices that |
115 | * can only do DMA areas below 4G. | 116 | * can only do DMA areas below 4G. |
116 | */ | 117 | */ |
117 | ZONE_DMA32, | 118 | ZONE_DMA32, |
119 | #endif | ||
118 | /* | 120 | /* |
119 | * Normal addressable memory is in ZONE_NORMAL. DMA operations can be | 121 | * Normal addressable memory is in ZONE_NORMAL. DMA operations can be |
120 | * performed on pages in ZONE_NORMAL if the DMA devices support | 122 | * performed on pages in ZONE_NORMAL if the DMA devices support |
@@ -161,9 +163,13 @@ enum zone_type { | |||
161 | * | 163 | * |
162 | * NOTE! Make sure this matches the zones in <linux/gfp.h> | 164 | * NOTE! Make sure this matches the zones in <linux/gfp.h> |
163 | */ | 165 | */ |
164 | #define GFP_ZONEMASK 0x07 | 166 | #define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ |
165 | /* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */ | 167 | |
166 | #define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ | 168 | #ifdef CONFIG_ZONE_DMA32 |
169 | #define GFP_ZONEMASK 0x07 | ||
170 | #else | ||
171 | #define GFP_ZONEMASK 0x03 | ||
172 | #endif | ||
167 | 173 | ||
168 | struct zone { | 174 | struct zone { |
169 | /* Fields commonly accessed by the page allocator */ | 175 | /* Fields commonly accessed by the page allocator */ |
@@ -429,7 +435,11 @@ static inline int is_normal(struct zone *zone) | |||
429 | 435 | ||
430 | static inline int is_dma32(struct zone *zone) | 436 | static inline int is_dma32(struct zone *zone) |
431 | { | 437 | { |
438 | #ifdef CONFIG_ZONE_DMA32 | ||
432 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; | 439 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; |
440 | #else | ||
441 | return 0; | ||
442 | #endif | ||
433 | } | 443 | } |
434 | 444 | ||
435 | static inline int is_dma(struct zone *zone) | 445 | static inline int is_dma(struct zone *zone) |