From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 21 15:48:29 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BD3106566C for ; Thu, 21 Jan 2010 15:48:29 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 68A918FC20 for ; Thu, 21 Jan 2010 15:48:28 +0000 (UTC) Received: by fxm10 with SMTP id 10so116503fxm.34 for ; Thu, 21 Jan 2010 07:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=ZZ6JMn2z08bkZEPFeGfeHGymAqt29Km0Ml38oiLxgBA=; b=AjsUd2AN4Vs4Mhkhr00nenMrcjkOdEYE1bVtGigTxE6xr0oMtCta29d9n91Y1PJ2UW +Ehk0C8TcJMzE2qc6UfxkBr1CgCRJFXT7MHUwfwBP+7DbYWf8T8FbpqnH3qDIoIMiuZ0 9Mj4kLyUobpE5ktGYL+fm5ywFTMcrahQQjuTM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=YfDBq9LbtydxVfZmceT/fVCemDgk8rgChLbBqRtfzFp4n+Unz9JPtXoXwgnqyiNYEB vxv8etf0YMq2LrZcgMI6DbVeZXjBxKNsm7n7MfgIRynPly9J5+yKVnIquydZCziRr/Vr 1D5Kfrt0G+KIbPeibhmoeI9tK0Qe90FoNkLX0= Received: by 10.87.40.26 with SMTP id s26mr2574149fgj.72.1264088907913; Thu, 21 Jan 2010 07:48:27 -0800 (PST) Received: from ?10.0.10.4? (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id 15sm681903fxm.6.2010.01.21.07.48.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 Jan 2010 07:48:27 -0800 (PST) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <4B582AC4.9030502@embedded-brains.de> Date: Thu, 21 Jan 2010 15:48:25 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <2B030914-1EC4-4887-856D-994FB66378F5@freebsd.org> References: <4B582AC4.9030502@embedded-brains.de> To: Sebastian Huber X-Mailer: Apple Mail (2.1077) Cc: FreeBSD-Hackers Subject: Re: ARM and structure size boundary X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 15:48:29 -0000 On 21 Jan 2010, at 10:21, Sebastian Huber wrote: > Hi, >=20 > on ARM the GCC has an option for the structure size boundary: >=20 > http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#ARM-Options >=20 > In the GCC sources (gcc/config/arm) you see that NetBSD changes the = default > value to 8 from 32. >=20 > For FreeBSD I did not found something similar. What value is used on = FreeBSD > by default? >=20 > This value is (or was) important for the network stack. Do you know = if the > current FreeBSD network stack is dependent on this value? In the file > gcc/config/arm/netbsd.h (GCC sources) is a comment about this topic. >=20 > Have a nice day! Just for clarification, on FreeBSD, given it's use of the default = structure size boundary, if you composing a packet format using a = structure, you need to use __packed if the structure is not a multiple = of 4. struct a { int8_t b; int8_t b; }; sizeof(struct a) on FreeBSD/arm is 4 and not 2. To make sure it will get = the correct value, you need to type: struct a { ... } __packed; -- Rui Paulo