Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/csu/arch Actually add the check_stack_alignment im...
details: https://anonhg.NetBSD.org/src/rev/40a02b8a2ef3
branches: trunk
changeset: 759248:40a02b8a2ef3
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Dec 03 20:51:21 2010 +0000
description:
Actually add the check_stack_alignment implementation for x86.
diffstat:
tests/lib/csu/arch/i386/h_initfini_align.S | 15 +++++++++++++++
tests/lib/csu/arch/x86_64/h_initfini_align.S | 16 ++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
diffs (39 lines):
diff -r 7d2197546376 -r 40a02b8a2ef3 tests/lib/csu/arch/i386/h_initfini_align.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/csu/arch/i386/h_initfini_align.S Fri Dec 03 20:51:21 2010 +0000
@@ -0,0 +1,15 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $")
+
+_ENTRY(check_stack_alignment)
+ movl %esp, %eax
+ andl $3, %eax
+ jz 1f
+ xorl %eax, %eax
+ ret
+1:
+ incl %eax
+ ret
diff -r 7d2197546376 -r 40a02b8a2ef3 tests/lib/csu/arch/x86_64/h_initfini_align.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/csu/arch/x86_64/h_initfini_align.S Fri Dec 03 20:51:21 2010 +0000
@@ -0,0 +1,16 @@
+/* $NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $")
+
+_ENTRY(check_stack_alignment)
+ movl %esp, %eax
+ andl $15, %eax
+ subl $8, %eax
+ jz 1f
+ xorl %eax, %eax
+ ret
+1:
+ incl %eax
+ ret
Home |
Main Index |
Thread Index |
Old Index