2009-04-30 23:42:52

by Tim Abbott

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

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

arch/avr32/kernel/init_task.c | 3 +--
arch/avr32/kernel/vmlinux.lds.S | 8 +++-----
arch/avr32/mm/init.c | 4 +---
3 files changed, 5 insertions(+), 10 deletions(-)


2009-04-30 23:43:15

by Tim Abbott

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

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

diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index 36d676f..21fb7b2 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -101,8 +101,7 @@ SECTIONS
PAGE_ALIGNED_DATA

/* Then, the cacheline aligned data */
- . = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)

/* And the rest... */
*(.data.rel*)
--
1.6.2.1

2009-04-30 23:43:29

by Tim Abbott

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

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

diff --git a/arch/avr32/kernel/init_task.c b/arch/avr32/kernel/init_task.c
index 993d56e..3533d6f 100644
--- a/arch/avr32/kernel/init_task.c
+++ b/arch/avr32/kernel/init_task.c
@@ -22,8 +22,7 @@ EXPORT_SYMBOL(init_mm);
/*
* Initial thread structure. Must be aligned on an 8192-byte boundary.
*/
-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) };

/*
diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index 21fb7b2..2789c60 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -95,7 +95,7 @@ SECTIONS
/*
* First, the init task union, aligned to an 8K boundary.
*/
- *(.data.init_task)
+ INIT_TASK_DATA(THREAD_SIZE)

/* Then, the page-aligned data */
PAGE_ALIGNED_DATA
--
1.6.2.1

2009-04-30 23:46:00

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 1/3] avr32: Use standard macros for .data.page_aligned section.

Signed-off-by: Tim Abbott <[email protected]>
Acked-by: Haavard Skinnemoen <[email protected]>
---
arch/avr32/kernel/vmlinux.lds.S | 3 +--
arch/avr32/mm/init.c | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index 7910d41..36d676f 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -98,8 +98,7 @@ SECTIONS
*(.data.init_task)

/* Then, the page-aligned data */
- . = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ PAGE_ALIGNED_DATA

/* Then, the cacheline aligned data */
. = ALIGN(L1_CACHE_BYTES);
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index e819fa6..cc60d10 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -24,11 +24,9 @@
#include <asm/setup.h>
#include <asm/sections.h>

-#define __page_aligned __attribute__((section(".data.page_aligned")))
-
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);

-pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned;
+pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_data;

struct page *empty_zero_page;
EXPORT_SYMBOL(empty_zero_page);
--
1.6.2.1