]> git.sur5r.net Git - u-boot/blobdiff - common/init/board_init.c
tools: sunxi: avoid read after end of string
[u-boot] / common / init / board_init.c
index d98648eaa6fc26fbb9836622fbfee2552534d826..bf4255b4aebaf2382fddf3d59bd349d33f2584e2 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/*
- * It isn't trivial to figure out whether memcpy() exists. The arch-specific
- * memcpy() is not normally available in SPL due to code size.
- */
-#if !defined(CONFIG_SPL_BUILD) || \
-               (defined(CONFIG_SPL_LIBGENERIC_SUPPORT) && \
-               !defined(CONFIG_USE_ARCH_MEMSET))
-#define _USE_MEMCPY
-#endif
-
 /* Unfortunately x86 or ARM can't compile this code as gd cannot be assigned */
 #if !defined(CONFIG_X86) && !defined(CONFIG_ARM)
 __weak void arch_setup_gd(struct global_data *gd_ptr)
@@ -110,9 +100,6 @@ ulong board_init_f_alloc_reserve(ulong top)
 void board_init_f_init_reserve(ulong base)
 {
        struct global_data *gd_ptr;
-#ifndef _USE_MEMCPY
-       int *ptr;
-#endif
 
        /*
         * clear GD entirely and set it up.
@@ -121,14 +108,9 @@ void board_init_f_init_reserve(ulong base)
 
        gd_ptr = (struct global_data *)base;
        /* zero the area */
-#ifdef _USE_MEMCPY
        memset(gd_ptr, '\0', sizeof(*gd));
-#else
-       for (ptr = (int *)gd_ptr; ptr < (int *)(gd_ptr + 1); )
-               *ptr++ = 0;
-#endif
        /* set GD unless architecture did it already */
-#if !defined(CONFIG_X86) && !defined(CONFIG_ARM)
+#if !defined(CONFIG_ARM)
        arch_setup_gd(gd_ptr);
 #endif
        /* next alloc will be higher by one GD plus 16-byte alignment */
@@ -146,3 +128,8 @@ void board_init_f_init_reserve(ulong base)
        base += CONFIG_SYS_MALLOC_F_LEN;
 #endif
 }
+
+/*
+ * Board-specific Platform code can reimplement show_boot_progress () if needed
+ */
+__weak void show_boot_progress(int val) {}