From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [66.216.25.90]) by sourceware.org (Postfix) with ESMTPS id 5611E3858C53 for ; Sat, 18 Mar 2023 01:09:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5611E3858C53 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.baldwin.net (c-98-35-126-114.hsd1.ca.comcast.net [98.35.126.114]) by mail.baldwin.cx (Postfix) with ESMTPSA id DB68A1A84E37 for ; Fri, 17 Mar 2023 21:09:19 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v4 03/13] nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count. Date: Fri, 17 Mar 2023 18:08:55 -0700 Message-Id: <20230318010905.14294-4-jhb@FreeBSD.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230318010905.14294-1-jhb@FreeBSD.org> References: <20230318010905.14294-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]); Fri, 17 Mar 2023 21:09:20 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_STATUS,KHOP_HELO_FCRDNS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --- 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 0955afba577..3ddf6c7b360 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.39.1