From owner-freebsd-current@FreeBSD.ORG Wed Feb 7 09:20:59 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7E7416A402 for ; Wed, 7 Feb 2007 09:20:57 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.swip.net [212.247.154.33]) by mx1.freebsd.org (Postfix) with ESMTP id 89B5A13C474 for ; Wed, 7 Feb 2007 09:20:57 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.48] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe02.swip.net (CommuniGate Pro SMTP 5.0.12) with ESMTPA id 407736654; Wed, 07 Feb 2007 10:20:56 +0100 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Wed, 7 Feb 2007 10:20:34 +0100 User-Agent: KMail/1.9.5 References: <20070207004131.A62183@xorpc.icir.org> In-Reply-To: <20070207004131.A62183@xorpc.icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702071020.34656.hselasky@c2i.net> Cc: Luigi Rizzo Subject: Re: C macro to find the next power of 2 ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 09:20:59 -0000 Hi Luigi, Why don't you hardcode the structures with the correct alignment, and maybe you find the __align() macro useful. What you are discovering is an old issue. Hardware structures must be indexable without addition. --HPS