[RFC 04/10] m68knommu: vmlinux.lds cleanup - use PAGE_SIZE macro

From: gorcunov
Date: Wed Feb 27 2008 - 16:01:24 EST


This patch modifies page.h header to be able to include it
into linker script and then we're able to use PAGE_SIZE in
vmlinux.lds

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
---

WARNING: COMPLETELY UNTESTED !!!

arch/m68knommu/kernel/vmlinux.lds.S | 5 +++--
include/asm-m68knommu/page.h | 6 ++++--
2 files changed, 7 insertions(+), 4 deletions(-)

Index: linux-2.6.git/arch/m68knommu/kernel/vmlinux.lds.S
===================================================================
--- linux-2.6.git.orig/arch/m68knommu/kernel/vmlinux.lds.S 2008-02-10 10:46:37.000000000 +0300
+++ linux-2.6.git/arch/m68knommu/kernel/vmlinux.lds.S 2008-02-27 21:24:46.000000000 +0300
@@ -8,6 +8,7 @@
*/

#include <asm-generic/vmlinux.lds.h>
+#include <asm/page.h>

#if defined(CONFIG_RAMKERNEL)
#define RAM_START CONFIG_KERNELBASE
@@ -140,7 +141,7 @@ SECTIONS {
} > DATA

.init : {
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
__init_begin = .;
_sinittext = .;
INIT_TEXT
@@ -165,7 +166,7 @@ SECTIONS {
*(.init.ramfs)
__initramfs_end = .;
#endif
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
__init_end = .;
} > INIT

Index: linux-2.6.git/include/asm-m68knommu/page.h
===================================================================
--- linux-2.6.git.orig/include/asm-m68knommu/page.h 2008-02-10 12:03:48.000000000 +0300
+++ linux-2.6.git/include/asm-m68knommu/page.h 2008-02-27 21:19:37.000000000 +0300
@@ -1,16 +1,18 @@
#ifndef _M68KNOMMU_PAGE_H
#define _M68KNOMMU_PAGE_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))

#include <asm/setup.h>

#ifndef __ASSEMBLY__
-
+
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
#define free_user_page(page, addr) free_page(addr)


--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/