//
//==========================================================================
+#include <stdlib.h>
#define DEFINE_VARS
#include <redboot.h>
#include <cyg/hal/hal_arch.h>
}
return false;
}
+
+static unsigned long random;
+/* provide at least _some_ sort of randomness */
+#define MAX_LOOPS 1000
+
+extern unsigned int hal_timer_count(void);
+
+static void random_init(void)
+{
+ unsigned int timer;
+ int i;
+
+ unsigned int start = hal_timer_count();
+
+ start = hal_timer_count();
+ for (i = 0; i < MAX_LOOPS; i++) {
+ timer = hal_timer_count();
+ srand(random + timer);
+ random = rand();
+ }
+}
+RedBoot_init(random_init, RedBoot_INIT_FIRST);