From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 397 invoked by alias); 23 Jun 2011 02:37:41 -0000 Received: (qmail 389 invoked by uid 22791); 23 Jun 2011 02:37:40 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-ey0-f177.google.com (HELO mail-ey0-f177.google.com) (209.85.215.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 02:37:26 +0000 Received: by eyh6 with SMTP id 6so521050eyh.36 for ; Wed, 22 Jun 2011 19:37:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.94.138 with SMTP id n10mr1042831eef.73.1308796645152; Wed, 22 Jun 2011 19:37:25 -0700 (PDT) Received: by 10.14.98.196 with HTTP; Wed, 22 Jun 2011 19:37:24 -0700 (PDT) Date: Thu, 23 Jun 2011 02:37:00 -0000 Message-ID: Subject: Thread stack alignment requirements for ARM From: Michael Bergandi To: eCos Developer List Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2011-06/txt/msg00017.txt.bz2 Hi all, I am hoping that someone can share some knowledge on thread stack alignment requirements for ARM targets and how eCos is handling it. According to the ARM site, they say that stacks should be 16 byte aligned. Then, they go on to say that there are a couple ways that stack alignment requirement can be managed. One of which was if you are running on an OS and the OS has taken steps to ensure the requirement is met, then the application need not worry about it. I don't think I fully understand what this means exactly. Our particular target is the mx27 (ARM9). Out of habit, we make all the memory for the thread stacks in our applications 4 byte aligned. Is this enough? Is it really necessary? I have found some packages in the kernel (specifically, bsd_tcpip) that has thread stack memory allocated with no alignment attribute set. This got me wondering how this all works. I would love to here from someone with a much better grasp on this. -- Mike