mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] section name cleanup for alpha
@ 2009-04-30 23:00 Tim Abbott
  2009-04-30 23:00 ` [PATCH 1/4] alpha: Use macros for .data.page_aligned Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:00 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Richard Henderson, linux-alpha,
	Tim Abbott

This patch series cleans up the section names on the alpha
architecture.  It requires the architecture-independent macro
definitions from this patch series:

<http://www.spinics.net/lists/mips/msg33499.html>

The long-term goal here is to add support for building the kernel with
-ffunction-sections -fdata-sections.  This requires renaming all the
magic section names in the kernel of the form .text.foo, .data.foo,
.bss.foo, and .rodata.foo to not have collisions with sections
generated for code like:

static int nosave = 0; /* -fdata-sections places in .data.nosave */
static void head(); /* -ffunction-sections places in .text.head */

Note that these patches have not been boot-tested (aside from testing
the analogous changes on x86), since I don't have access to the
appropriate hardware.

	-Tim Abbott

Tim Abbott (4):
  alpha: Use macros for .data.page_aligned.
  alpha: use new macro for .data.cacheline_aligned section.
  alpha: make THREAD_SIZE available to assembly files.
  alpha: use .data.init_task instead of .data.init_thread

 arch/alpha/include/asm/thread_info.h |    4 ++--
 arch/alpha/kernel/init_task.c        |    5 ++---
 arch/alpha/kernel/vmlinux.lds.S      |   19 ++++---------------
 3 files changed, 8 insertions(+), 20 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] alpha: Use macros for .data.page_aligned.
  2009-04-30 23:00 [PATCH 0/4] section name cleanup for alpha Tim Abbott
@ 2009-04-30 23:00 ` Tim Abbott
  2009-04-30 23:00   ` [PATCH 2/4] alpha: use new macro for .data.cacheline_aligned section Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:00 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Richard Henderson, linux-alpha,
	Tim Abbott

.data.page_aligned should not need a separate output section, so as
part of this cleanup I moved into the .data output section in the
linker scripts in order to eliminate unnecessary references to the
section name.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Richard Henderson <rth@twiddle.net>
Cc: linux-alpha@vger.kernel.org
---
 arch/alpha/kernel/vmlinux.lds.S |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index b9d6568..2f33cf9 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -97,11 +97,6 @@ SECTIONS
 		*(.data.init_thread)
 	}
 
-	. = ALIGN(PAGE_SIZE);
-	.data.page_aligned : {
-		*(.data.page_aligned)
-	}
-
 	. = ALIGN(64);
 	.data.cacheline_aligned : {
 		*(.data.cacheline_aligned)
@@ -110,6 +105,7 @@ SECTIONS
 	_data = .;
 	/* Data */
 	.data : {
+		PAGE_ALIGNED_DATA
 		DATA_DATA
 		CONSTRUCTORS
 	}
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] alpha: use new macro for .data.cacheline_aligned section.
  2009-04-30 23:00 ` [PATCH 1/4] alpha: Use macros for .data.page_aligned Tim Abbott
@ 2009-04-30 23:00   ` Tim Abbott
  2009-04-30 23:00     ` [PATCH 3/4] alpha: make THREAD_SIZE available to assembly files Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:00 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Richard Henderson, linux-alpha,
	Tim Abbott

.data.cacheline_aligned should not need a separate output section;
this change moves it into the .data section.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Richard Henderson <rth@twiddle.net>
Cc: linux-alpha@vger.kernel.org
---
 arch/alpha/kernel/vmlinux.lds.S |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 2f33cf9..7acd1eb 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -97,15 +97,11 @@ SECTIONS
 		*(.data.init_thread)
 	}
 
