Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: src/base/cpu.cc

Issue 866843003: Contribution of PowerPC port (continuation of 422063005) - AIX Common1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/cpu.h" 5 #include "src/base/cpu.h"
6 6
7 #if V8_LIBC_MSVCRT 7 #if V8_LIBC_MSVCRT
8 #include <intrin.h> // __cpuid() 8 #include <intrin.h> // __cpuid()
9 #endif 9 #endif
10 #if V8_OS_LINUX 10 #if V8_OS_LINUX
11 #include <linux/auxvec.h> // AT_HWCAP 11 #include <linux/auxvec.h> // AT_HWCAP
12 #endif 12 #endif
13 #if V8_GLIBC_PREREQ(2, 16) 13 #if V8_GLIBC_PREREQ(2, 16)
14 #include <sys/auxv.h> // getauxval() 14 #include <sys/auxv.h> // getauxval()
15 #endif 15 #endif
16 #if V8_OS_QNX 16 #if V8_OS_QNX
17 #include <sys/syspage.h> // cpuinfo 17 #include <sys/syspage.h> // cpuinfo
18 #endif 18 #endif
19 #if V8_OS_LINUX && V8_HOST_ARCH_PPC 19 #if V8_OS_LINUX && V8_HOST_ARCH_PPC
20 #include <elf.h> 20 #include <elf.h>
21 #endif 21 #endif
22 #if V8_OS_AIX
23 #include <sys/systemcfg.h> // _system_configuration
24 #ifndef POWER_8
25 #define POWER_8 0x10000
26 #endif
27 #endif
22 #if V8_OS_POSIX 28 #if V8_OS_POSIX
23 #include <unistd.h> // sysconf() 29 #include <unistd.h> // sysconf()
24 #endif 30 #endif
25 31
26 #include <ctype.h> 32 #include <ctype.h>
27 #include <limits.h> 33 #include <limits.h>
28 #include <stdio.h> 34 #include <stdio.h>
29 #include <stdlib.h> 35 #include <stdlib.h>
30 #include <string.h> 36 #include <string.h>
31 #include <algorithm> 37 #include <algorithm>
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 part_ = PPC_POWER5; 642 part_ = PPC_POWER5;
637 } else if (strcmp(auxv_cpu_type, "ppc970") == 0) { 643 } else if (strcmp(auxv_cpu_type, "ppc970") == 0) {
638 part_ = PPC_G5; 644 part_ = PPC_G5;
639 } else if (strcmp(auxv_cpu_type, "ppc7450") == 0) { 645 } else if (strcmp(auxv_cpu_type, "ppc7450") == 0) {
640 part_ = PPC_G4; 646 part_ = PPC_G4;
641 } else if (strcmp(auxv_cpu_type, "pa6t") == 0) { 647 } else if (strcmp(auxv_cpu_type, "pa6t") == 0) {
642 part_ = PPC_PA6T; 648 part_ = PPC_PA6T;
643 } 649 }
644 } 650 }
645 651
646 #endif // V8_OS_LINUX 652 #elif V8_OS_AIX
653 switch (_system_configuration.implementation) {
654 case POWER_8:
655 part_ = PPC_POWER8;
656 break;
657 case POWER_7:
658 part_ = PPC_POWER7;
659 break;
660 case POWER_6:
661 part_ = PPC_POWER6;
662 break;
663 case POWER_5:
664 part_ = PPC_POWER5;
665 break;
666 }
667 #endif // V8_OS_AIX
647 #endif // !USE_SIMULATOR 668 #endif // !USE_SIMULATOR
648 #endif // V8_HOST_ARCH_PPC 669 #endif // V8_HOST_ARCH_PPC
649 } 670 }
650 671
651 } } // namespace v8::base 672 } } // namespace v8::base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698