public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] i386: use new CFI macros in entry.S
@ 2006-07-28 17:50 Chuck Ebbert
  0 siblings, 0 replies; only message in thread
From: Chuck Ebbert @ 2006-07-28 17:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Andi Kleen, Jan Beulich, Linus Torvalds

Convert part of i386 entry.S to use macros instead of
open-coding CFI annotations.

Also fixes bug in ret_from_fork where annotation was wrong.

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

---

 arch/i386/kernel/entry.S |   74 ++++++++++++-----------------------------------
 1 files changed, 20 insertions(+), 54 deletions(-)

--- 2.6.18-rc2-32.orig/arch/i386/kernel/entry.S
+++ 2.6.18-rc2-32/arch/i386/kernel/entry.S
@@ -100,67 +100,35 @@ VM_MASK		= 0x00020000
 
 #define SAVE_ALL \
 	cld; \
-	pushl %es; \
-	CFI_ADJUST_CFA_OFFSET 4;\
+	CFI_pushl %es; \
 	/*CFI_REL_OFFSET es, 0;*/\
-	pushl %ds; \
-	CFI_ADJUST_CFA_OFFSET 4;\
+	CFI_pushl %ds; \
 	/*CFI_REL_OFFSET ds, 0;*/\
-	pushl %eax; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET eax, 0;\
-	pushl %ebp; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET ebp, 0;\
-	pushl %edi; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET edi, 0;\
-	pushl %esi; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET esi, 0;\
-	pushl %edx; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET edx, 0;\
-	pushl %ecx; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET ecx, 0;\
-	pushl %ebx; \
-	CFI_ADJUST_CFA_OFFSET 4;\
-	CFI_REL_OFFSET ebx, 0;\
+	CFI_pushl_reg eax; \
+	CFI_pushl_reg ebp; \
+	CFI_pushl_reg edi; \
+	CFI_pushl_reg esi; \
+	CFI_pushl_reg edx; \
+	CFI_pushl_reg ecx; \
+	CFI_pushl_reg ebx; \
 	movl $(__USER_DS), %edx; \
 	movl %edx, %ds; \
 	movl %edx, %es;
 
 #define RESTORE_INT_REGS \
-	popl %ebx;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE ebx;\
-	popl %ecx;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE ecx;\
-	popl %edx;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE edx;\
-	popl %esi;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE esi;\
-	popl %edi;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE edi;\
-	popl %ebp;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE ebp;\
-	popl %eax;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
-	CFI_RESTORE eax
+	CFI_popl_reg ebx;	\
+	CFI_popl_reg ecx;	\
+	CFI_popl_reg edx;	\
+	CFI_popl_reg esi;	\
+	CFI_popl_reg edi;	\
+	CFI_popl_reg ebp;	\
+	CFI_popl_reg eax;	\
 
 #define RESTORE_REGS	\
 	RESTORE_INT_REGS; \
-1:	popl %ds;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
+1:	CFI_popl %ds;	\
 	/*CFI_RESTORE ds;*/\
-2:	popl %es;	\
-	CFI_ADJUST_CFA_OFFSET -4;\
+2:	CFI_popl %es;	\
 	/*CFI_RESTORE es;*/\
 .section .fixup,"ax";	\
 3:	movl $0,(%esp);	\
@@ -203,12 +171,10 @@ VM_MASK		= 0x00020000
 
 ENTRY(ret_from_fork)
 	CFI_STARTPROC
-	pushl %eax
-	CFI_ADJUST_CFA_OFFSET -4
+	CFI_pushl %eax
 	call schedule_tail
 	GET_THREAD_INFO(%ebp)
-	popl %eax
-	CFI_ADJUST_CFA_OFFSET -4
+	CFI_popl %eax
 	jmp syscall_exit
 	CFI_ENDPROC
 
-- 
Chuck

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-28 17:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-28 17:50 [patch 2/2] i386: use new CFI macros in entry.S Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox