From: miod Date: Wed, 30 Apr 2014 04:20:31 +0000 (+0000) Subject: Enforce proper alignment of stack variables which may get accessed with X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=92d760d010265ffd7f9d75a3b1649dbb985c7405;p=openbsd Enforce proper alignment of stack variables which may get accessed with double-word load and store instructions. This used to work by chance, but recent compiler changes no longer put us in the lucky situation. tweaks kettenis@ --- diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c index dd5ee00b1a5..2cd298c6bd1 100644 --- a/sys/arch/sparc/sparc/cpu.c +++ b/sys/arch/sparc/sparc/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.49 2012/11/25 13:34:17 jsg Exp $ */ +/* $OpenBSD: cpu.c,v 1.50 2014/04/30 04:20:31 miod Exp $ */ /* $NetBSD: cpu.c,v 1.56 1997/09/15 20:52:36 pk Exp $ */ /* @@ -294,7 +294,7 @@ void fpu_init(sc) struct cpu_softc *sc; { - struct fpstate fpstate; + struct fpstate fpstate __aligned(8); /* * Get the FSR and clear any exceptions. If we do not unload diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index d5dcac3167a..9ef25319c59 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.65 2014/04/18 11:51:17 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.66 2014/04/30 04:20:31 miod Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -952,8 +952,8 @@ syscall(code, tf, pc) int error, new; struct args { register_t i[8]; - } args; - register_t rval[2]; + } args __aligned(8); + register_t rval[2] __aligned(8); #ifdef DIAGNOSTIC extern struct pcb *cpcb; #endif