You've already forked go-linux-lowlevel-hw
mirror of
https://github.com/Dasharo/go-linux-lowlevel-hw.git
synced 2026-03-06 15:26:03 -08:00
* Remove functions from API: IsReservedInE820, UsableMemoryAbove4G, UsableMemoryBelow4G * Keep them as convenience functions in package * Adapt test Signed-off-by: Christopher Meis <christopher.meis@9elements.com>
31 lines
522 B
Go
31 lines
522 B
Go
package hwapi
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestE820ReservedCheck(t *testing.T) {
|
|
h := GetAPI()
|
|
if os.Getenv("RUN_IN_QEMU") != "TRUE" {
|
|
t.Skip("Not running on QEMU")
|
|
}
|
|
|
|
ranges := []struct {
|
|
start uint64
|
|
end uint64
|
|
}{
|
|
{0xf0000, 0xfffff},
|
|
{0xfffc0000, 0xffffffff},
|
|
}
|
|
|
|
for _, s := range ranges {
|
|
reserved, err := IsReservedInE820(h, s.start, s.end)
|
|
if err != nil {
|
|
t.Errorf("Checking range %x-%x failed: %s", s.start, s.end, err)
|
|
}
|
|
|
|
t.Logf("range %x-%x: %t", s.start, s.end, reserved)
|
|
}
|
|
}
|