From owner-svn-src-head@freebsd.org Thu Jul 20 23:02:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8262DCFDDF8; Thu, 20 Jul 2017 23:02:06 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 144A07FCC7; Thu, 20 Jul 2017 23:02:06 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id w191so148273wmw.1; Thu, 20 Jul 2017 16:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TW8dP0xSqXLfTkWca3dFHb+QEAJaQCFxG1bz4amyYn8=; b=MgmHtnID7IBBRDJ3DQDFMEcWvnO1nATq7WgYnIzM34HRSJ87SZaDqzjvxcEo3wDDba 8HNjZDnQrTHVMA1lP4uE9ivx8mFMIQnr2RO8a+yu5c6CEuISFFHu/vq8RkMU8avqR/S0 OcAF8nk7wYeyBNz89n3duP71usN+ElsiDBqq4TuKxX0BOuAWcKxxkzkbv6esQAJn4UrG +ykXDENi/+kMqXtAx68401OClz20sfrYlmaX4MM336skOGc8HlhyYL8ByPgFH9gWKyzR guowRUtUbxSSS0gOOpwxyq1ornapmH7NWJJhDZ7JY93PENLdXloLS+rYWpFvKmdzbjhg frUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TW8dP0xSqXLfTkWca3dFHb+QEAJaQCFxG1bz4amyYn8=; b=CHpQ8N24vKP6x28SBasrYwOlWvbeNd9n3U/AG/n66sA4O4450O5846jWwCqO+24aTk 3LMhD1abZJzqw5dcF1+FEc1DV7KH22S403AQaERuKsz1zSueO+riq+Xu/PVceoFadbzE BKiewEibHNSDz4n8yiLCSHFiz28WvsLF2uppi1I6GvJd6r/SxQQBpzDegQW8+WXIPdyG 9e9k1Uxzc6Y0TvKGbqeG62QezNWyyzUtb2klkqCe0ScpX4VqkkqqRYcUWh5c5tk7z7dH zKDesfV6XxLDBHio8qJmBjvRPUn7IJq+EfxOVWIBk5f0tpHMwnn8y720EasBzAWAW/jY SEag== X-Gm-Message-State: AIVw111z8PGc2xUSR/QqZAHkF7I4qBbgielR9efgvbFqN4EBB8KFz2Oi 7kXU9EcOqQnWdJ2L6bZOaAZtiV7CCw== X-Received: by 10.28.229.72 with SMTP id c69mr3599611wmh.77.1500591723087; Thu, 20 Jul 2017 16:02:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.72 with HTTP; Thu, 20 Jul 2017 16:02:02 -0700 (PDT) In-Reply-To: <20170720103323.GG1935@kib.kiev.ua> References: <201707200647.v6K6l7Hq076554@repo.freebsd.org> <20170720172157.W1152@besplex.bde.org> <20170720103323.GG1935@kib.kiev.ua> From: Ryan Libby Date: Thu, 20 Jul 2017 16:02:02 -0700 Message-ID: Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys To: Konstantin Belousov Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, imp@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 23:02:06 -0000 On Thu, Jul 20, 2017 at 3:33 AM, Konstantin Belousov wrote: > On Thu, Jul 20, 2017 at 02:08:30AM -0700, Ryan Libby wrote: >> On Thu, Jul 20, 2017 at 1:01 AM, Bruce Evans wrote: [...] >> > This bug is not very common. There seem to be no instances of it in >> > (only sys/cdefs.h uses __attribute__(()), and it seems to use >> > underscores for all the attributes). Grepping sys/include/*.h for >> > attribute shows the following bugs: >> > >> > X amd64/include/efi.h:#define EFIABI_ATTR __attribute__((ms_abi)) >> > X i386/include/efi.h:#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ >> > X ofed/include/rdma/ib_user_mad.h:typedef unsigned long __attribute__((aligned(4))) packed_ulong; >> > X ofed/include/rdma/ib_smi.h:} __attribute__ ((packed)); >> > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); >> > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); >> > >> > The commented-out ms_abi was only a style bug. Now it is a larger style >> > bug -- it is different and worse than amd64. >> >> I'm not sure what to do about i386 there (again beyond fixing up the >> spelling in the comment). Maybe the unsupported architectures should >> just not be declaring EFIABI_ATTR at all? (Thoughts, kib?) > > I think i386 should be treated exactly same as amd64, i.e. EFIABI_ATTR > should be not defined if gcc < 4.4. Or I do not understand the scope > of the question. After googling around [1] and a quick check of the spec [2], it now seems to me that the i386 comment might just be erroneous. I think the right solution for sys/i386/include/efi.h may just be to delete the comment and leave that EFIAPI_ATTR macro definition as empty (always, no compiler version check) in order to use the native calling convention. [1] http://wiki.osdev.org/UEFI#Calling_Conventions [2] http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf