int main(void)
{
- /* Initialize basic board support */
- board_init();
-
puts("\n\nCompal DSP data dumper\n");
puts(hr);
int main(void)
{
- board_init();
puts("\n\nHello World from " __FILE__ " program code\n");
puts(hr);
/* Dump device identification */
int main(void)
{
- board_init();
puts("\n\nHello World from " __FILE__ " program code\n");
puts(hr);
int main(void)
{
- board_init();
puts("\n\nHello World from " __FILE__ " program code\n");
puts(hr);
#include <stdio.h>
#include <debug.h>
+#include <ctors.h>
#include <memory.h>
#include <board.h>
#include <keypad.h>
writew(reg, ARMIO_LATCH_OUT);
}
-void board_init(void)
+static void __ctor_board board_init(void)
{
/* FIXME: this needs to go to board_e99/init.c once we have it */
wdog_enable(0);
#include <stdio.h>
#include <debug.h>
+#include <ctors.h>
#include <memory.h>
#include <board.h>
#include <keypad.h>
writew(reg, ARMIO_LATCH_OUT);
}
-void board_init(void)
+static void __ctor_board board_init(void)
{
/* FIXME: this needs to go to board_e99/init.c once we have it */
wdog_enable(0);
#include <stdio.h>
#include <debug.h>
+#include <ctors.h>
#include <memory.h>
#include <board.h>
#include <keypad.h>
writew(reg, ARMIO_LATCH_OUT);
}
-void board_init(void)
+static void __ctor_board board_init(void)
{
/* FIXME: this needs to go to board_e99/init.c once we have it */
wdog_enable(0);
#ifndef _BOARD_H
#define _BOARD_H
-void board_init(void);
-
extern const char *target_board;
#endif /* _BOARD_H */
#ifndef _CTORS_H
#define _CTORS_H
+#if 0
+/* only supported by gcc 3.4 or later */
+#define __ctor_data __attribute__ ((constructor) (100))
+#define __ctor_board __attribute__ ((constructor) (200))
+#else
+#define __ctor_data __attribute__ ((constructor))
+#define __ctor_board __attribute__ ((constructor))
+#endif
+
/* iterate over list of constructor functions and call each element */
void do_global_ctors(const char *ctors_start, const char *ctors_end);