diff options
author | Pavel Machek <pavel@ucw.cz> | 2008-05-20 10:27:17 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-22 05:35:14 -0400 |
commit | 0abbc78a0137fee60ef092f0b20a3d3d7e7e0cc2 (patch) | |
tree | 861c8de86a39a9c3235f949dcad01ba96cfb18c6 /arch/x86/kernel/aperture_64.c | |
parent | 538f0fd0f210c2ce5c585799f18d0e5c7cf6155e (diff) |
x86, aperture_64: use symbolic constants
Factor-out common aperture_valid code.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/aperture_64.c')
-rw-r--r-- | arch/x86/kernel/aperture_64.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 02f4dbaa4df4..5373f7834d8a 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
@@ -109,27 +109,6 @@ static u32 __init allocate_aperture(void) | |||
109 | return (u32)__pa(p); | 109 | return (u32)__pa(p); |
110 | } | 110 | } |
111 | 111 | ||
112 | static int __init aperture_valid(u64 aper_base, u32 aper_size, u32 min_size) | ||
113 | { | ||
114 | if (!aper_base) | ||
115 | return 0; | ||
116 | |||
117 | if (aper_base + aper_size > 0x100000000UL) { | ||
118 | printk(KERN_ERR "Aperture beyond 4GB. Ignoring.\n"); | ||
119 | return 0; | ||
120 | } | ||
121 | if (e820_any_mapped(aper_base, aper_base + aper_size, E820_RAM)) { | ||
122 | printk(KERN_ERR "Aperture pointing to e820 RAM. Ignoring.\n"); | ||
123 | return 0; | ||
124 | } | ||
125 | if (aper_size < min_size) { | ||
126 | printk(KERN_ERR "Aperture too small (%d MB) than (%d MB)\n", | ||
127 | aper_size>>20, min_size>>20); | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | return 1; | ||
132 | } | ||
133 | 112 | ||
134 | /* Find a PCI capability */ | 113 | /* Find a PCI capability */ |
135 | static __u32 __init find_cap(int bus, int slot, int func, int cap) | 114 | static __u32 __init find_cap(int bus, int slot, int func, int cap) |
@@ -344,7 +323,7 @@ out: | |||
344 | if (gart_fix_e820 && !fix && aper_enabled) { | 323 | if (gart_fix_e820 && !fix && aper_enabled) { |
345 | if (!e820_all_mapped(aper_base, aper_base + aper_size, | 324 | if (!e820_all_mapped(aper_base, aper_base + aper_size, |
346 | E820_RESERVED)) { | 325 | E820_RESERVED)) { |
347 | /* reserved it, so we can resuse it in second kernel */ | 326 | /* reserve it, so we can reuse it in second kernel */ |
348 | printk(KERN_INFO "update e820 for GART\n"); | 327 | printk(KERN_INFO "update e820 for GART\n"); |
349 | add_memory_region(aper_base, aper_size, E820_RESERVED); | 328 | add_memory_region(aper_base, aper_size, E820_RESERVED); |
350 | update_e820(); | 329 | update_e820(); |