* [PATCH 0/3] Linker script cleanup patches for score
@ 2009-09-20 17:32 Tim Abbott
2009-09-20 17:32 ` [PATCH 1/3] score: Make PAGE_SIZE available to assembly Tim Abbott
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Tim Abbott @ 2009-09-20 17:32 UTC (permalink / raw)
To: Chen Liqin, Lennox Wu; +Cc: linux-kernel, Sam Ravnborg, Tim Abbott
This patch series cleans up the linker script for the score
architecture to use the new linker script macros merged in 2.6.31.
I'd love to see these included in 2.6.32 (Sorry that these are coming
so late -- I had missed the score architecture being merged.)
While the changes are pretty straightforward, note that these patches
haven't been tested at all (I don't have an appropriate cross
compiler).
This cross-architecture linker script cleanup project is in
preparation for adding support for building the kernel with
-ffunction-sections -fdata-sections, which is a prerequisite for
Ksplice.
-Tim Abbott
Tim Abbott (3):
score: Make PAGE_SIZE available to assembly.
Make THREAD_SIZE available to assembly files.
score: Cleanup linker script using new macros.
arch/score/include/asm/page.h | 3 +-
arch/score/include/asm/thread_info.h | 15 ++++---
arch/score/kernel/vmlinux.lds.S | 75 +++------------------------------
3 files changed, 18 insertions(+), 75 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] score: Make PAGE_SIZE available to assembly.
2009-09-20 17:32 [PATCH 0/3] Linker script cleanup patches for score Tim Abbott
@ 2009-09-20 17:32 ` Tim Abbott
2009-09-20 17:39 ` Sam Ravnborg
2009-09-20 17:32 ` [PATCH 2/3] Make THREAD_SIZE available to assembly files Tim Abbott
2009-09-20 17:32 ` [PATCH 3/3] score: Cleanup linker script using new macros Tim Abbott
2 siblings, 1 reply; 7+ messages in thread
From: Tim Abbott @ 2009-09-20 17:32 UTC (permalink / raw)
To: Chen Liqin, Lennox Wu; +Cc: linux-kernel, Sam Ravnborg, Tim Abbott
Signed-off-by: Tim Abbott <tabbott@ksplice.com>
---
arch/score/include/asm/page.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/score/include/asm/page.h b/arch/score/include/asm/page.h
index ee58210..d92a5a2 100644
--- a/arch/score/include/asm/page.h
+++ b/arch/score/include/asm/page.h
@@ -2,10 +2,11 @@
#define _ASM_SCORE_PAGE_H
#include <linux/pfn.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))
#ifdef __KERNEL__
--
1.6.3.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] Make THREAD_SIZE available to assembly files.
2009-09-20 17:32 [PATCH 0/3] Linker script cleanup patches for score Tim Abbott
2009-09-20 17:32 ` [PATCH 1/3] score: Make PAGE_SIZE available to assembly Tim Abbott
@ 2009-09-20 17:32 ` Tim Abbott
2009-09-20 17:40 ` Sam Ravnborg
2009-09-20 17:32 ` [PATCH 3/3] score: Cleanup linker script using new macros Tim Abbott
2 siblings, 1 reply; 7+ messages in thread
From: Tim Abbott @ 2009-09-20 17:32 UTC (permalink / raw)
To: Chen Liqin, Lennox Wu; +Cc: linux-kernel, Sam Ravnborg, Tim Abbott
Signed-off-by: Tim Abbott <tabbott@ksplice.com>
---
arch/score/include/asm/thread_info.h | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h
index 3a11228..5593999 100644
--- a/arch/score/include/asm/thread_info.h
+++ b/arch/score/include/asm/thread_info.h
@@ -7,6 +7,15 @@
#define KU_USER 0x08
#define KU_KERN 0x00
+#include <asm/page.h>
+#include <linux/const.h>
+
+/* thread information allocation */
+#define THREAD_SIZE_ORDER (1)
+#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
+#define THREAD_MASK (THREAD_SIZE - _AC(1,UL))
+#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
+
#ifndef __ASSEMBLY__
#include <asm/processor.h>
@@ -62,12 +71,6 @@ struct thread_info {
register struct thread_info *__current_thread_info __asm__("r28");
#define current_thread_info() __current_thread_info
-/* thread information allocation */
-#define THREAD_SIZE_ORDER (1)
-#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
-#define THREAD_MASK (THREAD_SIZE - 1UL)
-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-
#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
#define free_thread_info(info) kfree(info)
--
1.6.3.3
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 3/3] score: Cleanup linker script using new macros.
2009-09-20 17:32 [PATCH 0/3] Linker script cleanup patches for score Tim Abbott
2009-09-20 17:32 ` [PATCH 1/3] score: Make PAGE_SIZE available to assembly Tim Abbott
2009-09-20 17:32 ` [PATCH 2/3] Make THREAD_SIZE available to assembly files Tim Abbott
@ 2009-09-20 17:32 ` Tim Abbott
2009-09-20 17:41 ` Sam Ravnborg
2 siblings, 1 reply; 7+ messages in thread
From: Tim Abbott @ 2009-09-20 17:32 UTC (permalink / raw)
To: Chen Liqin, Lennox Wu; +Cc: linux-kernel, Sam Ravnborg, Tim Abbott
Signed-off-by: Tim Abbott <tabbott@ksplice.com>
---
arch/score/kernel/vmlinux.lds.S | 75 ++++-----------------------------------
1 files changed, 7 insertions(+), 68 deletions(-)
diff --git a/arch/score/kernel/vmlinux.lds.S b/arch/score/kernel/vmlinux.lds.S
index f855698..aab4703 100644
--- a/arch/score/kernel/vmlinux.lds.S
+++ b/arch/score/kernel/vmlinux.lds.S
@@ -49,21 +49,9 @@ SECTIONS
. = ALIGN(16);
RODATA
- /* Exception table */
- . = ALIGN(16);
- __ex_table : {
- __start___ex_table = .;
- *(__ex_table)
- __stop___ex_table = .;
- }
+ EXCEPTION_TABLE(16)
- /* writeable */
- .data ALIGN (4096): {
- *(.data.init_task)
-
- DATA_DATA
- CONSTRUCTORS
- }
+ RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
@@ -72,45 +60,14 @@ SECTIONS
.sdata : {
*(.sdata)
}
-
- . = ALIGN(32);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
- }
_edata = .; /* End of data section */
/* will be freed after init */
- . = ALIGN(4096); /* Init code and data */
+ . = ALIGN(PAGE_SIZE); /* Init code and data */
__init_begin = .;
- . = ALIGN(4096);
- .init.text : {
- _sinittext = .;
- INIT_TEXT
- _einittext = .;
- }
- .init.data : {
- INIT_DATA
- }
- . = ALIGN(16);
- .init.setup : {
- __setup_start = .;
- *(.init.setup)
- __setup_end = .;
- }
-
- .initcall.init : {
- __initcall_start = .;
- INITCALLS
- __initcall_end = .;
- }
-
- .con_initcall.init : {
- __con_initcall_start = .;
- *(.con_initcall.init)
- __con_initcall_end = .;
- }
- SECURITY_INIT
+ INIT_TEXT_SECTION(PAGE_SIZE)
+ INIT_DATA_SECTION(16)
/* .exit.text is discarded at runtime, not link time, to deal with
* references from .rodata
@@ -121,28 +78,10 @@ SECTIONS
.exit.data : {
EXIT_DATA
}
-#if defined(CONFIG_BLK_DEV_INITRD)
- .init.ramfs ALIGN(4096): {
- __initramfs_start = .;
- *(.init.ramfs)
- __initramfs_end = .;
- . = ALIGN(4);
- LONG(0);
- }
-#endif
- . = ALIGN(4096);
+ . = ALIGN(PAGE_SIZE);
__init_end = .;
/* freed after init ends here */
- __bss_start = .; /* BSS */
- .sbss : {
- *(.sbss)
- *(.scommon)
- }
- .bss : {
- *(.bss)
- *(COMMON)
- }
- __bss_stop = .;
+ BSS_SECTION(0, 0, 0)
_end = .;
}
--
1.6.3.3
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-09-20 17:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-20 17:32 [PATCH 0/3] Linker script cleanup patches for score Tim Abbott
2009-09-20 17:32 ` [PATCH 1/3] score: Make PAGE_SIZE available to assembly Tim Abbott
2009-09-20 17:39 ` Sam Ravnborg
2009-09-20 17:32 ` [PATCH 2/3] Make THREAD_SIZE available to assembly files Tim Abbott
2009-09-20 17:40 ` Sam Ravnborg
2009-09-20 17:32 ` [PATCH 3/3] score: Cleanup linker script using new macros Tim Abbott
2009-09-20 17:41 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®