Chromium Code Reviews| 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) | |
| 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) | |
| 29 if (base::win::OSInfo::GetInstance()->architecture() == X64_ARCHITECTURE) | |
|
dmichael (off chromium)
2014/03/11 21:58:04
Wasn't there a comment at some point about checkin
| |
| 30 return kNexeArchX86_64; | |
| 31 else | |
| 32 return kNexeArchX86_32; | |
| 33 #else | |
| 34 #if ARCH_CPU_64_BITS | |
|
dmichael (off chromium)
2014/03/11 21:58:04
optional nit: #elif might be clearer?
| |
| 35 return kNexeArchX86_64; | |
| 36 #else | |
| 37 return kNexeArchX86_32; | |
| 38 #endif // defined(OS_WIN) | |
| 39 | |
| 40 #else | |
| 41 #error Architecture not supported. | |
| 42 NOTREACHED(); | |
| 43 return NULL; | |
| 44 #endif | |
| 45 } | |
| 46 | |
| 47 } // namespace nacl | |
| OLD | NEW |