call_kernel绝对跳转
misc.c中函数decompress_kernel的列表四个参数是:
output_start:40008000,free_mem_ptr_p:sp, free_mem_ptr_end_p:sp+64K ,arch_id:9fc (arch_num个人感觉这个英文但其会引起歧义,arch_num的中文意思应该时架构号,改成mach_id可能更适合些,mach_id对应的中文时机器号)
最终解压出的是Image放置在了40008000处
unicore32-linux-objcopy -O binary -R .note -R .note.gnu.build-id -R .comment -S vmlinux arch/unicore/boot/Image
调用kernel: b call_kernel
call_kernel:
b.l cache_clean_flush
b.l cache_off
mov r0, #0 @ must be zero
mov r1, r7 @ restore architecture number
mov r2, r8 @ restore atags pointer
mov pc, r4 @ call kernel
初始化dcache时采用了write_back策略,因此解压会有部分数据在cache中而不在内存中,所以进行cache_clean_flush,而后又关闭cache,cache的操作会在kernel中再进行,最后传进内核的参数只有:r0:0,r1、r7:0x9fc, r2、r8:0x40000100参数地址。绝对跳转到r4:40008000处开始执行
unicore/kernel/head.S