示例#1
0
int main(void) {
  NaClLogModuleInit();

  if (NaClOsIsSupported() != 1) return -1;
  printf("OS is supported\n");

  if (NaCl_ThisCPUIsBlacklisted()) return -1;
  printf("CPU is not blacklisted\n");

  TestDEPCheckFailurePath();

  if (NaClCheckDEP() != 1) return -1;
  printf("DEP is either working or not required\n");

  if (!CPUIDImplIsValid()) return -1;
  printf("CPUID implementation looks okay\n");

  /*
   * don't use the white list for now
   * if (NaCl_CPUIsWhitelisted() == 0) return -1;
   * printf("CPU is whitelisted\n");
   */

  printf("platform_qual_test: PASS\n");
  return 0;
}
示例#2
0
int main(void) {
  NaClCPUData data;
  NaClCPUDataGet(&data);
  printf("white list ID: %s\n", GetCPUIDString(&data));
  if (NaCl_ThisCPUIsWhitelisted()) {
    printf("this CPU is on the whitelist\n");
  } else {
    printf("this CPU is NOT on the whitelist\n");
  }
  if (NaCl_ThisCPUIsBlacklisted()) {
    printf("this CPU is on the blacklist\n");
  } else {
    printf("this CPU is NOT on the blacklist\n");
  }

  CPUIDWhitelistUnitTests();
  return 0;
}
NaClErrorCode NaClRunSelQualificationTests(void) {
  if (!NaClOsIsSupported()) {
    return LOAD_UNSUPPORTED_OS_PLATFORM;
  }

  if (!NaClCheckDEP()) {
    return LOAD_DEP_UNSUPPORTED;
  }

#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86
  if (NaCl_ThisCPUIsBlacklisted()) {
    return LOAD_UNSUPPORTED_CPU;
  }
#endif

#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
  if (!NaClQualifyFpu()) {
    return LOAD_UNSUPPORTED_CPU;
  }
#endif

  return LOAD_OK;
}