Commit e4f5cb1a authored by Jonas Gorski's avatar Jonas Gorski Committed by Paul Burton

MIPS: bmips: mark exception vectors as char arrays

The vectors span more than one byte, so mark them as arrays.

Fixes the following build error when building when using GCC 8.3:

In file included from ./include/linux/string.h:19,
                 from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/mips/include/asm/processor.h:15,
                 from ./arch/mips/include/asm/thread_info.h:16,
                 from ./include/linux/thread_info.h:38,
                 from ./include/asm-generic/preempt.h:5,
                 from ./arch/mips/include/generated/asm/preempt.h:1,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/bootmem.h:8,
                 from arch/mips/bcm63xx/prom.c:10:
arch/mips/bcm63xx/prom.c: In function 'prom_init':
./arch/mips/include/asm/string.h:162:11: error: '__builtin_memcpy' forming offset [2, 32] is out of the bounds [0, 1] of object 'bmips_smp_movevec' with type 'char' [-Werror=array-bounds]
   __ret = __builtin_memcpy((dst), (src), __len); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/bcm63xx/prom.c:97:3: note: in expansion of macro 'memcpy'
   memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
   ^~~~~~
In file included from arch/mips/bcm63xx/prom.c:14:
./arch/mips/include/asm/bmips.h:80:13: note: 'bmips_smp_movevec' declared here
 extern char bmips_smp_movevec;

Fixes: 18a1eef9 ("MIPS: BMIPS: Introduce bmips.h")
Signed-off-by: default avatarJonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
parent 8a1bef41
...@@ -84,7 +84,7 @@ void __init prom_init(void) ...@@ -84,7 +84,7 @@ void __init prom_init(void)
* Here we will start up CPU1 in the background and ask it to * Here we will start up CPU1 in the background and ask it to
* reconfigure itself then go back to sleep. * reconfigure itself then go back to sleep.
*/ */
memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20); memcpy((void *)0xa0000200, bmips_smp_movevec, 0x20);
__sync(); __sync();
set_c0_cause(C_SW0); set_c0_cause(C_SW0);
cpumask_set_cpu(1, &bmips_booted_mask); cpumask_set_cpu(1, &bmips_booted_mask);
......
...@@ -75,11 +75,11 @@ static inline int register_bmips_smp_ops(void) ...@@ -75,11 +75,11 @@ static inline int register_bmips_smp_ops(void)
#endif #endif
} }
extern char bmips_reset_nmi_vec; extern char bmips_reset_nmi_vec[];
extern char bmips_reset_nmi_vec_end; extern char bmips_reset_nmi_vec_end[];
extern char bmips_smp_movevec; extern char bmips_smp_movevec[];
extern char bmips_smp_int_vec; extern char bmips_smp_int_vec[];
extern char bmips_smp_int_vec_end; extern char bmips_smp_int_vec_end[];
extern int bmips_smp_enabled; extern int bmips_smp_enabled;
extern int bmips_cpu_offset; extern int bmips_cpu_offset;
......
...@@ -464,10 +464,10 @@ static void bmips_wr_vec(unsigned long dst, char *start, char *end) ...@@ -464,10 +464,10 @@ static void bmips_wr_vec(unsigned long dst, char *start, char *end)
static inline void bmips_nmi_handler_setup(void) static inline void bmips_nmi_handler_setup(void)
{ {
bmips_wr_vec(BMIPS_NMI_RESET_VEC, &bmips_reset_nmi_vec, bmips_wr_vec(BMIPS_NMI_RESET_VEC, bmips_reset_nmi_vec,
&bmips_reset_nmi_vec_end); bmips_reset_nmi_vec_end);
bmips_wr_vec(BMIPS_WARM_RESTART_VEC, &bmips_smp_int_vec, bmips_wr_vec(BMIPS_WARM_RESTART_VEC, bmips_smp_int_vec,
&bmips_smp_int_vec_end); bmips_smp_int_vec_end);
} }
struct reset_vec_info { struct reset_vec_info {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment