2009-05-01 00:07:38

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 0/3] section name cleanup for xtensa

This patch series cleans up the section names on the xtensa
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 (3):
xtensa: Use macros for .bss.page_aligned section.
xtensa: use new macro for .data.cacheline_aligned section.
xtensa: use new macros for .data.init_task.

arch/xtensa/kernel/head.S | 2 +-
arch/xtensa/kernel/init_task.c | 3 +--
arch/xtensa/kernel/vmlinux.lds.S | 10 +++-------
3 files changed, 5 insertions(+), 10 deletions(-)


2009-05-01 00:06:59

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 2/3] xtensa: use new macro for .data.cacheline_aligned section.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Chris Zankel <[email protected]>
---
arch/xtensa/kernel/vmlinux.lds.S | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index f96f354..165a980 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -123,8 +123,7 @@ SECTIONS
{
DATA_DATA
CONSTRUCTORS
- . = ALIGN(XCHAL_ICACHE_LINESIZE);
- *(.data.cacheline_aligned)
+ CACHELINE_ALIGNED_DATA(XCHAL_ICACHE_LINESIZE)
}

_edata = .;
--
1.6.2.1

2009-05-01 00:17:18

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 1/3] xtensa: Use macros for .bss.page_aligned section.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Chris Zankel <[email protected]>
---
arch/xtensa/kernel/head.S | 2 +-
arch/xtensa/kernel/vmlinux.lds.S | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index d9ddc1b..d215adc 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -235,7 +235,7 @@ should_never_return:
* BSS section
*/

-.section ".bss.page_aligned", "w"
+__PAGE_ALIGNED_BSS
#ifdef CONFIG_MMU
ENTRY(swapper_pg_dir)
.fill PAGE_SIZE, 1, 0
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 5accf51..f96f354 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -262,7 +262,7 @@ SECTIONS

/* BSS section */
_bss_start = .;
- .bss : { *(.bss.page_aligned) *(.bss) }
+ .bss : { PAGE_ALIGNED_BSS *(.bss) }
_bss_end = .;

_end = .;
--
1.6.2.1

2009-05-01 00:18:01

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 3/3] xtensa: use new macros for .data.init_task.

.data.init_task should not need a separate output section; this change
moves it into the .data section. Also replace aligment of 8192 with
THREAD_SIZE (=8192).

Signed-off-by: Tim Abbott <[email protected]>
Cc: Chris Zankel <[email protected]>
---
arch/xtensa/kernel/init_task.c | 3 +--
arch/xtensa/kernel/vmlinux.lds.S | 5 +----
2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c
index e07f5c9..dfda282 100644
--- a/arch/xtensa/kernel/init_task.c
+++ b/arch/xtensa/kernel/init_task.c
@@ -27,8 +27,7 @@ struct mm_struct init_mm = INIT_MM(init_mm);

EXPORT_SYMBOL(init_mm);

-union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+union thread_union init_thread_union __init_task_data =
{ INIT_THREAD_INFO(init_task) };

struct task_struct init_task = INIT_TASK(init_task);
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 165a980..3eacf74 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -121,6 +121,7 @@ SECTIONS
_fdata = .;
.data :
{
+ INIT_TASK_DATA(THREAD_SIZE)
DATA_DATA
CONSTRUCTORS
CACHELINE_ALIGNED_DATA(XCHAL_ICACHE_LINESIZE)
@@ -128,10 +129,6 @@ SECTIONS

_edata = .;

- /* The initial task */
- . = ALIGN(8192);
- .data.init_task : { *(.data.init_task) }
-
/* Initialization code and data: */

. = ALIGN(1 << 12);
--
1.6.2.1