- 论坛徽章:
- 13
|
本帖最后由 _nosay 于 2016-04-01 18:16 编辑
回复 2# nswcfd
嗯,而且不光是特权指令,中断服务代码以及内核中的变量,都在内核空间,CPU在访问时,都需要检查cs的dpl是否为0,是吧?
但是,我搜“__KERNEL_CS”,发现只有以下几个文件使用了“__KERNEL_CS宏”,这些代码都和进入中断没关系:- ---- __KERNEL_CS Matches (11 in 7 files) ----
- Fpu_entry.c (arch\i386\math-emu): else if ( FPU_CS == __KERNEL_CS )
- head.S (arch\i386\boot\compressed): ljmp $(__KERNEL_CS), $0x100000
- head.S (arch\i386\boot\compressed): ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine
- head.S (arch\i386\boot\compressed): ljmp $(__KERNEL_CS), $0x100000
- head.S (arch\i386\kernel): ljmp $(__KERNEL_CS),$1f
- head.S (arch\i386\kernel): movl $(__KERNEL_CS << 16),%eax
- Pci-pc.c (arch\i386\kernel):} bios32_indirect = { 0, __KERNEL_CS };
- Pci-pc.c (arch\i386\kernel):} pci_indirect = { 0, __KERNEL_CS };
- Segment.h (include\asm-arm):#define __KERNEL_CS 0x0
- Segment.h (include\asm-i386):#define __KERNEL_CS 0x10
- Traps.c (arch\i386\kernel): "3" ((char *) (addr)),"2" (__KERNEL_CS << 16)); \
复制代码 |
|