init: v1.0.0
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
package cpu
|
||||
|
||||
//go:noescape
|
||||
func cpuid() uint64
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "textflag.h"
|
||||
|
||||
// __asm__("mrs %0, MIDR_EL1" : "=r"(arm_cpuid));
|
||||
TEXT ·cpuid(SB), NOSPLIT, $0
|
||||
MRS MIDR_EL1, R0
|
||||
MOVD R0, res+0(FP)
|
||||
RET
|
||||
@@ -0,0 +1,10 @@
|
||||
package cpu
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCPUID(t *testing.T) {
|
||||
fmt.Println(cpuid())
|
||||
}
|
||||
Reference in New Issue
Block a user