/SPARTAN/trunk/doc/TODO |
---|
12,7 → 12,7 |
+ save/restore floating point context on context switch |
+ [ia32] lazy context switch using TS flag [DONE] |
+ [ia32] MMX,SSE1-.. initialization |
+ [ia32] review privilege separation |
+ [ia32] review privilege separation [DONE] |
+ zero IOPL in EFLAGS [DONE] |
+ before IRET (from SYSCALL), zero NT in EFLAGS [DONE] |
+ [ia32] review the cache controling bits in CR0 register |
/SPARTAN/trunk/arch/ia32/src/pm.c |
---|
128,7 → 128,7 |
} |
// Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
static void clean_IOPL_NT_flags(void) |
{ |
asm |
144,9 → 144,24 |
); |
} |
// Clean AM(18) flag in CR0 register |
static void clean_AM_flag(void) |
{ |
asm |
( |
"mov %%cr0,%%eax;" |
"and $0xFFFBFFFF,%%eax;" |
"mov %%eax,%%cr0;" |
: |
: |
:"%eax" |
); |
} |
void pm_init(void) |
{ |
struct descriptor *gdt_p = (struct descriptor *) PA2KA(gdtr.base); |
185,5 → 200,6 |
*/ |
__asm__("ltr %0" : : "r" ((__u16) selector(TSS_DES))); |
clean_IOPL_NT_flags(); |
clean_IOPL_NT_flags(); //Disable I/O on nonprivileged levels |
clean_AM_flag(); //Disable alignment check |
} |