From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 9 10:34:32 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E59106564A; Fri, 9 Jul 2010 10:34:32 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 565B68FC20; Fri, 9 Jul 2010 10:34:30 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA19608; Fri, 09 Jul 2010 13:34:27 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OXAuZ-0006jl-FO; Fri, 09 Jul 2010 13:34:27 +0300 Message-ID: <4C36FB32.30901@freebsd.org> Date: Fri, 09 Jul 2010 13:34:26 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: "Bjoern A. Zeeb" , freebsd-hackers@freebsd.org References: <4C246CD0.3020606@freebsd.org> <20100702082754.S14969@maildrop.int.zabbadoz.net> <4C320E6E.4040007@freebsd.org> <20100705171155.K14969@maildrop.int.zabbadoz.net> <4C321409.2070500@freebsd.org> <4C343C68.8010302@freebsd.org> In-Reply-To: <4C343C68.8010302@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , Navdeep Parhar , Peter Wemm Subject: Re: elf obj load: skip zero-sized sections early 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: Fri, 09 Jul 2010 10:34:32 -0000 Having thought and experimented more, I don't see why we need inline assembly at all and why DPCPU_DEFINE can not simply be defined as follows: #define DPCPU_DEFINE(t, n) \ t DPCPU_NAME(n) __section("set_pcpu") \ __aligned(CACHE_LINE_SIZE) __used And, honestly, I can not understand the following comment in pcpu.h, although I think I understand what's going on. > /* > * Define a set for pcpu data. > * > * We don't use SET_DECLARE because it defines the set as 'a' when we Hmm, SET_DECLARE doesn't do anything like that. Perhaps __MAKE_SET or one of its aliases was meant here? > * want 'aw'. gcc considers uninitialized data in a separate section > * writable, and there is no generic zero initializer that works for > * structs and scalars. > */ So, what's the problem here? Don't we want that data to be considered writable? Haven't we just said that we want "aw"? Don't we explicitly create a section with "aw" flags? And why do we need a (universal) initializer? Why is it mentioned here at all? Educate me. I demand it! :-) -- Andriy Gapon