This allow modules to set initializer functions.
This is used by Gcc instrumentation code for profiling arcs and test
coverage.
scrub_heap_pages();
*/
+ init_constructors();
+
console_endboot();
/* Hide UART from DOM0 if we're using it */
*(.init.data)
*(.init.data.rel)
*(.init.data.rel.*)
+
+ . = ALIGN(4);
+ __CTOR_LIST__ = .;
+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
+ *(.ctors)
+ LONG(0)
+ __CTOR_END__ = .;
} :text
. = ALIGN(32);
.init.setup : {
init_trace_bufs();
+ init_constructors();
+
console_endboot();
/* Hide UART from DOM0 if we're using it */
__trampoline_seg_start = .;
*(.trampoline_seg)
__trampoline_seg_stop = .;
+
+ . = ALIGN(8);
+ __CTOR_LIST__ = .;
+ QUAD((__CTOR_END__ - __CTOR_LIST__) / 8 - 2)
+ *(.ctors)
+ QUAD(0)
+ __CTOR_END__ = .;
} :text
. = ALIGN(32);
.init.setup : {
#include <xen/ctype.h>
#include <xen/lib.h>
#include <xen/types.h>
+#include <xen/init.h>
#include <asm/byteorder.h>
/* for ctype.h */
return ret;
}
+extern const struct
+{
+ unsigned long count;
+ void (*funcs[1])(void);
+} __CTOR_LIST__;
+
+void __init init_constructors(void)
+{
+ unsigned long n;
+ for ( n = 0; n < __CTOR_LIST__.count; ++n )
+ __CTOR_LIST__.funcs[n]();
+}
+
/*
* Local variables:
* mode: C
struct cpu_user_regs;
void dump_execstate(struct cpu_user_regs *);
+void init_constructors(void);
+
#endif /* __LIB_H__ */