arch/arm/kernel/head.S
77 ENTRY(stext)
arch/arm/kernel/traps.c
devicemaps_init
void * vectors = early_alloc(PAGE_SIZE * 2);
early_trap_init(vectors);
vectors_base = vectors;
vectors_page = vectors;
// 填充 vectors - vectors+0x1000-1
vectors_base)[i] = 0xe7fddef1;
memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start);
// 填充 vectors+0x1000 - vectors+0x2000-1
memcpy((void *)vectors + 0x1000, __stubs_start, __stubs_end - __stubs_start);
kuser_init(vectors_base);
int kuser_sz = __kuser_helper_end - __kuser_helper_start;
// 覆盖 vectors+0x1000-kuser_sz - vectors+0x1000-1
memcpy(vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz);
// 覆盖 vectors+0xfe0 - vectors+0xfe4-1
if (tls_emu || has_tls_reg) memcpy(vectors + 0xfe0, vectors + 0xfe8, 4);
flush_icache_range(vectors, vectors + PAGE_SIZE * 2);
...
map.pfn = __phys_to_pfn(virt_to_phys(vectors));
map.virtual = 0xffff0000;
map.length = PAGE_SIZE;
map.type = MT_HIGH_VECTORS;
create_mapping(&map);
map.pfn += 1;
map.virtual = 0xffff0000 + PAGE_SIZE;
map.length = PAGE_SIZE;
map.type = MT_LOW_VECTORS;
create_mapping(&map);
上一篇:OK6410A 开发板 (八) 61 linux-5.11 OK6410A 进程通信机制1 信号
下一篇:OK6410A 开发板 (八) 59 linux-5.11 OK6410A Undefined instructions 异常
推荐阅读最新更新时间:2024-10-30 16:40