OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // be found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "native_client/src/trusted/plugin/nexe_arch.h" | 5 #include "native_client/src/trusted/plugin/nexe_arch.h" |
6 #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h" | 6 #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h" |
7 | 7 |
8 namespace { | 8 namespace { |
9 // The list of supported ISA strings for x86. See issue: | 9 // The list of supported ISA strings for x86. See issue: |
10 // http://code.google.com/p/nativeclient/issues/detail?id=1040 for more | 10 // http://code.google.com/p/nativeclient/issues/detail?id=1040 for more |
11 // information. Note that these string are to be case-insensitive compared. | 11 // information. Note that these string are to be case-insensitive compared. |
12 const char* const kNexeArchX86_32 = "x86-32"; | 12 const char* const kNexeArchX86_32 = "x86-32"; |
13 const char* const kNexeArchX86_64 = "x86-64"; | 13 const char* const kNexeArchX86_64 = "x86-64"; |
14 } // namespace | 14 } // namespace |
15 | 15 |
16 namespace plugin { | 16 namespace plugin { |
17 const char* GetSandboxISA() { | 17 const char* GetSandboxISA() { |
18 #if defined(NACL_ARCH_CPU_X86_64) && (defined(NACL_LINUX) || defined(NACL_OSX)) | 18 #if defined(NACL_ARCH_CPU_X86_64) && (defined(NACL_LINUX) || defined(NACL_OSX)) |
19 return kNexeArchX86_64; // 64-bit Linux or Mac. | 19 return kNexeArchX86_64; // 64-bit Linux or Mac. |
20 #else | 20 #else |
21 return NaClOsIs64BitWindows() == 1 | 21 return NaClOsIs64BitWindows() == 1 |
22 ? kNexeArchX86_64 // 64-bit Windows (Chrome, Firefox) | 22 ? kNexeArchX86_64 // 64-bit Windows (Chrome, Firefox) |
23 : kNexeArchX86_32; // everything else. | 23 : kNexeArchX86_32; // everything else. |
24 #endif | 24 #endif |
25 } | 25 } |
26 } // namespace plugin | 26 } // namespace plugin |
OLD | NEW |