[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
- To: Sam Ravnborg <sam@xxxxxxxxxxxx>
- Subject: [microblaze-uclinux] [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
- From: Tim Abbott <tabbott@xxxxxxx>
- Date: Thu, 30 Apr 2009 15:54:08 -0400
- Cc: Linux kernel mailing list <linux-kernel@xxxxxxxxxxxxxxx>, Anders Kaseorg <andersk@xxxxxxx>, Waseem Daher <wdaher@xxxxxxx>, Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>, Jeff Arnold <jbarnold@xxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Bryan Wu <cooloney@xxxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Cyrill Gorcunov <gorcunov@xxxxxxxxxx>, David Howells <dhowells@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, dev-etrax@xxxxxxxx, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Greg Ungerer <gerg@xxxxxxxxxxx>, Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Hirokazu Takata <takata@xxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Jeff Dike <jdike@xxxxxxxxxxx>, Jesper Nilsson <jesper.nilsson@xxxxxxxx>, Kyle McMartin <kyle@xxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, microblaze-uclinux@xxxxxxxxxxxxxx, Mikael Starvik <starvik@xxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Paul Mundt <lethal@xxxxxxxxxxxx>, Ralf Baechle <ralf@xxxxxxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>, Roman Zippel <zippel@xxxxxxxxxxxxxx>, Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx, user-mode-linux-devel@xxxxxxxxxxxxxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Tim Abbott <tabbott@xxxxxxx>, Sam Ravnborg <sam@xxxxxxxxxxxx>
- In-reply-to: <1241121253-32341-1-git-send-email-tabbott@xxxxxxx>
- References: <1241121253-32341-1-git-send-email-tabbott@xxxxxxx>
- Reply-to: microblaze-uclinux@xxxxxxxxxxxxxx
- Sender: owner-microblaze-uclinux@xxxxxxxxxxxxxxxxxxxx
This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.
The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections. This requires renaming all magic sections with names
of the form ".data.foo".
Signed-off-by: Tim Abbott <tabbott@xxxxxxx>
Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
Acked-by: David Howells <dhowells@xxxxxxxxxx>
---
include/asm-generic/vmlinux.lds.h | 8 ++++++++
include/linux/linkage.h | 9 +++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..3d88c87 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,14 @@
FTRACE_EVENTS() \
TRACE_SYSCALLS()
+#define PAGE_ALIGNED_DATA \
+ . = ALIGN(PAGE_SIZE); \
+ *(.data.page_aligned)
+
+#define PAGE_ALIGNED_BSS \
+ . = ALIGN(PAGE_SIZE); \
+ *(.bss.page_aligned)
+
#define RO_DATA(align) \
. = ALIGN((align)); \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..af051fc 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE)
/*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw", @progbits
+#define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw", @nobits
+
+/*
* This is used by architectures to keep arguments on the stack
* untouched by the compiler by keeping them live until the end.
* The argument stack may be owned by the assembly-language
--
1.6.2.1
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/