Project

General

Profile

Actions

Bug #964

closed

clear direction flag for signal handlers

Added by aoiko about 16 years ago. Updated about 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

gcc-4.3 assumes the direction flag is clear on function entry as
specified by the i386 abi. Ensure that is the case when running
a signal handler.

Linux-kernel discussion with gcc people starts here:
http://article.gmane.org/gmane.linux.kernel/650279

Index: platform/pc32/i386/machdep.c ===================================================================
retrieving revision 1.129
diff u -r1.129 machdep.c
--
platform/pc32/i386/machdep.c
+++ platform/pc32/i386/machdep.c
@ -515,7 +515,13 @

regs->tf_esp = (int)sfp;
regs->tf_eip = PS_STRINGS - ;
- regs->tf_eflags &= ~PSL_T;

/

+ * i386 abi specifies that the direction flag must be cleared
+ * on function entry
+ */
+ regs->tf_eflags &= ~(PSL_T|PSL_D);
+
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
regs->tf_es = _udatasel;
Actions

Also available in: Atom PDF