OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // The list of supported ISA strings for x86. See issue: | |
6 // http://code.google.com/p/nativeclient/issues/detail?id=1040 for more | |
7 // information. Note that these string are to be case-insensitive compared. | |
8 | |
9 #include "base/logging.h" | |
10 #if defined(OS_WIN) && ARCH_CPU_32_BITS | |
11 #include "base/win/windows_version.h" | |
12 #endif | |
13 | |
14 const char* const kNexeArchARM = "arm"; | |
15 const char* const kNexeArchMIPS = "mips32"; | |
16 const char* const kNexeArchX86_32 = "x86-32"; | |
17 const char* const kNexeArchX86_64 = "x86-64"; | |
18 | |
19 namespace nacl { | |
20 | |
21 const char* GetSandboxISA() { | |
22 #if defined(ARCH_CPU_ARM_FAMILY) | |
23 return kNexeArchArm; | |
24 #elif defined(ARCH_CPU_MIPS_FAMILY) | |
25 return kNexeArchMIPS; | |
26 #elif defined(ARCH_CPU_X86_FAMILY) | |
27 | |
28 #if defined(OS_WIN) && ARCH_CPU_32_BITS | |
29 // 32-bit Windows build, so we have to determine the OS architecture. | |
30 if (base::win::OSInfo::GetInstance()->architecture() == X64_ARCHITECTURE) | |
31 return kNexeArchX86_64; | |
32 else | |
33 return kNexeArchX86_32; | |
34 #else | |
35 return kNexeArchX86_64; | |
dmichael (off chromium)
2014/03/11 19:00:16
That doesn't seem right for Linux 32 and possibly
| |
36 #endif // defined(OS_WIN) && ARCH_CPU_32_BITS | |
37 | |
38 #else | |
39 #error Architecture not supported. | |
40 NOTREACHED(); | |
41 return NULL; | |
42 #endif | |
43 } | |
44 | |
45 } // namespace nacl | |
OLD | NEW |