summaryrefslogtreecommitdiffstats
path: root/include
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 /include
parent66f4cbdc895260a21e76eeb7769ade2e2dc62213 (diff)
parent0fd5944d521207171d08def9e0a8a1ee49e6359e (diff)
downloadbarebox-ebd6f26412cdc5c123ece13c5df1bf5077dc0633.tar.gz
barebox-ebd6f26412cdc5c123ece13c5df1bf5077dc0633.tar.xz
Merge branch 'for-next/exitcall'
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/barebox.lds.h9
-rw-r--r--include/common.h3
-rw-r--r--include/driver.h5
-rw-r--r--include/init.h15
4 files changed, 24 insertions, 8 deletions
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index 00d6ecaf54..772058e77d 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -38,6 +38,15 @@
KEEP(*(.initcall.13)) \
KEEP(*(.initcall.14))
+#define EXITCALLS \
+ KEEP(*(.exitcall.0)) \
+ KEEP(*(.exitcall.1)) \
+ KEEP(*(.exitcall.2)) \
+ KEEP(*(.exitcall.3)) \
+ KEEP(*(.exitcall.4)) \
+ KEEP(*(.exitcall.5)) \
+ KEEP(*(.exitcall.6))
+
#define BAREBOX_CMDS KEEP(*(SORT_BY_NAME(.barebox_cmd*)))
#define BAREBOX_SYMS KEEP(*(__usymtab))
diff --git a/include/common.h b/include/common.h
index eef371c4bf..6b9dd4d799 100644
--- a/include/common.h
+++ b/include/common.h
@@ -116,7 +116,6 @@ extern int (*barebox_main)(void);
void __noreturn start_barebox(void);
void shutdown_barebox(void);
-extern void (*board_shutdown)(void);
/*
* architectures which have special calling conventions for
@@ -124,8 +123,6 @@ extern void (*board_shutdown)(void);
*/
extern void (*do_execute)(void *func, int argc, char *argv[]);
-void arch_shutdown(void);
-
int run_shell(void);
#ifdef CONFIG_SHELL_HUSH
diff --git a/include/driver.h b/include/driver.h
index 9c6005454c..728f8abb49 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -339,11 +339,6 @@ int mem_memmap(struct cdev *cdev, void **map, int flags);
/* Use this if you have nothing to do in your drivers probe function */
int dummy_probe(struct device_d *);
-/* Iterate over all activated devices (i.e. the ones with drivers and shut
- * them down.
- */
-void devices_shutdown(void);
-
int generic_memmap_ro(struct cdev *dev, void **map, int flags);
int generic_memmap_rw(struct cdev *dev, void **map, int flags);
diff --git a/include/init.h b/include/init.h
index f619c951d3..527d49afec 100644
--- a/include/init.h
+++ b/include/init.h
@@ -7,17 +7,24 @@
#define __init
#define __initdata
#define __initconst
+#define __exit
+#define __exitdata
/* For assembly routines */
#define __BARE_INIT .section ".text_bare_init.text","ax"
#ifndef __ASSEMBLY__
typedef int (*initcall_t)(void);
+typedef void (*exitcall_t)(void);
#define __define_initcall(level,fn,id) \
static initcall_t __initcall_##fn##id __attribute__((__used__)) \
__attribute__((__section__(".initcall." level))) = fn
+#define __define_exitcall(level,fn,id) \
+ static exitcall_t __exitcall_##fn##id __attribute__((__used__)) \
+ __attribute__((__section__(".exitcall." level))) = fn
+
/*
* A "pure" initcall has no dependencies on anything else, and purely
@@ -42,6 +49,14 @@ typedef int (*initcall_t)(void);
#define environment_initcall(fn) __define_initcall("13",fn,13)
#define postenvironment_initcall(fn) __define_initcall("14",fn,14)
+#define early_exitcall(fn) __define_exitcall("0",fn,0)
+#define predevshutdown_exitcall(fn) __define_exitcall("1",fn,1)
+#define devshutdown_exitcall(fn) __define_exitcall("2",fn,2)
+#define postdevshutdown_exitcall(fn) __define_exitcall("3",fn,3)
+#define prearchshutdown_exitcall(fn) __define_exitcall("4",fn,4)
+#define archshutdown_exitcall(fn) __define_exitcall("5",fn,5)
+#define postarchshutdown_exitcall(fn) __define_exitcall("6",fn,6)
+
/* section for code used very early when
* - we're not running from where we linked at
* - bss not cleared