[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C805EEA.1080205@goop.org>
Date: Thu, 02 Sep 2010 19:35:22 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: "H. Peter Anvin" <hpa@...or.com>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: add RESERVE_BRK_ARRAY() helper
Useful when converting static arrays into boot-time brk allocated objects.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 4093d1e..632cafd 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -126,6 +126,11 @@ void *extend_brk(size_t size, size_t align);
: : "i" (sz)); \
}
+/* Helper for reserving space for arrays of things */
+#define RESERVE_BRK_ARRAY(type, name, entries) \
+ type *name; \
+ RESERVE_BRK(name, sizeof(type) * entries)
+
#ifdef __i386__
void __init i386_start_kernel(void);
View attachment "x86-brk-array.patch" of type "text/plain" (865 bytes)
Powered by blists - more mailing lists