All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: add RESERVE_BRK_ARRAY() helper
@ 2010-09-03  2:35 Jeremy Fitzhardinge
  2010-10-06  6:04 ` [tip:x86/mm] x86, mm: Add " tip-bot for Jeremy Fitzhardinge
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2010-09-03  2:35 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]



Useful when converting static arrays into boot-time brk allocated objects.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.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);



[-- Attachment #2: x86-brk-array.patch --]
[-- Type: text/plain, Size: 865 bytes --]

From 900d977e6ce004c59b986a494838daddecbe106a Mon Sep 17 00:00:00 2001
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Date: Thu, 26 Aug 2010 15:31:36 -0700
Subject: [PATCH] x86: add RESERVE_BRK_ARRAY() helper

Useful when converting static arrays into boottime brk allocated objects.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-06  6:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03  2:35 [PATCH] x86: add RESERVE_BRK_ARRAY() helper Jeremy Fitzhardinge
2010-10-06  6:04 ` [tip:x86/mm] x86, mm: Add " tip-bot for Jeremy Fitzhardinge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.