From owner-svn-src-head@freebsd.org Thu Jul 20 09:08:34 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 38758DAD076; Thu, 20 Jul 2017 09:08:34 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::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 AC109389B; Thu, 20 Jul 2017 09:08:33 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id v105so37875546wrb.0; Thu, 20 Jul 2017 02:08:33 -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=m9yp+x6BZ6R4WPTNytEwb5cwzMFo+kWSQNxU2+xu4m8=; b=TT7XL+GFUZKOTE/ViLiJLzYMcnuyGlbobj7q/DJleiBLbZ8uZFiMUwr+9CYeKLWzH7 hyKhrIANE/3g+Ua4InNFPUd1drfXBBXjpu/FdQJs0qRGVMe8d+fFGR47cxjM/KAWvNWJ C3WILcXevRRJEnG17S8VIldyMVaV5FIiRyUc58nlizERVEkCeaqL6OebxOlCd6RcFR3N brmm/mCdwYGvyhzU7Dlnrq/LxJnkc3+8DcsqWVeNOgeFNs0qS6gsyOKHGkCPbhTtEB0/ 8gssWvxux9Rr5f3Ko4KGI4xpX4HhUM0Fm5leGmx+npMTIc9E4YTpRjxNM43JlkEqbojC cGYw== 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=m9yp+x6BZ6R4WPTNytEwb5cwzMFo+kWSQNxU2+xu4m8=; b=VMNnWzlgqlnKxScRDQdhC1vl6vSoZd/mGjKJFNknCi5s/kMOM7eaWsUDWO/GU61NE4 NfpDRlGsK7aCXTza9pjU79RKuB3+uK2x92gHEpr7jyVQf0wwl6JW+dqUM1daRZwsdzuu gqeOiAEJwtHlx7fRrAnKp172eXcKGdarTHir4Pm52Yz2bW31CR5rfh43YW9mzSQlCWzP 6UH6P6/RdsFbtYC1FWvvyWhw/EqV4kI/1cklv+6Da3zSUpRpEav3w8JUhKsk+Q0MPxdg JqAHY79hnKs/rLkqFpr9tQreayOx77zrp09ZKzui3rolfNhzMk1ZCgzzTzm7MQZ1v8Kq /4Iw== X-Gm-Message-State: AIVw113sHHk0LUeya1y4fbC2jLtQBp7HMPncd5+PwadGixaf+z7+774k /klyYvi/Ap4yJyFKr66tFgcyMPbX0En8 X-Received: by 10.223.131.67 with SMTP id 61mr6592999wrd.54.1500541711498; Thu, 20 Jul 2017 02:08:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.72 with HTTP; Thu, 20 Jul 2017 02:08:30 -0700 (PDT) In-Reply-To: <20170720172157.W1152@besplex.bde.org> References: <201707200647.v6K6l7Hq076554@repo.freebsd.org> <20170720172157.W1152@besplex.bde.org> From: Ryan Libby Date: Thu, 20 Jul 2017 02:08:30 -0700 Message-ID: Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys To: Bruce Evans , kib@freebsd.org Cc: Ryan Libby , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@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 09:08:34 -0000 On Thu, Jul 20, 2017 at 1:01 AM, Bruce Evans wrote: > On Thu, 20 Jul 2017, Ryan Libby wrote: >> Modified: head/sys/amd64/include/efi.h >> >> ============================================================================== >> --- head/sys/amd64/include/efi.h Thu Jul 20 05:43:48 2017 >> (r321283) >> +++ head/sys/amd64/include/efi.h Thu Jul 20 06:47:06 2017 >> (r321284) >> @@ -36,8 +36,14 @@ >> * XXX: from gcc 6.2 manual: >> * Note, the ms_abi attribute for Microsoft Windows 64-bit targets >> * currently requires the -maccumulate-outgoing-args option. >> + * >> + * Avoid EFIABI_ATTR declarations for compilers that don't support it. >> + * GCC support began in version 4.4. >> */ >> +#if defined(__clang__) || defined(__GNUC__) && \ >> + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) >> #define EFIABI_ATTR __attribute__((ms_abi)) > > > This is still broken. ms_abi is in the application namespace. Thus > my hack of defining it to nothing is valid, and so is defining it to > 'syntax error', but the latter shows the brokenness of EFIABI_ATTR. To be clear, you're referring to how ms_abi is spelled here without underscores? I can prepare a follow-up to spell it as __attribute__((__ms_abi__)) >> +#endif >> >> #ifdef _KERNEL >> struct uuid; >> >> Modified: head/sys/sys/efi.h >> >> ============================================================================== >> --- head/sys/sys/efi.h Thu Jul 20 05:43:48 2017 (r321283) >> +++ head/sys/sys/efi.h Thu Jul 20 06:47:06 2017 (r321284) >> @@ -122,6 +122,9 @@ struct efi_tblhdr { >> uint32_t __res; >> }; >> >> +#ifdef _KERNEL >> + >> +#ifdef EFIABI_ATTR >> struct efi_rt { >> struct efi_tblhdr rt_hdr; >> efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *) >> @@ -144,6 +147,7 @@ struct efi_rt { >> efi_status (*rt_reset)(enum efi_reset, efi_status, u_long, >> efi_char *) EFIABI_ATTR; > > > This was more broken when it was outside of _KERNEL. > >> }; >> +#endif >> >> struct efi_systbl { >> struct efi_tblhdr st_hdr; >> @@ -163,7 +167,6 @@ struct efi_systbl { >> uint64_t st_cfgtbl; >> }; >> >> -#ifdef _KERNEL >> extern vm_paddr_t efi_systbl_phys; >> #endif /* _KERNEL */ > > > 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?)