From 85bdc136388b07d039610df97362f07fe6529e2c Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 1 Apr 2016 16:45:09 +0600 Subject: Crude support for building on non-x86 architectures. Right now the CPUID procedure is made to return zeroes on non-x86 platforms through conditional compilation. A cleaner solution would be to use separate procedures and specify implementation through gprbuild directives. --- src/hypervisor_check.adb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/hypervisor_check.adb b/src/hypervisor_check.adb index b6c8719..4d87cb0 100644 --- a/src/hypervisor_check.adb +++ b/src/hypervisor_check.adb @@ -22,6 +22,7 @@ package body Hypervisor_Check is function CPUID (Arg : Unsigned_32) return CPUID_Registers is eax, ebx, ecx, edx : Unsigned_32; begin + #if X86 then Asm("cpuid", Outputs => (Unsigned_32'Asm_Output ("=a", eax), Unsigned_32'Asm_Output ("=b", ebx), @@ -29,6 +30,9 @@ package body Hypervisor_Check is Unsigned_32'Asm_Output ("=d", edx)), Inputs => Unsigned_32'Asm_Input ("a", Arg)); return (eax, ebx, ecx, edx); + #else + return (0, 0, 0, 0); + #end if; end CPUID; -- Convert an unsigned 32-bit integer to a string of 4 characters -- cgit v1.2.3