diff options
Diffstat (limited to 'arch/x86/include/asm/setup.h')
-rw-r--r-- | arch/x86/include/asm/setup.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 366d36639940..61b126b97885 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
@@ -104,6 +104,29 @@ extern struct boot_params boot_params; | |||
104 | extern unsigned long _brk_end; | 104 | extern unsigned long _brk_end; |
105 | void *extend_brk(size_t size, size_t align); | 105 | void *extend_brk(size_t size, size_t align); |
106 | 106 | ||
107 | /* | ||
108 | * Reserve space in the brk section. The name must be unique within | ||
109 | * the file, and somewhat descriptive. The size is in bytes. Must be | ||
110 | * used at file scope. | ||
111 | * | ||
112 | * (This uses a temp function to wrap the asm so we can pass it the | ||
113 | * size parameter; otherwise we wouldn't be able to. We can't use a | ||
114 | * "section" attribute on a normal variable because it always ends up | ||
115 | * being @progbits, which ends up allocating space in the vmlinux | ||
116 | * executable.) | ||
117 | */ | ||
118 | #define RESERVE_BRK(name,sz) \ | ||
119 | static void __section(.discard) __used \ | ||
120 | __brk_reservation_fn_##name##__(void) { \ | ||
121 | asm volatile ( \ | ||
122 | ".pushsection .brk_reservation,\"aw\",@nobits;" \ | ||
123 | "__brk_reservation_" #name "__:" \ | ||
124 | " 1:.skip %c0;" \ | ||
125 | " .size __brk_reservation_" #name "__, . - 1b;" \ | ||
126 | " .popsection" \ | ||
127 | : : "i" (sz)); \ | ||
128 | } | ||
129 | |||
107 | #ifdef __i386__ | 130 | #ifdef __i386__ |
108 | 131 | ||
109 | void __init i386_start_kernel(void); | 132 | void __init i386_start_kernel(void); |
@@ -115,6 +138,13 @@ void __init x86_64_start_reservations(char *real_mode_data); | |||
115 | 138 | ||
116 | #endif /* __i386__ */ | 139 | #endif /* __i386__ */ |
117 | #endif /* _SETUP */ | 140 | #endif /* _SETUP */ |
141 | #else | ||
142 | #define RESERVE_BRK(name,sz) \ | ||
143 | .pushsection .brk_reservation,"aw",@nobits; \ | ||
144 | __brk_reservation_##name##__: \ | ||
145 | 1: .skip sz; \ | ||
146 | .size __brk_reservation_##name##__,.-1b; \ | ||
147 | .popsection | ||
118 | #endif /* __ASSEMBLY__ */ | 148 | #endif /* __ASSEMBLY__ */ |
119 | #endif /* __KERNEL__ */ | 149 | #endif /* __KERNEL__ */ |
120 | 150 | ||