Changeset 6b1a85c in mainline for kernel/arch/ia32/src/asm.S
- Timestamp:
- 2010-07-13T21:54:38Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4003861
- Parents:
- 5f83634 (diff), c0e9f3f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/asm.S
r5f83634 r6b1a85c 1 1 /* 2 * Copyright (c) 20 01Jakub Jermar2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 32 32 33 33 #include <arch/pm.h> 34 #include <arch/cpu.h> 34 35 #include <arch/mm/page.h> 35 36 … … 190 191 .global sysenter_handler 191 192 sysenter_handler: 192 sti193 193 subl $(ISTATE_REAL_SIZE), %esp 194 194 … … 227 227 * Switch to kernel selectors. 228 228 */ 229 movw $ 16, %ax229 movw $(gdtselector(KDATA_DES)), %ax 230 230 movw %ax, %ds 231 231 movw %ax, %es 232 232 233 cld 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 234 248 call syscall_handler 235 249 … … 294 308 * Switch to kernel selectors. 295 309 */ 296 movl $ 16, %eax310 movl $(gdtselector(KDATA_DES)), %eax 297 311 movl %eax, %ds 298 312 movl %eax, %es … … 358 372 .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST 359 373 /* 360 * Exception with error word : do nothing374 * Exception with error word. 361 375 */ 376 subl $ISTATE_SOFT_SIZE, %esp 362 377 .else 363 378 /* 364 379 * Exception without error word: fake up one 365 380 */ 366 pushl $0381 subl $(ISTATE_SOFT_SIZE + 4), %esp 367 382 .endif 368 383 .else 369 384 /* 370 * Interrupt: fake up one385 * Interrupt: fake up an error word 371 386 */ 372 pushl $0387 subl $(ISTATE_SOFT_SIZE + 4), %esp 373 388 .endif 374 375 subl $ISTATE_SOFT_SIZE, %esp376 389 377 390 /* … … 404 417 * Switch to kernel selectors. 405 418 */ 406 movl $ 16, %eax419 movl $(gdtselector(KDATA_DES)), %eax 407 420 movl %eax, %ds 408 421 movl %eax, %es … … 413 426 */ 414 427 xorl %eax, %eax 415 cmpl $ 8, ISTATE_OFFSET_CS(%esp)416 cmov l %eax, %ebp428 cmpl $(gdtselector(KTEXT_DES)), ISTATE_OFFSET_CS(%esp) 429 cmovnzl %eax, %ebp 417 430 418 431 movl %ebp, ISTATE_OFFSET_EBP_FRAME(%esp)
Note:
See TracChangeset
for help on using the changeset viewer.