[U-Boot] nds32 ptrace register overflow

Macpaul Lin macpaul at gmail.com
Tue Mar 6 03:03:45 CET 2012

Hi Mike,

2012/3/6 Mike Frysinger <vapier at gentoo.org>:
> building for adp-ag101p showed this warning:
>        interrupts.c: In function 'show_regs':
>        interrupts.c:93: warning: array subscript is above array bounds
>        interrupts.c:93: warning: array subscript is above array bounds

Thanks for reporting this.

> but regs->r only has 26 members ...
> arch/nds32/include/asm/ptrace.h:
>        struct pt_regs {

It looks like r26 and r27 are missing here.
Registers r26 and r27 are named P0 and P1.
They are used for OS specifically.
But since all registers are general purposed and the usage between
will affected by toolchain.
Maybe that's why there is no problem when used wrong registers.

>                NDS32_REG r[26];    /* r0 - r25 */
>                NDS32_REG fp;       /* r28 */
>                NDS32_REG gp;       /* r29 */

I'll fix this later.

Best regards,
Macpaul Lin

More information about the U-Boot mailing list