From owner-svn-src-all@freebsd.org Fri Dec 4 16:31:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BEFA4A5413 for ; Fri, 4 Dec 2020 16:31:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CndWl753Hz3C9y for ; Fri, 4 Dec 2020 16:31:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf33.google.com with SMTP id ek7so3027419qvb.6 for ; Fri, 04 Dec 2020 08:31:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RcAwfRICuocvaqbZOph2T2EZiVhXwzctvypRzVN3IXo=; b=Jk+Q1/1b4R9aLF5jy3P7sjeVsh1HRGK2Ia+fmJX8IAOnzKL+XTKawvk0r1m5QF4hFQ uMpgJv4rPenVZbJbpk51PFuYr1Emnz6UHVi3T6c5nXn2X4S/6Hp++6SEjC2L9jJlO+MG X5scJsxv6/KD6wjspp1eAlvKQk2dyIjLBfoeIdn8jYuaihU6Q7upmx/fj1+8EicdkJT+ pSU07RMIJ8pQ6vrFb5iEkXu4EF8ZdEBR8cIwVOnmJ0f3uPFrkuH2ghcQX1WFf2xBLcN6 qyjflyImA+xKnlnzp4tIViF1osdGAAqK8Slpre89v6gkD3Bt/nKkISfP+QVGoMDkwGF2 LoXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RcAwfRICuocvaqbZOph2T2EZiVhXwzctvypRzVN3IXo=; b=joFSBngzgV+4QwWzIkh9zAmhapb5E0tfVpcTLz8FQJ46Xrc8oLDsBAj4rR4u39CE0o fHPE5Or+/D4B6FZ9xetfCE2TGnMdRIAzIJZQyZcWYlD5tRCEJgZwfJG9t/CVkGngijbk Btp81Zu+ajGqffbI4eN310SUKnrL/DwG2VxcwFt5CPUz7dmZWKzqUzOP6tM4w/yI/Rc2 uD770+zYiK4kMszBhu7whXowjEMP3Rk/kRs3IqHlfRemXwHqdfWW7UGh+W/6fsNStLKi cLmn6O1PPogTH6uADNuTdyoQqXGROZAW/Yv859oM2VaVoG4Fj+VxekhSA4D/BS7Nh7f5 1Smg== X-Gm-Message-State: AOAM5331Vt5uooL7CEGIBq3eY8cPBCSNYQTsFhy7JkzDMoMd6hLzX8L3 7cjDNXUMJDtHh/9gAPbQ2fg8/ukTZgwU9SMIGn0vOw== X-Google-Smtp-Source: ABdhPJwAUgFs5YWeNSDwNb0Ubh8PXGnkE2kBKAO1IQxnCaauVOR0BhjR3rg0tDmH1mzC3+sge44sp4TmEVsCOvpFx8k= X-Received: by 2002:ad4:4743:: with SMTP id c3mr6165432qvx.62.1607099506574; Fri, 04 Dec 2020 08:31:46 -0800 (PST) MIME-Version: 1.0 References: <202012041450.0B4EouQ2024632@repo.freebsd.org> <6f9541e4-b216-8a93-881e-e3859bff84fa@selasky.org> In-Reply-To: <6f9541e4-b216-8a93-881e-e3859bff84fa@selasky.org> From: Warner Losh Date: Fri, 4 Dec 2020 09:31:35 -0700 Message-ID: Subject: Re: svn commit: r368329 - head/stand/kshim To: Hans Petter Selasky Cc: Alexander Richardson , src-committers , svn-src-all , svn-src-head , Konstantin Belousov X-Rspamd-Queue-Id: 4CndWl753Hz3C9y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2020 16:31:48 -0000 On Fri, Dec 4, 2020 at 9:06 AM Hans Petter Selasky wrote: > On 12/4/20 4:59 PM, Alexander Richardson wrote: > > On Fri, 4 Dec 2020 at 14:51, Hans Petter Selasky > wrote: > >> > >> Author: hselasky > >> Date: Fri Dec 4 14:50:55 2020 > >> New Revision: 368329 > >> URL: https://svnweb.freebsd.org/changeset/base/368329 > >> > >> Log: > >> Fix definition of int64_t and uint64_t when long is 64-bit. This > gets the kernel > >> shim code in line with the rest of the kernel, > sys/x86/include/_types.h. > >> > >> MFC after: 1 week > >> Sponsored by: Mellanox Technologies // NVIDIA Networking > >> > >> Modified: > >> head/stand/kshim/bsd_kernel.h > >> > >> Modified: head/stand/kshim/bsd_kernel.h > >> > ============================================================================== > >> --- head/stand/kshim/bsd_kernel.h Fri Dec 4 14:09:12 2020 > (r368328) > >> +++ head/stand/kshim/bsd_kernel.h Fri Dec 4 14:50:55 2020 > (r368329) > >> @@ -208,9 +208,17 @@ typedef unsigned int uint32_t; > >> #define _INT32_T_DECLARED > >> typedef signed int int32_t; > >> #define _UINT64_T_DECLARED > >> +#ifndef __LP64__ > >> typedef unsigned long long uint64_t; > >> +#else > >> +typedef unsigned long uint64_t; > >> +#endif > >> #define _INT16_T_DECLARED > >> +#ifndef __LP64__ > >> typedef signed long long int64_t; > >> +#else > >> +typedef signed long int64_t; > >> +#endif > >> > >> typedef uint16_t uid_t; > >> typedef uint16_t gid_t; > > > > Since we no longer support ancient compilers, could we simplify this > > and just use > > typedef __UINT64_TYPE__ uint64_t; > > typedef __INT64_TYPE__ int64_t; > > ? > > > > This will work across all architectures and ABIs, and appears to work > > starting with GCC 4.5.3 and Clang 3.5: > > https://godbolt.org/z/TWavfb > > Hi Alexander, > > I'm not sure how that definition will work together with existing code, > mixing uint64_t, unsigned long, and unsigned long long. Will this cause > more compiler warnings? This also will affect user-space and ports. > I think for the boot loader context, this suggestion will be completely fine. Since this file is only used there, it should be identical to your changes in that context. Warner > Maybe Konstantin, CC'ed, has some input on this? > > --HPS > >