1 : /*
2 : * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 : * Use of this source code is governed by a BSD-style license that can be
4 : * found in the LICENSE file.
5 : */
6 :
7 : #include "native_client/src/trusted/service_runtime/sel_qualify.h"
8 :
9 : #include "native_client/src/trusted/platform_qualify/nacl_cpuwhitelist.h"
10 : #include "native_client/src/trusted/platform_qualify/nacl_dep_qualify.h"
11 : #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h"
12 : #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
13 : #include "native_client/src/trusted/platform_qualify/arch/arm/nacl_arm_qualify.h"
14 : #endif
15 :
16 12 : NaClErrorCode NaClRunSelQualificationTests() {
17 12 : if (!NaClOsIsSupported()) {
18 0 : return LOAD_UNSUPPORTED_OS_PLATFORM;
19 : }
20 :
21 12 : if (!NaClCheckDEP()) {
22 0 : return LOAD_DEP_UNSUPPORTED;
23 : }
24 :
25 : #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86
26 12 : if (NaCl_ThisCPUIsBlacklisted()) {
27 0 : return LOAD_UNSUPPORTED_CPU;
28 : }
29 : #endif
30 :
31 : #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
32 : if (!NaClQualifyReadTp()) {
33 : return LOAD_UNSUPPORTED_OS_PLATFORM;
34 : }
35 : #endif
36 :
37 12 : return LOAD_OK;
38 : }
|