From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QDbgHB93wWRZ8y8AWB0awg (envelope-from ) for ; Wed, 26 Jul 2023 15:42:23 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=IHAakbBh; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 737821E0C0; Wed, 26 Jul 2023 15:42:23 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 561D11E00F for ; Wed, 26 Jul 2023 15:42:21 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D33DD3858025 for ; Wed, 26 Jul 2023 19:42:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D33DD3858025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690400539; bh=DzcqvLcjnveiorLqGuCdOxJrCcuRF1QG5vk97G44ZDA=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IHAakbBhve8FHVrydW5BXW6wSE5NIG8V8K3uIHO9Wu95lTwvtau+mt27MqI5Ums8L xGbQ2UeVlZqZcJKZq3Wq7K5M8XTD854wKDj3Xiz+Tn8RbT72oU/X4r7QYwyWuinU9u lIzqp+0E+oukmf6suDq83dF7nqepxMTYFTe85JqM= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id E5D263858D35 for ; Wed, 26 Jul 2023 19:42:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5D263858D35 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 36QJfsOn007865 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 15:41:58 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 36QJfsOn007865 Received: from [10.0.0.170] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id F2ACF1E00F; Wed, 26 Jul 2023 15:41:53 -0400 (EDT) Message-ID: <78d7734c-b437-009d-0905-281890fe5b28@polymtl.ca> Date: Wed, 26 Jul 2023 15:41:53 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 04/15] nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count. Content-Language: fr To: John Baldwin , gdb-patches@sourceware.org References: <20230714155151.21723-1-jhb@FreeBSD.org> <20230714155151.21723-5-jhb@FreeBSD.org> In-Reply-To: <20230714155151.21723-5-jhb@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 26 Jul 2023 19:41:54 +0000 X-Spam-Status: No, score=-3037.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 7/14/23 11:51, John Baldwin wrote: > --- > gdb/nat/x86-cpuid.h | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/gdb/nat/x86-cpuid.h b/gdb/nat/x86-cpuid.h > index 0955afba577..517113d45e8 100644 > --- a/gdb/nat/x86-cpuid.h > +++ b/gdb/nat/x86-cpuid.h > @@ -48,6 +48,30 @@ x86_cpuid (unsigned int __level, > return __get_cpuid (__level, __eax, __ebx, __ecx, __edx); > } > > +/* Return cpuid data for requested cpuid level and sub-level, as found > + in returned eax, ebx, ecx and edx registers. The function checks > + if cpuid is supported and returns 1 for valid cpuid information or > + 0 for unsupported cpuid level. Pointers may be non-null. */ > + > +static __inline int > +x86_cpuid_count (unsigned int __level, unsigned int __sublevel, > + unsigned int *__eax, unsigned int *__ebx, > + unsigned int *__ecx, unsigned int *__edx) > +{ > + unsigned int __scratch; > + > + if (__eax == nullptr) > + __eax = &__scratch; > + if (__ebx == nullptr) > + __ebx = &__scratch; > + if (__ecx == nullptr) > + __ecx = &__scratch; > + if (__edx == nullptr) > + __edx = &__scratch; > + > + return __get_cpuid_count (__level, __sublevel, __eax, __ebx, __ecx, __edx); > +} > + > #else > > static __inline int > @@ -58,6 +82,14 @@ x86_cpuid (unsigned int __level, > return 0; > } > > +static __inline int > +x86_cpuid_count (unsigned int __level, unsigned int __sublevel, > + unsigned int *__eax, unsigned int *__ebx, > + unsigned int *__ecx, unsigned int *__edx) > +{ > + return 0; > +} > + > #endif /* i386 && x86_64 */ > > #endif /* NAT_X86_CPUID_H */ > -- > 2.40.0 > Approved-By: Simon Marchi Simon