spi/amd64: Add CPUID helpers
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -6,3 +6,4 @@
|
||||
*.o
|
||||
/var
|
||||
/usr/src/boot/stand
|
||||
/usr/src/sp1/head/target
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -24,10 +24,11 @@ CC = \
|
||||
LD = \
|
||||
../../../../$(SYS_LD)
|
||||
|
||||
CFLAGS = \
|
||||
$(SYS_CFLAGS) \
|
||||
-I../../head \
|
||||
-I../../sp1/head\
|
||||
CFLAGS = \
|
||||
$(SYS_CFLAGS) \
|
||||
-I../../head \
|
||||
-I../../sp1/head/target \
|
||||
-I../../sp1/head \
|
||||
-D_KERNEL
|
||||
|
||||
.PHONY: all
|
||||
|
||||
@@ -22,6 +22,7 @@ CC = ../../../../$(SYS_CC)
|
||||
CFLAGS = \
|
||||
$(SYS_CFLAGS) \
|
||||
-I../head \
|
||||
-I../head/target/ \
|
||||
-I../../head \
|
||||
-I../ext/flanterm/src/ \
|
||||
-D_KERNEL \
|
||||
|
||||
@@ -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_ */
|
||||
Reference in New Issue
Block a user