Skip to content

Commit

Permalink
Merge pull request #83 from Laisky/laisky
Browse files Browse the repository at this point in the history
fix: function asmCpuid missing Go declaration
  • Loading branch information
deeglaze authored Sep 21, 2023
2 parents c9150c5 + 59c4911 commit 307fceb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ func TestSnpPlatformInfo(t *testing.T) {
}
}

func TestCpuid(t *testing.T) {
a, b, c, d := cpuid(1)
if (a | b | c | d) == 0 {
t.Errorf("cpuid(1) = 0, 0, 0, 0")
}
}

func TestCertTableProto(t *testing.T) {
headers := make([]CertTableHeaderEntry, 6) // ARK, ASK, VCEK, VLEK, extra, NULL
arkraw := []byte("ark")
Expand Down
10 changes: 10 additions & 0 deletions abi/cpuid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build !amd64 || gccgo
// +build !amd64 gccgo

package abi

func init() {
cpuid = func(uint32) (uint32, uint32, uint32, uint32) {
return 0, 0, 0, 0
}
}
10 changes: 10 additions & 0 deletions abi/cpuid_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build amd64 && !gccgo
// +build amd64,!gccgo

package abi

func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32)

func init() {
cpuid = asmCpuid
}

0 comments on commit 307fceb

Please sign in to comment.