m1x/x86_64: Add CPUID macro helper

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-03-25 18:42:51 -04:00
parent 6443b382f7
commit 631b7729a9

View File

@@ -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 <sys/types.h>
#include <sys/cdefs.h>
#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_ */