TestingPlatformCommon

module testing.platform;

enum IsaFamily // Instruction Set Architecture
{
    Unknown,

    Arm,
    Avr,
    Pic,
    Stm,
    Xtensa,

    X86, // see "address_width" to differentiate between Intel 16/32 bit x86, and AMD 64 bit x86-64
    Ia64, // Itanium, dont confuse with x86-64
    Mips,
    PowerPc,

}

enum Machine
{
    Unknown,

    None = 1, // generic microcontroller
    OpenFirmware = 2, // (FDT) popular with SoCs
    PcBios = 4, // IBM Compatible / PC
    Acpi = 8, //
    Efi = 16 // Used on both PC/AT hardware, and some SoC/ARM boards
}

enum OsFamily
{
    Unknown,

    None, // generic embedded
    Rtos, // generic rtos

    Dos,
    Unix,
    Linux,
    Macos,
    Windows,

    Android,
    Ios,
    WindowsMobile, // Regarded as different from "Windows", because the usual API and services arent available. Just as Ios is different from MacOs
}

struct PlatformInfo
{
    IsaFamily isa_family;
    Machine machine;
    u16 address_width; // 32 for 32bit platforms, 64 for 64bit platforms, etc. (The most practical number is used here, so even if a "32" bit platform happens to have 64bit of addressing, the number here will be 32, if that's what is practically expected, say from primary ALU widths.)
    OsFamily os_family;
    u32 kernel_version_major;
    u32 kernel_version_minor;
    u32 kernel_version_fix;
    u32 kernel_version_build;
    c8[] os_variant; // Windows2000, Windows10, debian, mandrivia, redhat, ubuntu, OsXv10.0, OsXv10.11, WindowsServer2003, RedHatEnterprise, OsXServer
}

PlatformInfo GetPlatformInfo();

enum IsaExtension
{
     Fpu      = 1,
     Thumb    = 2,
     Neon     = 4,
     Mmx      = 8,
     Sse      = 16,
}

IsaExtension GetIsaExtensions();