From 631b7729a94aab2d78afc41ddd7a57a6f6e30d8f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 25 Mar 2026 18:42:51 -0400 Subject: [PATCH] m1x/x86_64: Add CPUID macro helper Signed-off-by: Ian Moffett --- src/m1x/include/arch/x86_64/cpuid.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/m1x/include/arch/x86_64/cpuid.h diff --git a/src/m1x/include/arch/x86_64/cpuid.h b/src/m1x/include/arch/x86_64/cpuid.h new file mode 100644 index 0000000..a504d44 --- /dev/null +++ b/src/m1x/include/arch/x86_64/cpuid.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2026, Mirocom Laboratories + * Provided under the BSD-3 clause + */ + +#ifndef _MACHINE_CPUID_H_ +#define _MACHINE_CPUID_H_ 1 + +#include +#include + +#define CPUID(level, a, b, c, d) \ + __asmv("cpuid\n\t" \ + : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ + : "0" (level)) + +#endif /* !_MACHINE_CPUID_H_ */