[patch 2/2] i386: use new CFI macros in entry.S

From: Chuck Ebbert
Date: Fri Jul 28 2006 - 13:54:40 EST


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@xxxxxxxxxxxxxx>

---

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/