diff options
| author | joerg <joerg@NetBSD.org> | 2010-12-03 20:51:21 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2010-12-03 20:51:21 +0000 |
| commit | 65b45bb0d8a48432bf75be2ea872fd45b6e87f15 (patch) | |
| tree | 2887e8ab7c7528c0d6396a99fae693b1e12fd438 | |
| parent | 12e38db326fa99dbc398b80db57ad2d96f013ef9 (diff) | |
Actually add the check_stack_alignment implementation for x86.
| -rw-r--r-- | tests/lib/csu/arch/i386/h_initfini_align.S | 15 | ||||
| -rw-r--r-- | tests/lib/csu/arch/x86_64/h_initfini_align.S | 16 |
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/lib/csu/arch/i386/h_initfini_align.S b/tests/lib/csu/arch/i386/h_initfini_align.S new file mode 100644 index 00000000000..db27b4340ac --- /dev/null +++ b/tests/lib/csu/arch/i386/h_initfini_align.S @@ -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 --git a/tests/lib/csu/arch/x86_64/h_initfini_align.S b/tests/lib/csu/arch/x86_64/h_initfini_align.S new file mode 100644 index 00000000000..b5cd3b6d689 --- /dev/null +++ b/tests/lib/csu/arch/x86_64/h_initfini_align.S @@ -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 |
