Changeset 0f17bff in mainline for kernel/arch/ia32/src/pm.c
- Timestamp:
- 2016-05-05T08:34:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 811770c
- Parents:
- 4b0206c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/pm.c
r4b0206c r0f17bff 47 47 #include <arch/boot/boot.h> 48 48 #include <interrupt.h> 49 #include <arch/cpu.h> 49 50 50 51 /* … … 256 257 } 257 258 258 /* Clean IOPL(12,13) and NT(14) flags in EFLAGS register */259 static void clean_IOPL_NT_flags(void)260 {261 asm volatile (262 "pushfl\n"263 "pop %%eax\n"264 "and $0xffff8fff, %%eax\n"265 "push %%eax\n"266 "popfl\n"267 ::: "eax"268 );269 }270 271 /* Clean AM(18) flag in CR0 register */272 static void clean_AM_flag(void)273 {274 asm volatile (275 "mov %%cr0, %%eax\n"276 "and $0xfffbffff, %%eax\n"277 "mov %%eax, %%cr0\n"278 ::: "eax"279 );280 }281 282 259 void pm_init(void) 283 260 { … … 326 303 tr_load(GDT_SELECTOR(TSS_DES)); 327 304 328 clean_IOPL_NT_flags(); /* Disable I/O on nonprivileged levels and clear NT flag. */ 329 clean_AM_flag(); /* Disable alignment check */ 305 /* Disable I/O on nonprivileged levels and clear NT flag. */ 306 write_eflags(read_eflags() & ~(EFLAGS_IOPL | EFLAGS_NT)); 307 308 /* Disable alignment check */ 309 write_cr0(read_cr0() & ~CR0_AM); 330 310 } 331 311
Note:
See TracChangeset
for help on using the changeset viewer.