linux/arch/x86/include/asm/cpuid.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * CPUID-related helpers/definitions
 */

#ifndef _ASM_X86_CPUID_H
#define _ASM_X86_CPUID_H

#include <asm/string.h>

struct cpuid_regs {};

enum cpuid_regs_idx {};

#ifdef CONFIG_X86_32
extern int have_cpuid_p(void);
#else
static inline int have_cpuid_p(void)
{}
#endif
static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
				unsigned int *ecx, unsigned int *edx)
{}

#define native_cpuid_reg(reg)

/*
 * Native CPUID functions returning a single datum.
 */
native_cpuid_reg()
native_cpuid_reg()
native_cpuid_reg()
native_cpuid_reg()

#ifdef CONFIG_PARAVIRT_XXL
#include <asm/paravirt.h>
#else
#define __cpuid
#endif

/*
 * Generic CPUID function
 * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
 * resulting in stale register contents being returned.
 */
static inline void cpuid(unsigned int op,
			 unsigned int *eax, unsigned int *ebx,
			 unsigned int *ecx, unsigned int *edx)
{}

/* Some CPUID calls want 'count' to be placed in ecx */
static inline void cpuid_count(unsigned int op, int count,
			       unsigned int *eax, unsigned int *ebx,
			       unsigned int *ecx, unsigned int *edx)
{}

/*
 * CPUID functions returning a single datum
 */
static inline unsigned int cpuid_eax(unsigned int op)
{}

static inline unsigned int cpuid_ebx(unsigned int op)
{}

static inline unsigned int cpuid_ecx(unsigned int op)
{}

static inline unsigned int cpuid_edx(unsigned int op)
{}

static inline void __cpuid_read(unsigned int leaf, unsigned int subleaf, u32 *regs)
{}

#define cpuid_subleaf(leaf, subleaf, regs)

#define cpuid_leaf(leaf, regs)

static inline void __cpuid_read_reg(unsigned int leaf, unsigned int subleaf,
				    enum cpuid_regs_idx regidx, u32 *reg)
{}

#define cpuid_subleaf_reg(leaf, subleaf, regidx, reg)

#define cpuid_leaf_reg(leaf, regidx, reg)

static __always_inline bool cpuid_function_is_indexed(u32 function)
{}

#define for_each_possible_hypervisor_cpuid_base(function)

static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
{}

#endif /* _ASM_X86_CPUID_H */