Fix undefined reference to tmp' in function load_kernel.constprop.0':

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-11-04 23:20:52 +08:00 committed by Petro Karashchenko
parent 206e2a8eec
commit bc04edecc1

View File

@ -109,7 +109,6 @@ static struct
****************************************************************************/ ****************************************************************************/
static char copybuf[512]; static char copybuf[512];
static void *tmp;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@ -265,8 +264,7 @@ err:
static void load_kernel(const char *name, const char *devname) static void load_kernel(const char *name, const char *devname)
{ {
int i; int i;
void *tmp = (void *)0x02040000;
tmp = (void *)0x02040000;
blk_read(tmp, 512 * 1024, devname, 0); blk_read(tmp, 512 * 1024, devname, 0);
@ -287,10 +285,9 @@ static void load_kernel(const char *name, const char *devname)
__asm__ __volatile__ __asm__ __volatile__
( (
"ldr r0, =tmp\n" "ldr sp, [%0, #0]\n" /* set sp */
"ldr r1, [r0, #0]\n" /* r1 = 0x02040000 */ "ldr pc, [%0, #4]" /* set pc, start nuttx */
"ldr sp, [r1, #0]\n" /* set sp */ : : "r"(tmp)
"ldr pc, [r1, #4]" /* set pc, start nuttx */
); );
} }