标题:
linux下X86架构IDT解析(3)
[打印本页]
作者:
yuyang911220
时间:
2015-7-30 18:57
标题:
linux下X86架构IDT解析(3)
void
__init
trap_init
(void){
726
int
i
;
736
set_intr_gate
(X86_TRAP_DE, &
divide_error
);
737
set_intr_gate_ist
(X86_TRAP_NMI, &
nmi
,
NMI_STACK
);
739
set_system_intr_gate
(X86_TRAP_OF, &
overflow
);
740
set_intr_gate
(X86_TRAP_BR, &
bounds
);
741
set_intr_gate
(X86_TRAP_UD, &
invalid_op
);
742
set_intr_gate
(X86_TRAP_NM, &
device_not_available
);
743
#ifdef CONFIG_X86_32
744
set_task_gate
(X86_TRAP_DF,
GDT_ENTRY_DOUBLEFAULT_TSS
);
745
#else
746
set_intr_gate_ist
(X86_TRAP_DF, &
double_fault
,
DOUBLEFAULT_STACK
);
747
#endif
748
set_intr_gate
(X86_TRAP_OLD_MF, &
coprocessor_segment_overrun
);
749
set_intr_gate
(X86_TRAP_TS, &
invalid_TSS
);
750
set_intr_gate
(X86_TRAP_NP, &
segment_not_present
);
751
set_intr_gate_ist
(X86_TRAP_SS, &
stack_segment
,
STACKFAULT_STACK
);
752
set_intr_gate
(X86_TRAP_GP, &
general_protection
);
753
set_intr_gate
(X86_TRAP_SPURIOUS, &
spurious_interrupt_bug
);
754
set_intr_gate
(X86_TRAP_MF, &
coprocessor_error
);
755
set_intr_gate
(X86_TRAP_AC, &
alignment_check
);
759
set_intr_gate
(X86_TRAP_XF, &
simd_coprocessor_error
);
760
761
/* Reserve all the builtin and the syscall vector: */
762
for (
i
= 0;
i
<
FIRST_EXTERNAL_VECTOR
;
i
++)
763
set_bit
(
i
,
used_vectors
);
764
765
#ifdef CONFIG_IA32_EMULATION
766
set_system_intr_gate
(
IA32_SYSCALL_VECTOR
,
ia32_syscall
);
767
set_bit
(
IA32_SYSCALL_VECTOR
,
used_vectors
);
768
#endif
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0