-	. = ALIGN(64);
-	.data.cacheline_aligned : {
-		*(.data.cacheline_aligned)
-	}
-
 	_data = .;
 	/* Data */
 	.data : {
 		PAGE_ALIGNED_DATA
+		CACHELINE_ALIGNED_DATA(64)
 		DATA_DATA
 		CONSTRUCTORS
 	}
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] alpha: make THREAD_SIZE available to assembly files.
  2009-04-30 23:00   ` [PATCH 2/4] alpha: use new macro for .data.cacheline_aligned section Tim Abbott
@ 2009-04-30 23:00     ` Tim Abbott
  2009-04-30 23:00       ` [PATCH 4/4] alpha: use .data.init_task instead of .data.init_thread Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:00 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Richard Henderson, linux-alpha,
	Tim Abbott

This allows THREAD_SIZE to be used in the linker script.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Richard Henderson <rth@twiddle.net>
Cc: linux-alpha@vger.kernel.org
---
 arch/alpha/include/asm/thread_info.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index d069526..a64d74d 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -49,12 +49,12 @@ struct thread_info {
 register struct thread_info *__current_thread_info __asm__("$8");
 #define current_thread_info()  __current_thread_info
 
+#endif /* __ASSEMBLY__ */
+
 /* Thread information allocation.  */
 #define THREAD_SIZE_ORDER 1
 #define THREAD_SIZE (2*PAGE_SIZE)
 
-#endif /* __ASSEMBLY__ */
-
 #define PREEMPT_ACTIVE		0x40000000
 
 /*
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] alpha: use .data.init_task instead of .data.init_thread
  2009-04-30 23:00     ` [PATCH 3/4] alpha: make THREAD_SIZE available to assembly files Tim Abbott
@ 2009-04-30 23:00       ` Tim Abbott
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:00 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Richard Henderson, linux-alpha,
	Tim Abbott

alpha is the only architecture that uses the section name
.data.init_thread instead of .data.init_task.  So convert alpha to use
.data.init_task like everything else.

.data.init_task should not need a separate output section; this change
also moves it into the .data output section.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Richard Henderson <rth@twiddle.net>
Cc: linux-alpha@vger.kernel.org
---
 arch/alpha/kernel/init_task.c   |    5 ++---
 arch/alpha/kernel/vmlinux.lds.S |    7 ++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index c2938e5..475d46a 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -16,6 +16,5 @@ struct task_struct init_task = INIT_TASK(init_task);
 EXPORT_SYMBOL(init_mm);
 EXPORT_SYMBOL(init_task);
 
-union thread_union init_thread_union
-	__attribute__((section(".data.init_thread")))
-	= { INIT_THREAD_INFO(init_task) };
+union thread_union init_thread_union __init_task_data =
+	{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 7acd1eb..caca724 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -1,5 +1,6 @@
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/page.h>
+#include <asm/thread_info.h>
 
 OUTPUT_FORMAT("elf64-alpha")
 OUTPUT_ARCH(alpha)
@@ -92,14 +93,10 @@ SECTIONS
 	__init_end = .;
 	/* Freed after init ends here */
 
-	/* Note 2 page alignment above.  */
-	.data.init_thread : {
-		*(.data.init_thread)
-	}
-
 	_data = .;
 	/* Data */
 	.data : {
+		INIT_TASK_DATA(THREAD_SIZE)
 		PAGE_ALIGNED_DATA
 		CACHELINE_ALIGNED_DATA(64)
 		DATA_DATA
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-30 23:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 23:00 [PATCH 0/4] section name cleanup for alpha Tim Abbott
2009-04-30 23:00 ` [PATCH 1/4] alpha: Use macros for .data.page_aligned Tim Abbott
2009-04-30 23:00   ` [PATCH 2/4] alpha: use new macro for .data.cacheline_aligned section Tim Abbott
2009-04-30 23:00     ` [PATCH 3/4] alpha: make THREAD_SIZE available to assembly files Tim Abbott
2009-04-30 23:00       ` [PATCH 4/4] alpha: use .data.init_task instead of .data.init_thread Tim Abbott

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®