spi/amd64: Add CPUID helpers

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-04-17 04:13:36 -04:00
parent bed93f504b
commit d86282a59b
5 changed files with 35 additions and 5 deletions
+1
View File
@@ -6,3 +6,4 @@
*.o
/var
/usr/src/boot/stand
/usr/src/sp1/head/target
+6 -1
View File
@@ -10,7 +10,12 @@
#
.PHONY: all
all: common $(ARCH)
all: target common $(ARCH)
.PHONY: target
target:
mkdir -p head/target/machine/
rsync -avr head/$(ARCH)/*.h head/target/machine/
.PHONY: common
common:
+2 -1
View File
@@ -27,7 +27,8 @@ LD = \
CFLAGS = \
$(SYS_CFLAGS) \
-I../../head \
-I../../sp1/head\
-I../../sp1/head/target \
-I../../sp1/head \
-D_KERNEL
.PHONY: all
+1
View File
@@ -22,6 +22,7 @@ CC = ../../../../$(SYS_CC)
CFLAGS = \
$(SYS_CFLAGS) \
-I../head \
-I../head/target/ \
-I../../head \
-I../ext/flanterm/src/ \
-D_KERNEL \
+22
View File
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2026, Mirocom Laboratories
* All rights reserved.
*
* The following sources are CONFIDENTIAL and PROPRIETARY
* property of Mirocom Laboratories. Unauthorized copying,
* use, distribution or modification of this file, in whole
* and in part, is strictly prohibited without the prior written
* consent from Mirocom Laboratories.
*/
#ifndef _MACHINE_CPUID_H_
#define _MACHINE_CPUID_H_ 1
#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_ */