diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86_64/dma.h | 11 | ||||
-rw-r--r-- | include/asm-x86_64/proto.h | 2 | ||||
-rw-r--r-- | include/linux/gfp.h | 11 | ||||
-rw-r--r-- | include/linux/mmzone.h | 16 |
4 files changed, 31 insertions, 9 deletions
diff --git a/include/asm-x86_64/dma.h b/include/asm-x86_64/dma.h index 16fa3a064d0c..6f2a817b6a7c 100644 --- a/include/asm-x86_64/dma.h +++ b/include/asm-x86_64/dma.h | |||
@@ -72,8 +72,15 @@ | |||
72 | 72 | ||
73 | #define MAX_DMA_CHANNELS 8 | 73 | #define MAX_DMA_CHANNELS 8 |
74 | 74 | ||
75 | /* The maximum address that we can perform a DMA transfer to on this platform */ | 75 | |
76 | #define MAX_DMA_ADDRESS (PAGE_OFFSET+0x1000000) | 76 | /* 16MB ISA DMA zone */ |
77 | #define MAX_DMA_PFN ((16*1024*1024) >> PAGE_SHIFT) | ||
78 | |||
79 | /* 4GB broken PCI/AGP hardware bus master zone */ | ||
80 | #define MAX_DMA32_PFN ((4UL*1024*1024*1024) >> PAGE_SHIFT) | ||
81 | |||
82 | /* Compat define for old dma zone */ | ||
83 | #define MAX_DMA_ADDRESS ((unsigned long)__va(MAX_DMA_PFN << PAGE_SHIFT)) | ||
77 | 84 | ||
78 | /* 8237 DMA controllers */ | 85 | /* 8237 DMA controllers */ |
79 | #define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ | 86 | #define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ |
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index dbb37b0adb43..c251152a0658 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -22,6 +22,8 @@ extern void mtrr_bp_init(void); | |||
22 | #define mtrr_bp_init() do {} while (0) | 22 | #define mtrr_bp_init() do {} while (0) |
23 | #endif | 23 | #endif |
24 | extern void init_memory_mapping(unsigned long start, unsigned long end); | 24 | extern void init_memory_mapping(unsigned long start, unsigned long end); |
25 | extern void size_zones(unsigned long *z, unsigned long *h, | ||
26 | unsigned long start_pfn, unsigned long end_pfn); | ||
25 | 27 | ||
26 | extern void system_call(void); | 28 | extern void system_call(void); |
27 | extern int kernel_syscall(void); | 29 | extern int kernel_syscall(void); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index c3779432a723..4351e6bb5a79 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -14,6 +14,13 @@ struct vm_area_struct; | |||
14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ | 14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ |
15 | #define __GFP_DMA ((__force gfp_t)0x01u) | 15 | #define __GFP_DMA ((__force gfp_t)0x01u) |
16 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 16 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
17 | #ifdef CONFIG_DMA_IS_DMA32 | ||
18 | #define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */ | ||
19 | #elif BITS_PER_LONG < 64 | ||
20 | #define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */ | ||
21 | #else | ||
22 | #define __GFP_DMA32 ((__force gfp_t)0x04) /* Has own ZONE_DMA32 */ | ||
23 | #endif | ||
17 | 24 | ||
18 | /* | 25 | /* |
19 | * Action modifiers - doesn't change the zoning | 26 | * Action modifiers - doesn't change the zoning |
@@ -64,6 +71,10 @@ struct vm_area_struct; | |||
64 | 71 | ||
65 | #define GFP_DMA __GFP_DMA | 72 | #define GFP_DMA __GFP_DMA |
66 | 73 | ||
74 | /* 4GB DMA on some platforms */ | ||
75 | #define GFP_DMA32 __GFP_DMA32 | ||
76 | |||
77 | |||
67 | #define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) | 78 | #define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) |
68 | 79 | ||
69 | /* | 80 | /* |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index f5fa3082fd6a..da7a829f8561 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -71,10 +71,11 @@ struct per_cpu_pageset { | |||
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #define ZONE_DMA 0 | 73 | #define ZONE_DMA 0 |
74 | #define ZONE_NORMAL 1 | 74 | #define ZONE_DMA32 1 |
75 | #define ZONE_HIGHMEM 2 | 75 | #define ZONE_NORMAL 2 |
76 | #define ZONE_HIGHMEM 3 | ||
76 | 77 | ||
77 | #define MAX_NR_ZONES 3 /* Sync this with ZONES_SHIFT */ | 78 | #define MAX_NR_ZONES 4 /* Sync this with ZONES_SHIFT */ |
78 | #define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ | 79 | #define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ |
79 | 80 | ||
80 | 81 | ||
@@ -108,9 +109,10 @@ struct per_cpu_pageset { | |||
108 | 109 | ||
109 | /* | 110 | /* |
110 | * On machines where it is needed (eg PCs) we divide physical memory | 111 | * On machines where it is needed (eg PCs) we divide physical memory |
111 | * into multiple physical zones. On a PC we have 3 zones: | 112 | * into multiple physical zones. On a PC we have 4 zones: |
112 | * | 113 | * |
113 | * ZONE_DMA < 16 MB ISA DMA capable memory | 114 | * ZONE_DMA < 16 MB ISA DMA capable memory |
115 | * ZONE_DMA32 0 MB Empty | ||
114 | * ZONE_NORMAL 16-896 MB direct mapped by the kernel | 116 | * ZONE_NORMAL 16-896 MB direct mapped by the kernel |
115 | * ZONE_HIGHMEM > 896 MB only page cache and user processes | 117 | * ZONE_HIGHMEM > 896 MB only page cache and user processes |
116 | */ | 118 | */ |
@@ -455,10 +457,10 @@ extern struct pglist_data contig_page_data; | |||
455 | 457 | ||
456 | #if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED) | 458 | #if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED) |
457 | /* | 459 | /* |
458 | * with 32 bit page->flags field, we reserve 8 bits for node/zone info. | 460 | * with 32 bit page->flags field, we reserve 9 bits for node/zone info. |
459 | * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. | 461 | * there are 4 zones (3 bits) and this leaves 9-3=6 bits for nodes. |
460 | */ | 462 | */ |
461 | #define FLAGS_RESERVED 8 | 463 | #define FLAGS_RESERVED 9 |
462 | 464 | ||
463 | #elif BITS_PER_LONG == 64 | 465 | #elif BITS_PER_LONG == 64 |
464 | /* | 466 | /* |