aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_32.S
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-03-25 15:16:32 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:30 -0400
commitab68ed98f665436601feec853c8f400d28c39e92 (patch)
treea33c2728e1a3f7185af94528f7395cae7f29f248 /arch/x86/kernel/entry_32.S
parent756a6c68556600aec9460346332884d891d5beb4 (diff)
x86: entry_32.S - use flags from processor-flags.h
By including processor-flags.h we are allowed to use predefined macroses instead of keeping own ones Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r--arch/x86/kernel/entry_32.S20
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index a664d5726d8d..9ba49a26dff8 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -51,6 +51,7 @@
51#include <asm/desc.h> 51#include <asm/desc.h>
52#include <asm/percpu.h> 52#include <asm/percpu.h>
53#include <asm/dwarf2.h> 53#include <asm/dwarf2.h>
54#include <asm/processor-flags.h>
54#include "irq_vectors.h" 55#include "irq_vectors.h"
55 56
56/* 57/*
@@ -68,13 +69,6 @@
68 69
69#define nr_syscalls ((syscall_table_size)/4) 70#define nr_syscalls ((syscall_table_size)/4)
70 71
71CF_MASK = 0x00000001
72TF_MASK = 0x00000100
73IF_MASK = 0x00000200
74DF_MASK = 0x00000400
75NT_MASK = 0x00004000
76VM_MASK = 0x00020000
77
78#ifdef CONFIG_PREEMPT 72#ifdef CONFIG_PREEMPT
79#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF 73#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF
80#else 74#else
@@ -84,7 +78,7 @@ VM_MASK = 0x00020000
84 78
85.macro TRACE_IRQS_IRET 79.macro TRACE_IRQS_IRET
86#ifdef CONFIG_TRACE_IRQFLAGS 80#ifdef CONFIG_TRACE_IRQFLAGS
87 testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off? 81 testl $X86_EFLAGS_IF,PT_EFLAGS(%esp) # interrupts off?
88 jz 1f 82 jz 1f
89 TRACE_IRQS_ON 83 TRACE_IRQS_ON
901: 841:
@@ -246,7 +240,7 @@ ret_from_intr:
246check_userspace: 240check_userspace:
247 movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS 241 movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS
248 movb PT_CS(%esp), %al 242 movb PT_CS(%esp), %al
249 andl $(VM_MASK | SEGMENT_RPL_MASK), %eax 243 andl $(X86_EFLAGS_VM | SEGMENT_RPL_MASK), %eax
250 cmpl $USER_RPL, %eax 244 cmpl $USER_RPL, %eax
251 jb resume_kernel # not returning to v8086 or userspace 245 jb resume_kernel # not returning to v8086 or userspace
252 246
@@ -271,7 +265,7 @@ need_resched:
271 movl TI_flags(%ebp), %ecx # need_resched set ? 265 movl TI_flags(%ebp), %ecx # need_resched set ?
272 testb $_TIF_NEED_RESCHED, %cl 266 testb $_TIF_NEED_RESCHED, %cl
273 jz restore_all 267 jz restore_all
274 testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off (exception path) ? 268 testl $X86_EFLAGS_IF,PT_EFLAGS(%esp) # interrupts off (exception path) ?
275 jz restore_all 269 jz restore_all
276 call preempt_schedule_irq 270 call preempt_schedule_irq
277 jmp need_resched 271 jmp need_resched
@@ -388,7 +382,7 @@ syscall_exit:
388 # setting need_resched or sigpending 382 # setting need_resched or sigpending
389 # between sampling and the iret 383 # between sampling and the iret
390 TRACE_IRQS_OFF 384 TRACE_IRQS_OFF
391 testl $TF_MASK,PT_EFLAGS(%esp) # If tracing set singlestep flag on exit 385 testl $X86_EFLAGS_TF,PT_EFLAGS(%esp) # If tracing set singlestep flag on exit
392 jz no_singlestep 386 jz no_singlestep
393 orl $_TIF_SINGLESTEP,TI_flags(%ebp) 387 orl $_TIF_SINGLESTEP,TI_flags(%ebp)
394no_singlestep: 388no_singlestep:
@@ -403,7 +397,7 @@ restore_all:
403 # See comments in process.c:copy_thread() for details. 397 # See comments in process.c:copy_thread() for details.
404 movb PT_OLDSS(%esp), %ah 398 movb PT_OLDSS(%esp), %ah
405 movb PT_CS(%esp), %al 399 movb PT_CS(%esp), %al
406 andl $(VM_MASK | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax 400 andl $(X86_EFLAGS_VM | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax
407 cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax 401 cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax
408 CFI_REMEMBER_STATE 402 CFI_REMEMBER_STATE
409 je ldt_ss # returning to user-space with LDT SS 403 je ldt_ss # returning to user-space with LDT SS
@@ -490,7 +484,7 @@ work_resched:
490work_notifysig: # deal with pending signals and 484work_notifysig: # deal with pending signals and
491 # notify-resume requests 485 # notify-resume requests
492#ifdef CONFIG_VM86 486#ifdef CONFIG_VM86
493 testl $VM_MASK, PT_EFLAGS(%esp) 487 testl $X86_EFLAGS_VM, PT_EFLAGS(%esp)
494 movl %esp, %eax 488 movl %esp, %eax
495 jne work_notifysig_v86 # returning to kernel-space or 489 jne work_notifysig_v86 # returning to kernel-space or
496 # vm86-space 490 # vm86-space