X-Git-Url: https://git.saurik.com/apple/boot.git/blobdiff_plain/57c72a9a9f2a263d364c2df1178760bd057c390f..bba600dda0ea8a76d875db7308f372bfc43f8506:/i386/libsaio/misc.c diff --git a/i386/libsaio/misc.c b/i386/libsaio/misc.c index 43d624a..64a6221 100644 --- a/i386/libsaio/misc.c +++ b/i386/libsaio/misc.c @@ -96,3 +96,47 @@ void enableA20() while (inb(PORT_B) & KB_INFULL); /* wait until done */ } +static inline void +do_cpuid(uint32_t selector, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a"(selector)); +} + + +//========================================================================== +// Check to see that this is a supported hardware configuration. +// If this hardware is supported, return 0. +// If this hardware is not supported, return an error code. + +int +checkForSupportedHardware() +{ + uint32_t cpuid_result[4]; + + do_cpuid(1, cpuid_result); + if ((cpuid_result[3] & 0x04000000) == 0) { + // Missing SSE2 + return 2; + } + return 0; +} + +#ifndef BOOT1 + +//========================================================================== +// Return the platform name for this hardware. +// + +void +getPlatformName(char *nameBuf) +{ + strcpy(nameBuf, "ACPI"); +} + +#endif +