Changes in kernel/arch/ia32/src/asm.S [d029434:8078180] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/asm.S
rd029434 r8078180 1 1 /* 2 * Copyright (c) 20 10Jakub Jermar2 * Copyright (c) 2001 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 32 32 33 33 #include <arch/pm.h> 34 #include <arch/cpu.h>35 34 #include <arch/mm/page.h> 36 35 … … 191 190 .global sysenter_handler 192 191 sysenter_handler: 192 sti 193 193 subl $(ISTATE_REAL_SIZE), %esp 194 194 … … 227 227 * Switch to kernel selectors. 228 228 */ 229 movw $ (gdtselector(KDATA_DES)), %ax229 movw $16, %ax 230 230 movw %ax, %ds 231 231 movw %ax, %es 232 232 233 /* 234 * Sanitize EFLAGS. 235 * 236 * SYSENTER does not clear the NT flag, which could thus proliferate 237 * from here to the IRET instruction via a context switch and result 238 * in crash. 239 * 240 * SYSENTER does not clear DF, which the ABI assumes to be cleared. 241 * 242 * SYSENTER clears IF, which we would like to be set for syscalls. 243 * 244 */ 245 pushl $(EFLAGS_IF) /* specify EFLAGS bits that we want to set */ 246 popfl /* set bits from the mask, clear or ignore others */ 247 233 cld 248 234 call syscall_handler 249 235 … … 308 294 * Switch to kernel selectors. 309 295 */ 310 movl $ (gdtselector(KDATA_DES)), %eax296 movl $16, %eax 311 297 movl %eax, %ds 312 298 movl %eax, %es … … 372 358 .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST 373 359 /* 374 * Exception with error word .360 * Exception with error word: do nothing 375 361 */ 376 subl $ISTATE_SOFT_SIZE, %esp377 362 .else 378 363 /* 379 364 * Exception without error word: fake up one 380 365 */ 381 subl $(ISTATE_SOFT_SIZE + 4), %esp366 pushl $0 382 367 .endif 383 368 .else 384 369 /* 385 * Interrupt: fake up an error word370 * Interrupt: fake up one 386 371 */ 387 subl $(ISTATE_SOFT_SIZE + 4), %esp372 pushl $0 388 373 .endif 374 375 subl $ISTATE_SOFT_SIZE, %esp 389 376 390 377 /* … … 417 404 * Switch to kernel selectors. 418 405 */ 419 movl $ (gdtselector(KDATA_DES)), %eax406 movl $16, %eax 420 407 movl %eax, %ds 421 408 movl %eax, %es … … 426 413 */ 427 414 xorl %eax, %eax 428 cmpl $ (gdtselector(KTEXT_DES)), ISTATE_OFFSET_CS(%esp)429 cmov nzl %eax, %ebp415 cmpl $8, ISTATE_OFFSET_CS(%esp) 416 cmovl %eax, %ebp 430 417 431 418 movl %ebp, ISTATE_OFFSET_EBP_FRAME(%esp)
Note:
See TracChangeset
for help on using the changeset viewer.