public inbox for linux-kernel@vger.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

* [tip:x86/mm] x86, mm: Add RESERVE_BRK_ARRAY() helper
  2010-09-03  2:35 [PATCH] x86: add RESERVE_BRK_ARRAY() helper Jeremy Fitzhardinge
@ 2010-10-06  6:04 ` tip-bot for Jeremy Fitzhardinge
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Jeremy Fitzhardinge @ 2010-10-06  6:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, jeremy, hpa, mingo, tglx, jeremy.fitzhardinge

Commit-ID:  161b0275e2311b8bd9609d5f32e2b703cf5d70a8
Gitweb:     http://git.kernel.org/tip/161b0275e2311b8bd9609d5f32e2b703cf5d70a8
Author:     Jeremy Fitzhardinge <jeremy@goop.org>
AuthorDate: Thu, 2 Sep 2010 19:35:22 -0700
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 5 Oct 2010 22:16:54 -0700

x86, mm: Add RESERVE_BRK_ARRAY() helper

This is useful when converting static arrays into boot-time brk
allocated objects.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
LKML-Reference: <4C805EEA.1080205@goop.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/include/asm/setup.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index ef292c7..d6763b1 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -93,6 +93,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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox