mips 4kec 中断分析
kernel:2.6.21
支持dedicated(专门中断) INT
setup_arch()->cpu_probe()->cpu_probe_mips()
->decode_configs
{
c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |
MIPS_CPU_DIVEC | MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
}
所以会执行:
trap_init()
{
...
set_handler(0x200, &except_vec4, 0x8);
...
...
set_except_vector(0, handle_int);
...
...
}
except_vec4 只是占位并没有作用
在 void *set_except_vector(int n, void *addr)
{
...
...
if (n == 0 && cpu_has_divec)
{
*(volatile u32 *)(ebase + 0x200) =
0x08000000 | (0x03ffffff & (handler >> 2));//安装中断向量,相当于MIPS 汇编 j handler
......
}
...
...
}
!!!替换了原来的except_vec4!!!
handle_int在汇编genex.s:
NESTED(handle_int, PT_SIZE, sp)
...
...
j plat_irq_dispatch//调用 plat_irq_dispatch 各CPU自己定义分发中断
END(handle_int)
trap_init()->per_cpu_trap_init()
per_cpu_trap_init
{
....
set_c0_cause(CAUSEF_IV);//打开dedicated INT
.....
}
MIPS时钟:(新内核已采用 clock event& source 架构)
time_init->plat_timer_setup 函数注册中断
time_init->init_mips_clocksource 函数注册CLOCK
by the way:
多CPU启动, 例如cavium mips
__cpu_up启动CPU
先 fork_idle 创建新的CPU内核栈
然后 mp_ops->boot_secondary
设置启动CPU编号octeon_processor_boot
其他cpu空转 mach_cavium_octeon.h
octeon_spin_wait_boot:
LONG_L t1, (t0) # Get the core id of the next to be booted
bne t1, v0, octeon_spin_wait_boot # Keep looping if it isnt me
octeon_processor_boot变量-smp_bootstrap->start_secondary->
smp_init->cpu_up->_cpu_up->__cpu_up->fork_idle
阅读(1491) | 评论(0) | 转发(0) |