Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Change is_ISA_range() into an inline function

Change is_ISA_range() from a macro to an inline function. This makes
it type safe, and also allows it to be assigned to a function pointer
if necessary.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <20091119202341.GA4420@sgi.com>

+12 -7
+12 -7
arch/x86/include/asm/e820.h
··· 61 61 struct e820entry map[E820_X_MAX]; 62 62 }; 63 63 64 + #define ISA_START_ADDRESS 0xa0000 65 + #define ISA_END_ADDRESS 0x100000 66 + 67 + #define BIOS_BEGIN 0x000a0000 68 + #define BIOS_END 0x00100000 69 + 64 70 #ifdef __KERNEL__ 65 71 /* see comment in arch/x86/kernel/e820.c */ 66 72 extern struct e820map e820; ··· 132 126 extern void e820_reserve_resources_late(void); 133 127 extern void setup_memory_map(void); 134 128 extern char *default_machine_specific_memory_setup(void); 129 + 130 + static inline bool is_ISA_range(u64 s, u64 e) 131 + { 132 + return s >= ISA_START_ADDRESS && e < ISA_END_ADDRESS; 133 + } 134 + 135 135 #endif /* __KERNEL__ */ 136 136 #endif /* __ASSEMBLY__ */ 137 - 138 - #define ISA_START_ADDRESS 0xa0000 139 - #define ISA_END_ADDRESS 0x100000 140 - #define is_ISA_range(s, e) ((s) >= ISA_START_ADDRESS && (e) < ISA_END_ADDRESS) 141 - 142 - #define BIOS_BEGIN 0x000a0000 143 - #define BIOS_END 0x00100000 144 137 145 138 #ifdef __KERNEL__ 146 139 #include <linux/ioport.h>