summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-08-06 12:33:06 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-08-06 12:33:06 +0200
commitebd6f26412cdc5c123ece13c5df1bf5077dc0633 (patch)
treed6591766ffc2936ca79e21c1c908cdd1755423e5 /arch
parent66f4cbdc895260a21e76eeb7769ade2e2dc62213 (diff)
parent0fd5944d521207171d08def9e0a8a1ee49e6359e (diff)
downloadbarebox-ebd6f26412cdc5c123ece13c5df1bf5077dc0633.tar.gz
barebox-ebd6f26412cdc5c123ece13c5df1bf5077dc0633.tar.xz
Merge branch 'for-next/exitcall'
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/animeo_ip/init.c2
-rw-r--r--arch/arm/cpu/cpu.c3
-rw-r--r--arch/arm/include/asm/common.h2
-rw-r--r--arch/arm/lib/barebox.lds.S4
-rw-r--r--arch/blackfin/boards/ipe337/barebox.lds.S4
-rw-r--r--arch/blackfin/include/asm/common.h6
-rw-r--r--arch/blackfin/lib/board.c6
-rw-r--r--arch/efi/lib/elf_ia32_efi.lds.S4
-rw-r--r--arch/efi/lib/elf_x86_64_efi.lds.S4
-rw-r--r--arch/mips/lib/barebox.lds.S4
-rw-r--r--arch/nios2/cpu/barebox.lds.S4
-rw-r--r--arch/nios2/lib/board.c4
-rw-r--r--arch/openrisc/cpu/barebox.lds.S4
-rw-r--r--arch/openrisc/lib/board.c4
-rw-r--r--arch/ppc/boards/pcm030/barebox.lds.S5
-rw-r--r--arch/ppc/mach-mpc85xx/barebox.lds.S5
-rw-r--r--arch/sandbox/board/barebox.lds.S5
-rw-r--r--arch/x86/lib/barebox.lds.S9
18 files changed, 60 insertions, 19 deletions
diff --git a/arch/arm/boards/animeo_ip/init.c b/arch/arm/boards/animeo_ip/init.c
index 0fda01363c..2069ab3764 100644
--- a/arch/arm/boards/animeo_ip/init.c
+++ b/arch/arm/boards/animeo_ip/init.c
@@ -346,6 +346,7 @@ static void animeo_ip_shutdown(void)
animeo_ip_shutdown_uart(IOMEM(AT91SAM9260_BASE_US0));
animeo_ip_shutdown_uart(IOMEM(AT91SAM9260_BASE_US1));
}
+postdevshutdown_exitcall(animeo_ip_shutdown);
static int animeo_ip_console_init(void)
{
@@ -353,7 +354,6 @@ static int animeo_ip_console_init(void)
usart0 = at91_register_uart(1, ATMEL_UART_RTS);
usart1 = at91_register_uart(2, ATMEL_UART_RTS);
- board_shutdown = animeo_ip_shutdown;
barebox_set_model("Somfy Animeo IP");
barebox_set_hostname("animeoip");
diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c
index badd676b0d..5e708023e4 100644
--- a/arch/arm/cpu/cpu.c
+++ b/arch/arm/cpu/cpu.c
@@ -93,7 +93,7 @@ void mmu_disable(void)
* This function is called by shutdown_barebox to get a clean
* memory/cache state.
*/
-void arch_shutdown(void)
+static void arch_shutdown(void)
{
uint32_t r;
@@ -108,6 +108,7 @@ void arch_shutdown(void)
r |= PSR_I_BIT;
__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
}
+archshutdown_exitcall(arch_shutdown);
extern unsigned long arm_stack_top;
diff --git a/arch/arm/include/asm/common.h b/arch/arm/include/asm/common.h
index 9ff3b19c7b..07ae619cea 100644
--- a/arch/arm/include/asm/common.h
+++ b/arch/arm/include/asm/common.h
@@ -1,8 +1,6 @@
#ifndef __ASM_ARM_COMMON_H
#define __ASM_ARM_COMMON_H
-#define ARCH_SHUTDOWN
-
static inline unsigned long get_pc(void)
{
unsigned long pc;
diff --git a/arch/arm/lib/barebox.lds.S b/arch/arm/lib/barebox.lds.S
index bb0354ae29..5344557860 100644
--- a/arch/arm/lib/barebox.lds.S
+++ b/arch/arm/lib/barebox.lds.S
@@ -90,6 +90,10 @@ SECTIONS
.barebox_initcalls : { INITCALLS }
__barebox_initcalls_end = .;
+ __barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+
__usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
__usymtab_end = .;
diff --git a/arch/blackfin/boards/ipe337/barebox.lds.S b/arch/blackfin/boards/ipe337/barebox.lds.S
index 9bb7cc4953..51a586af27 100644
--- a/arch/blackfin/boards/ipe337/barebox.lds.S
+++ b/arch/blackfin/boards/ipe337/barebox.lds.S
@@ -76,6 +76,10 @@ SECTIONS
.barebox_initcalls : { INITCALLS }
___barebox_initcalls_end = .;
+ ___barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS }
+ ___barebox_exitcalls_end = .;
+
___usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
___usymtab_end = .;
diff --git a/arch/blackfin/include/asm/common.h b/arch/blackfin/include/asm/common.h
index fa58e372bb..443adf7270 100644
--- a/arch/blackfin/include/asm/common.h
+++ b/arch/blackfin/include/asm/common.h
@@ -1,5 +1 @@
-
-/* We have to disable instruction cache before
- * executing an external program
- */
-#define ARCH_SHUTDOWN
+/* nothing special */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 88ad61871a..3a04f28caf 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -38,7 +38,11 @@ void __noreturn blackfin_start_barebox(void)
start_barebox();
}
-void arch_shutdown(void)
+/* We have to disable instruction cache before
+ * executing an external program
+ */
+static void arch_shutdown(void)
{
icache_disable();
}
+archshutdown_exitcall(arch_shutdown);
diff --git a/arch/efi/lib/elf_ia32_efi.lds.S b/arch/efi/lib/elf_ia32_efi.lds.S
index a5f6287500..69f43f5547 100644
--- a/arch/efi/lib/elf_ia32_efi.lds.S
+++ b/arch/efi/lib/elf_ia32_efi.lds.S
@@ -56,6 +56,10 @@ SECTIONS
__barebox_initcalls : { INITCALLS }
__barebox_initcalls_end = .;
+ __barebox_exitcalls_start = .;
+ __barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+
. = ALIGN(64);
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
diff --git a/arch/efi/lib/elf_x86_64_efi.lds.S b/arch/efi/lib/elf_x86_64_efi.lds.S
index d48432d21b..9aa4e8d829 100644
--- a/arch/efi/lib/elf_x86_64_efi.lds.S
+++ b/arch/efi/lib/elf_x86_64_efi.lds.S
@@ -58,6 +58,10 @@ SECTIONS
__barebox_initcalls : { INITCALLS }
__barebox_initcalls_end = .;
+ __barebox_exitcalls_start = .;
+ __barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+
. = ALIGN(64);
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S
index c690e71976..8057634ddb 100644
--- a/arch/mips/lib/barebox.lds.S
+++ b/arch/mips/lib/barebox.lds.S
@@ -67,6 +67,10 @@ SECTIONS
.barebox_initcalls : { INITCALLS }
__barebox_initcalls_end = .;
+ __barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+
__usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
__usymtab_end = .;
diff --git a/arch/nios2/cpu/barebox.lds.S b/arch/nios2/cpu/barebox.lds.S
index 943c507531..a2d7fa8cdf 100644
--- a/arch/nios2/cpu/barebox.lds.S
+++ b/arch/nios2/cpu/barebox.lds.S
@@ -63,6 +63,10 @@ SECTIONS
.barebox_initcalls : { INITCALLS }
__barebox_initcalls_end = .;
+ __barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+
___usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
___usymtab_end = .;
diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c
index 7c4dc76e87..537675c5d4 100644
--- a/arch/nios2/lib/board.c
+++ b/arch/nios2/lib/board.c
@@ -30,7 +30,3 @@ void __noreturn nios_start_barebox(void)
start_barebox();
}
-
-void arch_shutdown(void)
-{
-}
diff --git a/arch/openrisc/cpu/barebox.lds.S b/arch/openrisc/cpu/barebox.lds.S
index 9c353f30f1..b819ca0996 100644
--- a/arch/openrisc/cpu/barebox.lds.S
+++ b/arch/openrisc/cpu/barebox.lds.S
@@ -65,6 +65,10 @@ SECTIONS
.barebox_initcalls : { INITCALLS } > ram
__barebox_initcalls_end = .;
+ __barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS } > ram
+ __barebox_exitcalls_end = .;
+
___usymtab_start = .;
__usymtab : { BAREBOX_SYMS } > ram
___usymtab_end = .;
diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c
index 98033b42cf..25bcc0517b 100644
--- a/arch/openrisc/lib/board.c
+++ b/arch/openrisc/lib/board.c
@@ -29,7 +29,3 @@ void __noreturn openrisc_start_barebox(void)
start_barebox();
}
-
-void arch_shutdown(void)
-{
-}
diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S
index 1332ad1cbd..0e08e053f7 100644
--- a/arch/ppc/boards/pcm030/barebox.lds.S
+++ b/arch/ppc/boards/pcm030/barebox.lds.S
@@ -112,6 +112,11 @@ SECTIONS
__barebox_initcalls_end = .;
__initcall_entries = (__barebox_initcalls_end - __barebox_initcalls_start) >> 2;
+ __barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+ __exitcall_entries = (__barebox_exitcalls_end - __barebox_exitcalls_start) >> 2;
+
__usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
__usymtab_end = .;
diff --git a/arch/ppc/mach-mpc85xx/barebox.lds.S b/arch/ppc/mach-mpc85xx/barebox.lds.S
index 87ab7acfe2..1f7f52c39c 100644
--- a/arch/ppc/mach-mpc85xx/barebox.lds.S
+++ b/arch/ppc/mach-mpc85xx/barebox.lds.S
@@ -109,6 +109,11 @@ SECTIONS
__barebox_initcalls_end = .;
__initcall_entries = (__barebox_initcalls_end - __barebox_initcalls_start)>>2;
+ __barebox_exitcalls_start = .;
+ .barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+ __exitcall_entries = (__barebox_exitcalls_end - __barebox_exitcalls_start) >> 2;
+
__usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
__usymtab_end = .;
diff --git a/arch/sandbox/board/barebox.lds.S b/arch/sandbox/board/barebox.lds.S
index db5b7deb23..0d67ab6607 100644
--- a/arch/sandbox/board/barebox.lds.S
+++ b/arch/sandbox/board/barebox.lds.S
@@ -8,6 +8,11 @@ SECTIONS
__barebox_initcalls_end = .;
. = ALIGN(64);
+ __barebox_exitcalls_start = .;
+ __barebox_exitcalls : { EXITCALLS }
+ __barebox_exitcalls_end = .;
+
+ . = ALIGN(64);
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
__barebox_magicvar_end = .;
diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index 6cf6b10d1b..23d7546532 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -185,7 +185,14 @@ SECTIONS
. = ALIGN(4);
} > barebox
- .__usymtab : AT ( LOADADDR(.barebox_initcalls) + SIZEOF (.barebox_initcalls) ) {
+ .barebox_exitcalls : AT ( LOADADDR(.barebox_initcalls) + SIZEOF (.barebox_initcalls) ) {
+ __barebox_exitcalls_start = .;
+ EXITCALLS
+ __barebox_exitcalls_end = .;
+ . = ALIGN(4);
+ } > barebox
+
+ .__usymtab : AT ( LOADADDR(.barebox_exitcalls) + SIZEOF (.barebox_exitcalls) ) {
__usymtab_start = .;
BAREBOX_SYMS
__usymtab_end = .;