From owner-freebsd-current Wed Dec 1 5: 1:37 1999 Delivered-To: freebsd-current@freebsd.org Received: from ns.demophon.com (ns.demophon.com [193.65.70.13]) by hub.freebsd.org (Postfix) with SMTP id 4897C14D48 for ; Wed, 1 Dec 1999 05:01:34 -0800 (PST) (envelope-from will@ns.demophon.com) Received: (qmail 29677 invoked by uid 1003); 1 Dec 1999 12:59:54 -0000 Date: 1 Dec 1999 12:59:54 -0000 Message-ID: <19991201125954.29674.qmail@ns.demophon.com> From: Ville-Pertti Keinonen To: marcel@scc.nl Cc: dillon@apollo.backplane.com, bde@zeta.org.au, current@FreeBSD.ORG In-reply-to: <384510E6.6FB29574@scc.nl> (message from Marcel Moolenaar on Wed, 01 Dec 1999 13:13:26 +0100) Subject: Re: kernel: -mpreferred-stack-boundary=2 ?? Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > The stack must be aligned before the return address is pushed: > > The following C fragment > f(1); > f(2); > > Translates to > > addl $-12,%esp > pushl $1 > call f > addl $16,%esp > addl $-12,%esp > pushl $2 > call f > addl $16,%esp > > This assumes the stack is already aligned, of course. That just keeps it aligned the same, *relatively*. You have to cause the compiler to generate something that must be aligned to a 16-byte boundary to figure out at which point the stack pointer is assumed to be aligned. In fact, I think that the stack is aligned after pushing the previous frame pointer, a 4-word struct with __attribute__((aligned(16))) is placed starting at -32(%ebp). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message