aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/entry.S')
-rw-r--r--arch/i386/kernel/entry.S22
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index e6e4506e749a..fbdb933251b6 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -83,6 +83,12 @@ VM_MASK = 0x00020000
83#define resume_kernel restore_nocheck 83#define resume_kernel restore_nocheck
84#endif 84#endif
85 85
86#ifdef CONFIG_VM86
87#define resume_userspace_sig check_userspace
88#else
89#define resume_userspace_sig resume_userspace
90#endif
91
86#define SAVE_ALL \ 92#define SAVE_ALL \
87 cld; \ 93 cld; \
88 pushl %es; \ 94 pushl %es; \
@@ -211,6 +217,7 @@ ret_from_exception:
211 preempt_stop 217 preempt_stop
212ret_from_intr: 218ret_from_intr:
213 GET_THREAD_INFO(%ebp) 219 GET_THREAD_INFO(%ebp)
220check_userspace:
214 movl EFLAGS(%esp), %eax # mix EFLAGS and CS 221 movl EFLAGS(%esp), %eax # mix EFLAGS and CS
215 movb CS(%esp), %al 222 movb CS(%esp), %al
216 testl $(VM_MASK | 3), %eax 223 testl $(VM_MASK | 3), %eax
@@ -263,7 +270,12 @@ sysenter_past_esp:
263 pushl $(__USER_CS) 270 pushl $(__USER_CS)
264 CFI_ADJUST_CFA_OFFSET 4 271 CFI_ADJUST_CFA_OFFSET 4
265 /*CFI_REL_OFFSET cs, 0*/ 272 /*CFI_REL_OFFSET cs, 0*/
266 pushl $SYSENTER_RETURN 273 /*
274 * Push current_thread_info()->sysenter_return to the stack.
275 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
276 * pushed above; +8 corresponds to copy_thread's esp0 setting.
277 */
278 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
267 CFI_ADJUST_CFA_OFFSET 4 279 CFI_ADJUST_CFA_OFFSET 4
268 CFI_REL_OFFSET eip, 0 280 CFI_REL_OFFSET eip, 0
269 281
@@ -415,7 +427,7 @@ work_notifysig: # deal with pending signals and
415 # vm86-space 427 # vm86-space
416 xorl %edx, %edx 428 xorl %edx, %edx
417 call do_notify_resume 429 call do_notify_resume
418 jmp resume_userspace 430 jmp resume_userspace_sig
419 431
420 ALIGN 432 ALIGN
421work_notifysig_v86: 433work_notifysig_v86:
@@ -428,7 +440,7 @@ work_notifysig_v86:
428 movl %eax, %esp 440 movl %eax, %esp
429 xorl %edx, %edx 441 xorl %edx, %edx
430 call do_notify_resume 442 call do_notify_resume
431 jmp resume_userspace 443 jmp resume_userspace_sig
432#endif 444#endif
433 445
434 # perform syscall exit tracing 446 # perform syscall exit tracing
@@ -515,7 +527,7 @@ ENTRY(irq_entries_start)
515 .if vector 527 .if vector
516 CFI_ADJUST_CFA_OFFSET -4 528 CFI_ADJUST_CFA_OFFSET -4
517 .endif 529 .endif
5181: pushl $vector-256 5301: pushl $~(vector)
519 CFI_ADJUST_CFA_OFFSET 4 531 CFI_ADJUST_CFA_OFFSET 4
520 jmp common_interrupt 532 jmp common_interrupt
521.data 533.data
@@ -535,7 +547,7 @@ common_interrupt:
535#define BUILD_INTERRUPT(name, nr) \ 547#define BUILD_INTERRUPT(name, nr) \
536ENTRY(name) \ 548ENTRY(name) \
537 RING0_INT_FRAME; \ 549 RING0_INT_FRAME; \
538 pushl $nr-256; \ 550 pushl $~(nr); \
539 CFI_ADJUST_CFA_OFFSET 4; \ 551 CFI_ADJUST_CFA_OFFSET 4; \
540 SAVE_ALL; \ 552 SAVE_ALL; \
541 movl %esp,%eax; \ 553 movl %esp,%eax; \