From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cAbDG3eZcWL8GAQAWB0awg (envelope-from ) for ; Tue, 03 May 2022 17:07:03 -0400 Received: by simark.ca (Postfix, from userid 112) id 6F0B61E048; Tue, 3 May 2022 17:07:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 0340A1E00E for ; Tue, 3 May 2022 17:07:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1A61385742F for ; Tue, 3 May 2022 21:07:02 +0000 (GMT) Received: from mail.baldwin.cx (bigwig.baldwin.cx [66.216.25.90]) by sourceware.org (Postfix) with ESMTPS id A983E3858D3C for ; Tue, 3 May 2022 21:06:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A983E3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id DFB9C1A84E2E; Tue, 3 May 2022 17:06:09 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v3 03/13] nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count. Date: Tue, 3 May 2022 14:05:05 -0700 Message-Id: <20220503210515.30739-4-jhb@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220503210515.30739-1-jhb@FreeBSD.org> References: <20220503210515.30739-1-jhb@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Tue, 03 May 2022 17:06:10 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean 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: , Cc: "George, Jini Susan" Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --- gdb/nat/x86-cpuid.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gdb/nat/x86-cpuid.h b/gdb/nat/x86-cpuid.h index a42b4b2b08c..1dbb08d8222 100644 --- a/gdb/nat/x86-cpuid.h +++ b/gdb/nat/x86-cpuid.h @@ -48,6 +48,25 @@ x86_cpuid (unsigned int __level, return __get_cpuid (__level, __eax, __ebx, __ecx, __edx); } +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) + __eax = &__scratch; + if (!__ebx) + __ebx = &__scratch; + if (!__ecx) + __ecx = &__scratch; + if (!__edx) + __edx = &__scratch; + + return __get_cpuid_count (__level, __sublevel, __eax, __ebx, __ecx, __edx); +} + #else static __inline int @@ -58,6 +77,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.34.1