void trampoline_entry(void
*
boot_image, void
*
boot_args)
{
extern uint64_t __bss_start[] __asm__(
"section$start$__DATA$__common"
),
__bss_end[] __asm__(
"segment$end$__DATA"
);
if
(__bss_start[
0
]
=
=
0x746F6F626F747561
) {
uint32_t autoboot_sz
=
(uint32_t)(__bss_start[
1
]);
extern volatile void smemcpy128(void
*
,void
*
,uint32_t);
smemcpy128 ((void
*
)
0x818e00000
, __bss_start, (autoboot_sz
+
64
)
/
16
);
__bss_start[
0
]
=
0
;
}
if
(!boot_args) {
/
/
bootloader
strcpy(boot_image
+
0x200
,
"Stage2 KJC Loader"
);
patch_bootloader(boot_image);
}
else
{
gboot_args
=
boot_args;
gboot_entry_point
=
boot_image;
extern volatile void setup_el1(void
*
entryp,uint64_t,uint64_t);
extern volatile void smemset(void
*
, uint8_t, uint64_t);
smemset(&__bss_start,
0
, ((uint64_t)__bss_end)
-
((uint64_t)__bss_start));
extern void main (void);
setup_el1(main, (uint64_t)boot_image, (uint64_t)boot_args);
/
/
进入
/
src
/
boot
/
main.c
}
jump_to_image((uint64_t)boot_image, (uint64_t)boot_args);
}