Embedded 版 (精华区)
发信人: snows (花自飘零水自流), 信区: Embedded
标 题: The trap_init() Function
发信站: 哈工大紫丁香 (2004年03月16日13:19:28 星期二), 站内信件
The trap_init() Function
Trap_init() is usually located in arch/<host>/kernel/traps.c.
Trap_init() initializes some of the processor's interrupt handling capability.
In particular, it aims the processors interrupt vector table pointer to the
address of the actual vector table, if necessary. Interrupts are not enabled
until later on, just before the calibrate_delay() function is run.
The code in Figure 6 shows trap_init() for the Hitachi SH.
void __init trap_init(void)
{
extern void *vbr_base;
extern void *exception_handling_table[14];
exception_handling_table[12] = (void *)do_reserved_inst;
exception_handling_table[13] = (void *)do_illegal_slot_inst;
asm volatile("ldc %0, vbr"
: /* no output */
: "r" (&vbr_base)
: "memory");
}
Figure 6. The trap_init() function.
--
-
╭────────────────────────────╮
│ 风萧传瑟声,叶落根深处,青阶入野无归途,他乡不知顾 │
│ 泣下问和谁,叹者行已暮,寒眉傲骨今尚在,奈何入凡土 │
╰────────────────────────────╯
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.229.154]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:6.107毫秒