From eaa0beca9179016a0c10c18ce43dc4c1de6819d7 Mon Sep 17 00:00:00 2001 From: Chloe M Date: Fri, 10 Jul 2026 15:24:51 -0400 Subject: [PATCH] ptos/amd64: Add CPUID helper macro Signed-off-by: Chloe M --- service/ptos/head/arch/amd64/cpuid.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 service/ptos/head/arch/amd64/cpuid.h diff --git a/service/ptos/head/arch/amd64/cpuid.h b/service/ptos/head/arch/amd64/cpuid.h new file mode 100644 index 0000000..033c271 --- /dev/null +++ b/service/ptos/head/arch/amd64/cpuid.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2026, Chloe M. + * Provided under the BSD-3 clause. + * + * Description: CPUID helper + * Author: Chloe M. + */ + +#ifndef _MACHINE_CPUID_H_ +#define _MACHINE_CPUID_H_ 1 + +#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_ */