From: gorcunov@gmail.com
To: rth@twiddle.net, chris@zankel.net, jdike@addtoit.com,
linuxppc-dev@ozlabs.org, paulus@samba.org, dhowells@redhat.com,
zippel@linux-m68k.org, geert@linux-m68k.org,
linux-m68k@lists.linux-m68k.org, takata@linux-m32r.org,
linux-m32r@ml.linux-m32r.org, linux-kernel@vger.kernel.org
Cc: gorcunov@gmail.com, sam@ravnborg.org
Subject: [RFC 08/10] um: dyn/uml.lds.S cleanup - use PAGE_SIZE macro
Date: Wed, 27 Feb 2008 23:58:39 +0300 [thread overview]
Message-ID: <20080227210004.189002678@gmail.com> (raw)
In-Reply-To: 20080227205831.150784453@gmail.com
This patch includes page.h header into liker scripts that
allow us to use PAGE_SIZE macro instead of numeric constant.
To be able to include page.h into linker scripts page.h is
needed for some modification - i.e. we need to use __ASSEMBLY__
and _AC macro
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
WARNING: COMPLETELY UNTESTED !!!
arch/um/kernel/dyn.lds.S | 7 ++++---
arch/um/kernel/uml.lds.S | 7 ++++---
include/asm-um/page.h | 17 +++++++++++------
3 files changed, 19 insertions(+), 12 deletions(-)
Index: linux-2.6.git/arch/um/kernel/dyn.lds.S
===================================================================
--- linux-2.6.git.orig/arch/um/kernel/dyn.lds.S 2008-01-29 18:03:46.000000000 +0300
+++ linux-2.6.git/arch/um/kernel/dyn.lds.S 2008-02-27 21:38:48.000000000 +0300
@@ -1,4 +1,5 @@
#include <asm-generic/vmlinux.lds.h>
+#include <asm/page.h>
OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
@@ -21,7 +22,7 @@ SECTIONS
_einittext = .;
}
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
/* Read-only sections, merged into text segment: */
.hash : { *(.hash) }
@@ -68,9 +69,9 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
} =0x90909090
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
.syscall_stub : {
__syscall_stub_start = .;
*(.__syscall_stub*)
Index: linux-2.6.git/arch/um/kernel/uml.lds.S
===================================================================
--- linux-2.6.git.orig/arch/um/kernel/uml.lds.S 2008-01-29 18:03:46.000000000 +0300
+++ linux-2.6.git/arch/um/kernel/uml.lds.S 2008-02-27 21:38:53.000000000 +0300
@@ -1,4 +1,5 @@
#include <asm-generic/vmlinux.lds.h>
+#include <asm/page.h>
OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
@@ -26,7 +27,7 @@ SECTIONS
INIT_TEXT
_einittext = .;
}
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
.text :
{
@@ -39,7 +40,7 @@ SECTIONS
*(.gnu.linkonce.t*)
}
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
.syscall_stub : {
__syscall_stub_start = .;
*(.__syscall_stub*)
@@ -79,7 +80,7 @@ SECTIONS
.sdata : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
- . = ALIGN(0x1000);
+ . = ALIGN(PAGE_SIZE);
.sbss :
{
__bss_start = .;
Index: linux-2.6.git/include/asm-um/page.h
===================================================================
--- linux-2.6.git.orig/include/asm-um/page.h 2008-02-09 12:09:29.000000000 +0300
+++ linux-2.6.git/include/asm-um/page.h 2008-02-27 21:42:17.000000000 +0300
@@ -7,16 +7,20 @@
#ifndef __UM_PAGE_H
#define __UM_PAGE_H
-struct page;
-
-#include <linux/types.h>
-#include <asm/vm-flags.h>
+#include <linux/const.h>
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
+#ifndef __ASSEMBLY__
+
+struct page;
+
+#include <linux/types.h>
+#include <asm/vm-flags.h>
+
/*
* These are used to make use of C type-checking..
*/
@@ -120,4 +124,5 @@ extern struct page *arch_validate(struct
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
-#endif
+#endif /* __ASSEMBLY__ */
+#endif /* __UM_PAGE_H */
--
next prev parent reply other threads:[~2008-02-27 21:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-27 20:58 [RFC 00/10] vmlinux.lds cleanup gorcunov
2008-02-27 20:58 ` [RFC 01/10] arm: vmlinux.lds.S cleanup - use PERCPU, PAGE_SIZE macroses gorcunov
2008-02-27 20:58 ` [RFC 02/10] m32r: vmlinux.lds.S cleanup - use PAGE_SIZE, THREAD_SIZE macroses gorcunov
2008-02-27 20:58 ` [RFC 03/10] m68k: vmlinux-std/sun3.lds.S cleanup - use PAGE_SIZE macro gorcunov
2008-02-27 20:58 ` [RFC 04/10] m68knommu: vmlinux.lds " gorcunov
2008-02-27 20:58 ` [RFC 05/10] mn10300: vmlinux.lds.S cleanup - use PAGE_SIZE, PERCPU macroses gorcunov
2008-02-27 20:58 ` [RFC 06/10] powerpc: vmlinux.lds.S cleanup - use PERCPU, THREAD_SIZE macroses gorcunov
2008-02-27 20:58 ` [RFC 07/10] ppc: vmlinux.lds.S cleanup - use PAGE_SIZE macro gorcunov
2008-02-27 20:58 ` gorcunov [this message]
2008-02-29 15:43 ` [RFC 08/10] um: dyn/uml.lds.S " Jeff Dike
2008-03-01 15:35 ` Cyrill Gorcunov
2008-02-27 20:58 ` [RFC 09/10] alpha: vmlinux.lds cleanup - use THREAD_SIZE macro gorcunov
2008-02-27 20:58 ` [RFC 10/10] xtensa: vmlinux.lds.S - use PAGE_SIZE, THREAD_SIZE macroses gorcunov
2008-02-28 12:50 ` [RFC 05/10] mn10300: vmlinux.lds.S cleanup - use PAGE_SIZE, PERCPU macroses David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080227210004.189002678@gmail.com \
--to=gorcunov@gmail.com \
--cc=chris@zankel.net \
--cc=dhowells@redhat.com \
--cc=geert@linux-m68k.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m32r@ml.linux-m32r.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=rth@twiddle.net \
--cc=sam@ravnborg.org \
--cc=takata@linux-m32r.org \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).