From patchwork Wed Mar 31 20:42:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 90018 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2VKga8k030189 for ; Wed, 31 Mar 2010 20:42:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758146Ab0CaUmg (ORCPT ); Wed, 31 Mar 2010 16:42:36 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:42870 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757834Ab0CaUmf (ORCPT ); Wed, 31 Mar 2010 16:42:35 -0400 Received: by wwb17 with SMTP id 17so369026wwb.19 for ; Wed, 31 Mar 2010 13:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:received:message-id:subject:from:to :content-type; bh=SkPmmVBtnsD8GvQPKvfndZqLCnJD6MZbwnCd184oztw=; b=Mo4YOALOzWQjXpFPQvdaTpKd6ecFN2jY4U0HIch1KQNqIt33WS9xLpA5mx/yvL2eZZ dHMRjwb0JxiRwH2FE5OPEtEmdFDHKDCC8nVqsZQ+XqPM1W1h7/Dn+szhad741hkGKW6E pMkGpIUXHRvkv0+AcYfI9TZgfOaSJd58OLCv0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=ar+2QZ2KTZVcsk4NV+zfS4rca/GYfYVzqvcsCH9yi8kRFqYPp/MTkZOWx5HYVJ/Veb UXmxW4JM1YDIEq95vwuasZE7VvIm8ax2JGCbOL16N2cQLdj3mex+cY0R26FoN8CKpSbq S8rEsPY/GQLw0rICC3zq5FI2z3k/z8S2D1e14= MIME-Version: 1.0 Received: by 10.216.35.78 with HTTP; Wed, 31 Mar 2010 13:42:33 -0700 (PDT) Date: Wed, 31 Mar 2010 16:42:33 -0400 X-Google-Sender-Auth: dd8cd250017db944 Received: by 10.216.163.207 with SMTP id a57mr1227495wel.220.1270068154018; Wed, 31 Mar 2010 13:42:34 -0700 (PDT) Message-ID: Subject: parisc: Use of align_frame provides stack frame. From: "Carlos O'Donell" To: linux-parisc , Kyle McMartin Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 31 Mar 2010 20:42:36 +0000 (UTC) diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c index ec787b4..0a719f2 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -45,8 +45,12 @@ #else #define FRAME_SIZE 64 #endif +#define FRAME_ALIGN 64 -#define align(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y))) +/* Add FRAME_SIZE to the size x and align it to y. All definitions + * that use align_frame will include space for a frame. + */ +#define align_frame(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y))) int main(void) { @@ -146,7 +150,8 @@ int main(void) DEFINE(TASK_PT_IOR, offsetof(struct task_struct, thread.regs.ior)); BLANK(); DEFINE(TASK_SZ, sizeof(struct task_struct)); - DEFINE(TASK_SZ_ALGN, align(sizeof(struct task_struct), 64)); + /* TASK_SZ_ALGN includes space for a stack frame. */ + DEFINE(TASK_SZ_ALGN, align_frame(sizeof(struct task_struct), FRAME_ALIGN)); BLANK(); DEFINE(PT_PSW, offsetof(struct pt_regs, gr[ 0])); DEFINE(PT_GR1, offsetof(struct pt_regs, gr[ 1])); @@ -233,7 +238,8 @@ int main(void) DEFINE(PT_ISR, offsetof(struct pt_regs, isr)); DEFINE(PT_IOR, offsetof(struct pt_regs, ior)); DEFINE(PT_SIZE, sizeof(struct pt_regs)); - DEFINE(PT_SZ_ALGN, align(sizeof(struct pt_regs), 64)); + /* PT_SZ_ALGN includes space for a stack frame. */ + DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN)); BLANK(); DEFINE(TI_TASK, offsetof(struct thread_info, task)); DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); @@ -242,7 +248,8 @@ int main(void) DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit)); DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); DEFINE(THREAD_SZ, sizeof(struct thread_info)); - DEFINE(THREAD_SZ_ALGN, align(sizeof(struct thread_info), 64)); + /* THREAD_SZ_ALGN includes space for a stack frame. */ + DEFINE(THREAD_SZ_ALGN, align_frame(sizeof(struct thread_info), FRAME_ALIGN)); BLANK(); DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base)); DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride));