• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 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 #include "base/logging.h"
6 #if defined(OS_WIN)
7 #include "base/win/windows_version.h"
8 #endif
9 
10 namespace nacl {
11 
GetSandboxArch()12 const char* GetSandboxArch() {
13 #if defined(ARCH_CPU_ARM_FAMILY)
14   return "arm";
15 #elif defined(ARCH_CPU_MIPS_FAMILY)
16   return "mips32";
17 #elif defined(ARCH_CPU_X86_FAMILY)
18 
19 #if defined(OS_WIN)
20   // We have to check the host architecture on Windows.
21   // See sandbox_isa.h for an explanation why.
22   if (base::win::OSInfo::GetInstance()->architecture() ==
23       base::win::OSInfo::X64_ARCHITECTURE)
24     return "x86-64";
25   else
26     return "x86-32";
27 #elif ARCH_CPU_64_BITS
28   return "x86-64";
29 #else
30   return "x86-32";
31 #endif  // defined(OS_WIN)
32 
33 #else
34 #error Architecture not supported.
35 #endif
36 }
37 
38 }  // namespace nacl
39