dsh-remote 0.8.91 → 0.8.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +369 -368
  3. package/README.md +354 -353
  4. package/cordis.patch.yml +9 -9
  5. package/lib/audit.js +45 -45
  6. package/lib/binding.js +172 -172
  7. package/lib/client.js +4647 -4550
  8. package/lib/credential.js +270 -263
  9. package/lib/errors.js +141 -141
  10. package/lib/exec-job.js +242 -242
  11. package/lib/file-reference.js +457 -457
  12. package/lib/forwards.js +258 -258
  13. package/lib/host-api.js +822 -822
  14. package/lib/hostkey.js +108 -108
  15. package/lib/http-transport.js +201 -201
  16. package/lib/ignore.js +202 -202
  17. package/lib/index.js +4488 -4394
  18. package/lib/instructions-dynamic.js +415 -415
  19. package/lib/instructions.js +288 -288
  20. package/lib/open-folder.js +56 -56
  21. package/lib/openssh.js +940 -881
  22. package/lib/paths.js +292 -292
  23. package/lib/pool.js +1029 -970
  24. package/lib/posix-shell.cjs +34 -0
  25. package/lib/registry.js +296 -296
  26. package/lib/remote-fs.js +173 -173
  27. package/lib/remote-sandbox.js +183 -183
  28. package/lib/remote-shell-child.cjs +397 -400
  29. package/lib/remote-shell.js +697 -697
  30. package/lib/remote-skills.js +312 -0
  31. package/lib/routes-audit.js +58 -58
  32. package/lib/routes-forwards.js +72 -72
  33. package/lib/routes-fs.js +251 -245
  34. package/lib/routes-machines.js +186 -186
  35. package/lib/routes-misc.js +187 -150
  36. package/lib/routes-term.js +169 -169
  37. package/lib/routes-update.js +143 -143
  38. package/lib/routes-web-attach.js +112 -112
  39. package/lib/routes-workspace.js +312 -312
  40. package/lib/search.js +235 -235
  41. package/lib/sftp-surface.js +119 -119
  42. package/lib/sshconfig.js +779 -779
  43. package/lib/sync.js +350 -350
  44. package/lib/tasks.js +95 -95
  45. package/lib/telemetry.js +247 -247
  46. package/lib/terminal.js +205 -205
  47. package/lib/tui/flow.js +130 -130
  48. package/lib/tui/format.js +380 -380
  49. package/lib/tui/i18n.js +350 -350
  50. package/lib/tui/index.js +531 -531
  51. package/lib/tui/provider.js +344 -344
  52. package/lib/tui/scene.js +986 -986
  53. package/lib/update.js +490 -472
  54. package/lib/web-attach.js +860 -850
  55. package/lib/workspace-cleanup.js +337 -337
  56. package/package.json +103 -100
  57. package/node_modules/buildcheck/.eslintrc.js +0 -5
  58. package/node_modules/buildcheck/.github/workflows/ci.yml +0 -88
  59. package/node_modules/buildcheck/.github/workflows/lint.yml +0 -27
  60. package/node_modules/buildcheck/.npmignore +0 -3
  61. package/node_modules/buildcheck/LICENSE +0 -19
  62. package/node_modules/buildcheck/README.md +0 -106
  63. package/node_modules/buildcheck/deps/Find-VisualStudio.cs +0 -250
  64. package/node_modules/buildcheck/lib/findvs.js +0 -361
  65. package/node_modules/buildcheck/lib/index.js +0 -738
  66. package/node_modules/buildcheck/package.json +0 -36
  67. package/node_modules/buildcheck/test/test.js +0 -8
  68. package/node_modules/cpu-features/.eslintrc.js +0 -5
  69. package/node_modules/cpu-features/.github/workflows/ci.yml +0 -74
  70. package/node_modules/cpu-features/.github/workflows/lint.yml +0 -27
  71. package/node_modules/cpu-features/LICENSE +0 -19
  72. package/node_modules/cpu-features/README.md +0 -59
  73. package/node_modules/cpu-features/binding.gyp +0 -16
  74. package/node_modules/cpu-features/buildcheck.js +0 -32
  75. package/node_modules/cpu-features/deps/cpu_features/.clang-format +0 -4
  76. package/node_modules/cpu-features/deps/cpu_features/.dockerignore +0 -31
  77. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +0 -5
  78. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +0 -30
  79. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +0 -22
  80. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +0 -26
  81. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +0 -31
  82. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +0 -43
  83. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +0 -25
  84. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +0 -31
  85. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +0 -24
  86. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +0 -30
  87. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +0 -29
  88. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +0 -28
  89. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +0 -27
  90. package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +0 -21
  91. package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +0 -329
  92. package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +0 -261
  93. package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +0 -23
  94. package/node_modules/cpu-features/deps/cpu_features/LICENSE +0 -230
  95. package/node_modules/cpu-features/deps/cpu_features/README.md +0 -272
  96. package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +0 -19
  97. package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +0 -5
  98. package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +0 -11
  99. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +0 -3
  100. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +0 -3
  101. package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +0 -30
  102. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +0 -252
  103. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +0 -40
  104. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +0 -64
  105. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +0 -312
  106. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +0 -7
  107. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +0 -48
  108. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +0 -34
  109. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +0 -22
  110. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +0 -11
  111. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +0 -107
  112. package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +0 -15
  113. package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +0 -105
  114. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +0 -54
  115. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +0 -384
  116. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +0 -259
  117. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +0 -121
  118. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +0 -74
  119. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +0 -149
  120. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +0 -72
  121. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +0 -108
  122. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +0 -288
  123. package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +0 -40
  124. package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +0 -37
  125. package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +0 -39
  126. package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +0 -240
  127. package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +0 -49
  128. package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +0 -110
  129. package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +0 -70
  130. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +0 -60
  131. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +0 -4
  132. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +0 -205
  133. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +0 -320
  134. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +0 -12
  135. package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +0 -456
  136. package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +0 -165
  137. package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +0 -75
  138. package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +0 -490
  139. package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +0 -79
  140. package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +0 -19
  141. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +0 -86
  142. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +0 -26
  143. package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +0 -22
  144. package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +0 -62
  145. package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +0 -169
  146. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +0 -88
  147. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +0 -79
  148. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +0 -82
  149. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +0 -138
  150. package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +0 -212
  151. package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +0 -93
  152. package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +0 -163
  153. package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +0 -111
  154. package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +0 -120
  155. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +0 -2055
  156. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +0 -68
  157. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +0 -58
  158. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +0 -57
  159. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +0 -58
  160. package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +0 -132
  161. package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +0 -192
  162. package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +0 -461
  163. package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +0 -114
  164. package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +0 -53
  165. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +0 -396
  166. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +0 -384
  167. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +0 -176
  168. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +0 -131
  169. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +0 -180
  170. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +0 -82
  171. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +0 -1729
  172. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +0 -103
  173. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +0 -61
  174. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +0 -52
  175. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +0 -31
  176. package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +0 -132
  177. package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +0 -202
  178. package/node_modules/cpu-features/lib/index.js +0 -5
  179. package/node_modules/cpu-features/package.json +0 -40
  180. package/node_modules/cpu-features/src/binding.cc +0 -151
  181. package/node_modules/cpu-features/test/test.js +0 -12
@@ -1,138 +0,0 @@
1
- // Copyright 2023 Google LLC
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- #include "cpu_features_macros.h"
16
-
17
- #ifdef CPU_FEATURES_ARCH_AARCH64
18
- #ifdef CPU_FEATURES_OS_WINDOWS
19
-
20
- #include "cpuinfo_aarch64.h"
21
-
22
- ////////////////////////////////////////////////////////////////////////////////
23
- // Definitions for introspection.
24
- ////////////////////////////////////////////////////////////////////////////////
25
- #define INTROSPECTION_TABLE \
26
- LINE(AARCH64_FP, fp, , , ) \
27
- LINE(AARCH64_ASIMD, asimd, , , ) \
28
- LINE(AARCH64_EVTSTRM, evtstrm, , , ) \
29
- LINE(AARCH64_AES, aes, , , ) \
30
- LINE(AARCH64_PMULL, pmull, , , ) \
31
- LINE(AARCH64_SHA1, sha1, , , ) \
32
- LINE(AARCH64_SHA2, sha2, , , ) \
33
- LINE(AARCH64_CRC32, crc32, , , ) \
34
- LINE(AARCH64_ATOMICS, atomics, , , ) \
35
- LINE(AARCH64_FPHP, fphp, , , ) \
36
- LINE(AARCH64_ASIMDHP, asimdhp, , , ) \
37
- LINE(AARCH64_CPUID, cpuid, , , ) \
38
- LINE(AARCH64_ASIMDRDM, asimdrdm, , , ) \
39
- LINE(AARCH64_JSCVT, jscvt, , , ) \
40
- LINE(AARCH64_FCMA, fcma, , , ) \
41
- LINE(AARCH64_LRCPC, lrcpc, , , ) \
42
- LINE(AARCH64_DCPOP, dcpop, , , ) \
43
- LINE(AARCH64_SHA3, sha3, , , ) \
44
- LINE(AARCH64_SM3, sm3, , , ) \
45
- LINE(AARCH64_SM4, sm4, , , ) \
46
- LINE(AARCH64_ASIMDDP, asimddp, , , ) \
47
- LINE(AARCH64_SHA512, sha512, , , ) \
48
- LINE(AARCH64_SVE, sve, , , ) \
49
- LINE(AARCH64_ASIMDFHM, asimdfhm, , , ) \
50
- LINE(AARCH64_DIT, dit, , , ) \
51
- LINE(AARCH64_USCAT, uscat, , , ) \
52
- LINE(AARCH64_ILRCPC, ilrcpc, , , ) \
53
- LINE(AARCH64_FLAGM, flagm, , , ) \
54
- LINE(AARCH64_SSBS, ssbs, , , ) \
55
- LINE(AARCH64_SB, sb, , , ) \
56
- LINE(AARCH64_PACA, paca, , , ) \
57
- LINE(AARCH64_PACG, pacg, , , ) \
58
- LINE(AARCH64_DCPODP, dcpodp, , , ) \
59
- LINE(AARCH64_SVE2, sve2, , , ) \
60
- LINE(AARCH64_SVEAES, sveaes, , , ) \
61
- LINE(AARCH64_SVEPMULL, svepmull, , , ) \
62
- LINE(AARCH64_SVEBITPERM, svebitperm, , , ) \
63
- LINE(AARCH64_SVESHA3, svesha3, , , ) \
64
- LINE(AARCH64_SVESM4, svesm4, , , ) \
65
- LINE(AARCH64_FLAGM2, flagm2, , , ) \
66
- LINE(AARCH64_FRINT, frint, , , ) \
67
- LINE(AARCH64_SVEI8MM, svei8mm, , , ) \
68
- LINE(AARCH64_SVEF32MM, svef32mm, , , ) \
69
- LINE(AARCH64_SVEF64MM, svef64mm, , , ) \
70
- LINE(AARCH64_SVEBF16, svebf16, , , ) \
71
- LINE(AARCH64_I8MM, i8mm, , , ) \
72
- LINE(AARCH64_BF16, bf16, , , ) \
73
- LINE(AARCH64_DGH, dgh, , , ) \
74
- LINE(AARCH64_RNG, rng, , , ) \
75
- LINE(AARCH64_BTI, bti, , , ) \
76
- LINE(AARCH64_MTE, mte, , , ) \
77
- LINE(AARCH64_ECV, ecv, , , ) \
78
- LINE(AARCH64_AFP, afp, , , ) \
79
- LINE(AARCH64_RPRES, rpres, , , )
80
- #define INTROSPECTION_PREFIX Aarch64
81
- #define INTROSPECTION_ENUM_PREFIX AARCH64
82
- #include "define_introspection.inl"
83
-
84
- ////////////////////////////////////////////////////////////////////////////////
85
- // Implementation.
86
- ////////////////////////////////////////////////////////////////////////////////
87
-
88
- #include <stdbool.h>
89
-
90
- #include "internal/windows_utils.h"
91
-
92
- #ifdef CPU_FEATURES_MOCK_CPUID_AARCH64
93
- extern bool GetWindowsIsProcessorFeaturePresent(DWORD);
94
- extern WORD GetWindowsNativeSystemInfoProcessorRevision();
95
- #else // CPU_FEATURES_MOCK_CPUID_AARCH64
96
- static bool GetWindowsIsProcessorFeaturePresent(DWORD dwProcessorFeature) {
97
- return IsProcessorFeaturePresent(dwProcessorFeature);
98
- }
99
-
100
- static WORD GetWindowsNativeSystemInfoProcessorRevision() {
101
- SYSTEM_INFO system_info;
102
- GetNativeSystemInfo(&system_info);
103
- return system_info.wProcessorRevision;
104
- }
105
- #endif
106
-
107
- static const Aarch64Info kEmptyAarch64Info;
108
-
109
- Aarch64Info GetAarch64Info(void) {
110
- Aarch64Info info = kEmptyAarch64Info;
111
- info.revision = GetWindowsNativeSystemInfoProcessorRevision();
112
- info.features.fp =
113
- GetWindowsIsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE);
114
- info.features.asimd =
115
- GetWindowsIsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE);
116
- info.features.crc32 = GetWindowsIsProcessorFeaturePresent(
117
- PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
118
- info.features.asimddp =
119
- GetWindowsIsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE);
120
- info.features.jscvt = GetWindowsIsProcessorFeaturePresent(
121
- PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE);
122
- info.features.lrcpc = GetWindowsIsProcessorFeaturePresent(
123
- PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE);
124
- info.features.atomics = GetWindowsIsProcessorFeaturePresent(
125
- PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE);
126
-
127
-
128
- bool is_crypto_available = GetWindowsIsProcessorFeaturePresent(
129
- PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
130
- info.features.aes = is_crypto_available;
131
- info.features.sha1 = is_crypto_available;
132
- info.features.sha2 = is_crypto_available;
133
- info.features.pmull = is_crypto_available;
134
- return info;
135
- }
136
-
137
- #endif // CPU_FEATURES_OS_WINDOWS
138
- #endif // CPU_FEATURES_ARCH_AARCH64
@@ -1,212 +0,0 @@
1
- // Copyright 2017 Google LLC
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- #include "cpu_features_macros.h"
16
-
17
- #ifdef CPU_FEATURES_ARCH_ARM
18
- #if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID)
19
-
20
- #include "cpuinfo_arm.h"
21
-
22
- ////////////////////////////////////////////////////////////////////////////////
23
- // Definitions for introspection.
24
- ////////////////////////////////////////////////////////////////////////////////
25
- #define INTROSPECTION_TABLE \
26
- LINE(ARM_SWP, swp, "swp", ARM_HWCAP_SWP, 0) \
27
- LINE(ARM_HALF, half, "half", ARM_HWCAP_HALF, 0) \
28
- LINE(ARM_THUMB, thumb, "thumb", ARM_HWCAP_THUMB, 0) \
29
- LINE(ARM_26BIT, _26bit, "26bit", ARM_HWCAP_26BIT, 0) \
30
- LINE(ARM_FASTMULT, fastmult, "fastmult", ARM_HWCAP_FAST_MULT, 0) \
31
- LINE(ARM_FPA, fpa, "fpa", ARM_HWCAP_FPA, 0) \
32
- LINE(ARM_VFP, vfp, "vfp", ARM_HWCAP_VFP, 0) \
33
- LINE(ARM_EDSP, edsp, "edsp", ARM_HWCAP_EDSP, 0) \
34
- LINE(ARM_JAVA, java, "java", ARM_HWCAP_JAVA, 0) \
35
- LINE(ARM_IWMMXT, iwmmxt, "iwmmxt", ARM_HWCAP_IWMMXT, 0) \
36
- LINE(ARM_CRUNCH, crunch, "crunch", ARM_HWCAP_CRUNCH, 0) \
37
- LINE(ARM_THUMBEE, thumbee, "thumbee", ARM_HWCAP_THUMBEE, 0) \
38
- LINE(ARM_NEON, neon, "neon", ARM_HWCAP_NEON, 0) \
39
- LINE(ARM_VFPV3, vfpv3, "vfpv3", ARM_HWCAP_VFPV3, 0) \
40
- LINE(ARM_VFPV3D16, vfpv3d16, "vfpv3d16", ARM_HWCAP_VFPV3D16, 0) \
41
- LINE(ARM_TLS, tls, "tls", ARM_HWCAP_TLS, 0) \
42
- LINE(ARM_VFPV4, vfpv4, "vfpv4", ARM_HWCAP_VFPV4, 0) \
43
- LINE(ARM_IDIVA, idiva, "idiva", ARM_HWCAP_IDIVA, 0) \
44
- LINE(ARM_IDIVT, idivt, "idivt", ARM_HWCAP_IDIVT, 0) \
45
- LINE(ARM_VFPD32, vfpd32, "vfpd32", ARM_HWCAP_VFPD32, 0) \
46
- LINE(ARM_LPAE, lpae, "lpae", ARM_HWCAP_LPAE, 0) \
47
- LINE(ARM_EVTSTRM, evtstrm, "evtstrm", ARM_HWCAP_EVTSTRM, 0) \
48
- LINE(ARM_AES, aes, "aes", 0, ARM_HWCAP2_AES) \
49
- LINE(ARM_PMULL, pmull, "pmull", 0, ARM_HWCAP2_PMULL) \
50
- LINE(ARM_SHA1, sha1, "sha1", 0, ARM_HWCAP2_SHA1) \
51
- LINE(ARM_SHA2, sha2, "sha2", 0, ARM_HWCAP2_SHA2) \
52
- LINE(ARM_CRC32, crc32, "crc32", 0, ARM_HWCAP2_CRC32)
53
- #define INTROSPECTION_PREFIX Arm
54
- #define INTROSPECTION_ENUM_PREFIX ARM
55
- #include "define_introspection_and_hwcaps.inl"
56
-
57
- ////////////////////////////////////////////////////////////////////////////////
58
- // Implementation.
59
- ////////////////////////////////////////////////////////////////////////////////
60
-
61
- #include <ctype.h>
62
- #include <stdbool.h>
63
-
64
- #include "internal/bit_utils.h"
65
- #include "internal/filesystem.h"
66
- #include "internal/stack_line_reader.h"
67
- #include "internal/string_view.h"
68
-
69
- typedef struct {
70
- bool processor_reports_armv6;
71
- bool hardware_reports_goldfish;
72
- } ProcCpuInfoData;
73
-
74
- static int IndexOfNonDigit(StringView str) {
75
- size_t index = 0;
76
- while (str.size && isdigit(CpuFeatures_StringView_Front(str))) {
77
- str = CpuFeatures_StringView_PopFront(str, 1);
78
- ++index;
79
- }
80
- return index;
81
- }
82
-
83
- static bool HandleArmLine(const LineResult result, ArmInfo* const info,
84
- ProcCpuInfoData* const proc_info) {
85
- StringView line = result.line;
86
- StringView key, value;
87
- if (CpuFeatures_StringView_GetAttributeKeyValue(line, &key, &value)) {
88
- if (CpuFeatures_StringView_IsEquals(key, str("Features"))) {
89
- for (size_t i = 0; i < ARM_LAST_; ++i) {
90
- kSetters[i](&info->features, CpuFeatures_StringView_HasWord(
91
- value, kCpuInfoFlags[i], ' '));
92
- }
93
- } else if (CpuFeatures_StringView_IsEquals(key, str("CPU implementer"))) {
94
- info->implementer = CpuFeatures_StringView_ParsePositiveNumber(value);
95
- } else if (CpuFeatures_StringView_IsEquals(key, str("CPU variant"))) {
96
- info->variant = CpuFeatures_StringView_ParsePositiveNumber(value);
97
- } else if (CpuFeatures_StringView_IsEquals(key, str("CPU part"))) {
98
- info->part = CpuFeatures_StringView_ParsePositiveNumber(value);
99
- } else if (CpuFeatures_StringView_IsEquals(key, str("CPU revision"))) {
100
- info->revision = CpuFeatures_StringView_ParsePositiveNumber(value);
101
- } else if (CpuFeatures_StringView_IsEquals(key, str("CPU architecture"))) {
102
- // CPU architecture is a number that may be followed by letters. e.g.
103
- // "6TEJ", "7".
104
- const StringView digits =
105
- CpuFeatures_StringView_KeepFront(value, IndexOfNonDigit(value));
106
- info->architecture = CpuFeatures_StringView_ParsePositiveNumber(digits);
107
- } else if (CpuFeatures_StringView_IsEquals(key, str("Processor")) ||
108
- CpuFeatures_StringView_IsEquals(key, str("model name"))) {
109
- // Android reports this in a non-Linux standard "Processor" but sometimes
110
- // also in "model name", Linux reports it only in "model name"
111
- // see RaspberryPiZero (Linux) vs InvalidArmv7 (Android) test-cases
112
- proc_info->processor_reports_armv6 =
113
- CpuFeatures_StringView_IndexOf(value, str("(v6l)")) >= 0;
114
- } else if (CpuFeatures_StringView_IsEquals(key, str("Hardware"))) {
115
- proc_info->hardware_reports_goldfish =
116
- CpuFeatures_StringView_IsEquals(value, str("Goldfish"));
117
- }
118
- }
119
- return !result.eof;
120
- }
121
-
122
- uint32_t GetArmCpuId(const ArmInfo* const info) {
123
- return (ExtractBitRange(info->implementer, 7, 0) << 24) |
124
- (ExtractBitRange(info->variant, 3, 0) << 20) |
125
- (ExtractBitRange(info->part, 11, 0) << 4) |
126
- (ExtractBitRange(info->revision, 3, 0) << 0);
127
- }
128
-
129
- static void FixErrors(ArmInfo* const info,
130
- ProcCpuInfoData* const proc_cpu_info_data) {
131
- // Fixing Samsung kernel reporting invalid cpu architecture.
132
- // http://code.google.com/p/android/issues/detail?id=10812
133
- if (proc_cpu_info_data->processor_reports_armv6 && info->architecture >= 7) {
134
- info->architecture = 6;
135
- }
136
-
137
- // Handle kernel configuration bugs that prevent the correct reporting of CPU
138
- // features.
139
- switch (GetArmCpuId(info)) {
140
- case 0x4100C080:
141
- // Special case: The emulator-specific Android 4.2 kernel fails to report
142
- // support for the 32-bit ARM IDIV instruction. Technically, this is a
143
- // feature of the virtual CPU implemented by the emulator. Note that it
144
- // could also support Thumb IDIV in the future, and this will have to be
145
- // slightly updated.
146
- if (info->architecture >= 7 &&
147
- proc_cpu_info_data->hardware_reports_goldfish) {
148
- info->features.idiva = true;
149
- }
150
- break;
151
- case 0x511004D0:
152
- // https://crbug.com/341598.
153
- info->features.neon = false;
154
- break;
155
- }
156
-
157
- // Some Qualcomm Krait kernels forget to report IDIV support.
158
- // https://github.com/torvalds/linux/commit/120ecfafabec382c4feb79ff159ef42a39b6d33b
159
- if (info->implementer == 0x51 && info->architecture == 7 &&
160
- (info->part == 0x4d || info->part == 0x6f)) {
161
- info->features.idiva = true;
162
- info->features.idivt = true;
163
- }
164
-
165
- // Propagate cpu features.
166
- if (info->features.vfpv4) info->features.vfpv3 = true;
167
- if (info->features.neon) info->features.vfpv3 = true;
168
- if (info->features.vfpv3) info->features.vfp = true;
169
- }
170
-
171
- static void FillProcCpuInfoData(ArmInfo* const info,
172
- ProcCpuInfoData* proc_cpu_info_data) {
173
- const int fd = CpuFeatures_OpenFile("/proc/cpuinfo");
174
- if (fd >= 0) {
175
- StackLineReader reader;
176
- StackLineReader_Initialize(&reader, fd);
177
- for (;;) {
178
- if (!HandleArmLine(StackLineReader_NextLine(&reader), info,
179
- proc_cpu_info_data)) {
180
- break;
181
- }
182
- }
183
- CpuFeatures_CloseFile(fd);
184
- }
185
- }
186
-
187
- static const ArmInfo kEmptyArmInfo;
188
-
189
- static const ProcCpuInfoData kEmptyProcCpuInfoData;
190
-
191
- ArmInfo GetArmInfo(void) {
192
- // capabilities are fetched from both getauxval and /proc/cpuinfo so we can
193
- // have some information if the executable is sandboxed (aka no access to
194
- // /proc/cpuinfo).
195
- ArmInfo info = kEmptyArmInfo;
196
- ProcCpuInfoData proc_cpu_info_data = kEmptyProcCpuInfoData;
197
-
198
- FillProcCpuInfoData(&info, &proc_cpu_info_data);
199
- const HardwareCapabilities hwcaps = CpuFeatures_GetHardwareCapabilities();
200
- for (size_t i = 0; i < ARM_LAST_; ++i) {
201
- if (CpuFeatures_IsHwCapsSet(kHardwareCapabilities[i], hwcaps)) {
202
- kSetters[i](&info.features, true);
203
- }
204
- }
205
-
206
- FixErrors(&info, &proc_cpu_info_data);
207
-
208
- return info;
209
- }
210
-
211
- #endif // defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID)
212
- #endif // CPU_FEATURES_ARCH_ARM
@@ -1,93 +0,0 @@
1
- // Licensed under the Apache License, Version 2.0 (the "License");
2
- // you may not use this file except in compliance with the License.
3
- // You may obtain a copy of the License at
4
- //
5
- // http://www.apache.org/licenses/LICENSE-2.0
6
- //
7
- // Unless required by applicable law or agreed to in writing, software
8
- // distributed under the License is distributed on an "AS IS" BASIS,
9
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- // See the License for the specific language governing permissions and
11
- // limitations under the License.
12
-
13
- #include "cpu_features_macros.h"
14
-
15
- #ifdef CPU_FEATURES_ARCH_MIPS
16
- #if defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID)
17
-
18
- #include "cpuinfo_mips.h"
19
-
20
- ////////////////////////////////////////////////////////////////////////////////
21
- // Definitions for introspection.
22
- ////////////////////////////////////////////////////////////////////////////////
23
- #define INTROSPECTION_TABLE \
24
- LINE(MIPS_MSA, msa, "msa", MIPS_HWCAP_MSA, 0) \
25
- LINE(MIPS_EVA, eva, "eva", 0, 0) \
26
- LINE(MIPS_R6, r6, "r6", MIPS_HWCAP_R6, 0) \
27
- LINE(MIPS_MIPS16, mips16, "mips16", MIPS_HWCAP_MIPS16, 0) \
28
- LINE(MIPS_MDMX, mdmx, "mdmx", MIPS_HWCAP_MDMX, 0) \
29
- LINE(MIPS_MIPS3D, mips3d, "mips3d", MIPS_HWCAP_MIPS3D, 0) \
30
- LINE(MIPS_SMART, smart, "smartmips", MIPS_HWCAP_SMARTMIPS, 0) \
31
- LINE(MIPS_DSP, dsp, "dsp", MIPS_HWCAP_DSP, 0)
32
- #define INTROSPECTION_PREFIX Mips
33
- #define INTROSPECTION_ENUM_PREFIX MIPS
34
- #include "define_introspection_and_hwcaps.inl"
35
-
36
- ////////////////////////////////////////////////////////////////////////////////
37
- // Implementation.
38
- ////////////////////////////////////////////////////////////////////////////////
39
-
40
- #include "internal/filesystem.h"
41
- #include "internal/hwcaps.h"
42
- #include "internal/stack_line_reader.h"
43
- #include "internal/string_view.h"
44
-
45
- static bool HandleMipsLine(const LineResult result,
46
- MipsFeatures* const features) {
47
- StringView key, value;
48
- // See tests for an example.
49
- if (CpuFeatures_StringView_GetAttributeKeyValue(result.line, &key, &value)) {
50
- if (CpuFeatures_StringView_IsEquals(key, str("ASEs implemented"))) {
51
- for (size_t i = 0; i < MIPS_LAST_; ++i) {
52
- kSetters[i](features, CpuFeatures_StringView_HasWord(
53
- value, kCpuInfoFlags[i], ' '));
54
- }
55
- }
56
- }
57
- return !result.eof;
58
- }
59
-
60
- static void FillProcCpuInfoData(MipsFeatures* const features) {
61
- const int fd = CpuFeatures_OpenFile("/proc/cpuinfo");
62
- if (fd >= 0) {
63
- StackLineReader reader;
64
- StackLineReader_Initialize(&reader, fd);
65
- for (;;) {
66
- if (!HandleMipsLine(StackLineReader_NextLine(&reader), features)) {
67
- break;
68
- }
69
- }
70
- CpuFeatures_CloseFile(fd);
71
- }
72
- }
73
-
74
- static const MipsInfo kEmptyMipsInfo;
75
-
76
- MipsInfo GetMipsInfo(void) {
77
- // capabilities are fetched from both getauxval and /proc/cpuinfo so we can
78
- // have some information if the executable is sandboxed (aka no access to
79
- // /proc/cpuinfo).
80
- MipsInfo info = kEmptyMipsInfo;
81
-
82
- FillProcCpuInfoData(&info.features);
83
- const HardwareCapabilities hwcaps = CpuFeatures_GetHardwareCapabilities();
84
- for (size_t i = 0; i < MIPS_LAST_; ++i) {
85
- if (CpuFeatures_IsHwCapsSet(kHardwareCapabilities[i], hwcaps)) {
86
- kSetters[i](&info.features, true);
87
- }
88
- }
89
- return info;
90
- }
91
-
92
- #endif // defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID)
93
- #endif // CPU_FEATURES_ARCH_MIPS
@@ -1,163 +0,0 @@
1
- // Copyright 2018 IBM.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- #include "cpu_features_macros.h"
16
-
17
- #ifdef CPU_FEATURES_ARCH_PPC
18
- #ifdef CPU_FEATURES_OS_LINUX
19
-
20
- #include "cpuinfo_ppc.h"
21
-
22
- ////////////////////////////////////////////////////////////////////////////////
23
- // Definitions for introspection.
24
- ////////////////////////////////////////////////////////////////////////////////
25
- #define INTROSPECTION_TABLE \
26
- LINE(PPC_32, ppc32, "ppc32", PPC_FEATURE_32, 0) \
27
- LINE(PPC_64, ppc64, "ppc64", PPC_FEATURE_64, 0) \
28
- LINE(PPC_601_INSTR, ppc601, "ppc601", PPC_FEATURE_601_INSTR, 0) \
29
- LINE(PPC_HAS_ALTIVEC, altivec, "altivec", PPC_FEATURE_HAS_ALTIVEC, 0) \
30
- LINE(PPC_HAS_FPU, fpu, "fpu", PPC_FEATURE_HAS_FPU, 0) \
31
- LINE(PPC_HAS_MMU, mmu, "mmu", PPC_FEATURE_HAS_MMU, 0) \
32
- LINE(PPC_HAS_4xxMAC, mac_4xx, "4xxmac", PPC_FEATURE_HAS_4xxMAC, 0) \
33
- LINE(PPC_UNIFIED_CACHE, unifiedcache, "ucache", PPC_FEATURE_UNIFIED_CACHE, \
34
- 0) \
35
- LINE(PPC_HAS_SPE, spe, "spe", PPC_FEATURE_HAS_SPE, 0) \
36
- LINE(PPC_HAS_EFP_SINGLE, efpsingle, "efpsingle", PPC_FEATURE_HAS_EFP_SINGLE, \
37
- 0) \
38
- LINE(PPC_HAS_EFP_DOUBLE, efpdouble, "efpdouble", PPC_FEATURE_HAS_EFP_DOUBLE, \
39
- 0) \
40
- LINE(PPC_NO_TB, no_tb, "notb", PPC_FEATURE_NO_TB, 0) \
41
- LINE(PPC_POWER4, power4, "power4", PPC_FEATURE_POWER4, 0) \
42
- LINE(PPC_POWER5, power5, "power5", PPC_FEATURE_POWER5, 0) \
43
- LINE(PPC_POWER5_PLUS, power5plus, "power5+", PPC_FEATURE_POWER5_PLUS, 0) \
44
- LINE(PPC_CELL, cell, "cellbe", PPC_FEATURE_CELL, 0) \
45
- LINE(PPC_BOOKE, booke, "booke", PPC_FEATURE_BOOKE, 0) \
46
- LINE(PPC_SMT, smt, "smt", PPC_FEATURE_SMT, 0) \
47
- LINE(PPC_ICACHE_SNOOP, icachesnoop, "ic_snoop", PPC_FEATURE_ICACHE_SNOOP, 0) \
48
- LINE(PPC_ARCH_2_05, arch205, "arch_2_05", PPC_FEATURE_ARCH_2_05, 0) \
49
- LINE(PPC_PA6T, pa6t, "pa6t", PPC_FEATURE_PA6T, 0) \
50
- LINE(PPC_HAS_DFP, dfp, "dfp", PPC_FEATURE_HAS_DFP, 0) \
51
- LINE(PPC_POWER6_EXT, power6ext, "power6x", PPC_FEATURE_POWER6_EXT, 0) \
52
- LINE(PPC_ARCH_2_06, arch206, "arch_2_06", PPC_FEATURE_ARCH_2_06, 0) \
53
- LINE(PPC_HAS_VSX, vsx, "vsx", PPC_FEATURE_HAS_VSX, 0) \
54
- LINE(PPC_PSERIES_PERFMON_COMPAT, pseries_perfmon_compat, "archpmu", \
55
- PPC_FEATURE_PSERIES_PERFMON_COMPAT, 0) \
56
- LINE(PPC_TRUE_LE, truele, "true_le", PPC_FEATURE_TRUE_LE, 0) \
57
- LINE(PPC_PPC_LE, ppcle, "ppcle", PPC_FEATURE_PPC_LE, 0) \
58
- LINE(PPC_ARCH_2_07, arch207, "arch_2_07", 0, PPC_FEATURE2_ARCH_2_07) \
59
- LINE(PPC_HTM, htm, "htm", 0, PPC_FEATURE2_HTM) \
60
- LINE(PPC_DSCR, dscr, "dscr", 0, PPC_FEATURE2_DSCR) \
61
- LINE(PPC_EBB, ebb, "ebb", 0, PPC_FEATURE2_EBB) \
62
- LINE(PPC_ISEL, isel, "isel", 0, PPC_FEATURE2_ISEL) \
63
- LINE(PPC_TAR, tar, "tar", 0, PPC_FEATURE2_TAR) \
64
- LINE(PPC_VEC_CRYPTO, vcrypto, "vcrypto", 0, PPC_FEATURE2_VEC_CRYPTO) \
65
- LINE(PPC_HTM_NOSC, htm_nosc, "htm-nosc", 0, PPC_FEATURE2_HTM_NOSC) \
66
- LINE(PPC_ARCH_3_00, arch300, "arch_3_00", 0, PPC_FEATURE2_ARCH_3_00) \
67
- LINE(PPC_HAS_IEEE128, ieee128, "ieee128", 0, PPC_FEATURE2_HAS_IEEE128) \
68
- LINE(PPC_DARN, darn, "darn", 0, PPC_FEATURE2_DARN) \
69
- LINE(PPC_SCV, scv, "scv", 0, PPC_FEATURE2_SCV) \
70
- LINE(PPC_HTM_NO_SUSPEND, htm_no_suspend, "htm-no-suspend", 0, \
71
- PPC_FEATURE2_HTM_NO_SUSPEND)
72
- #undef PPC // Remove conflict with compiler generated preprocessor
73
- #define INTROSPECTION_PREFIX PPC
74
- #define INTROSPECTION_ENUM_PREFIX PPC
75
- #include "define_introspection_and_hwcaps.inl"
76
-
77
- ////////////////////////////////////////////////////////////////////////////////
78
- // Implementation.
79
- ////////////////////////////////////////////////////////////////////////////////
80
-
81
- #include <stdbool.h>
82
-
83
- #include "internal/bit_utils.h"
84
- #include "internal/filesystem.h"
85
- #include "internal/hwcaps.h"
86
- #include "internal/stack_line_reader.h"
87
- #include "internal/string_view.h"
88
-
89
- static bool HandlePPCLine(const LineResult result,
90
- PPCPlatformStrings* const strings) {
91
- StringView line = result.line;
92
- StringView key, value;
93
- if (CpuFeatures_StringView_GetAttributeKeyValue(line, &key, &value)) {
94
- if (CpuFeatures_StringView_HasWord(key, "platform", ' ')) {
95
- CpuFeatures_StringView_CopyString(value, strings->platform,
96
- sizeof(strings->platform));
97
- } else if (CpuFeatures_StringView_IsEquals(key, str("model"))) {
98
- CpuFeatures_StringView_CopyString(value, strings->model,
99
- sizeof(strings->platform));
100
- } else if (CpuFeatures_StringView_IsEquals(key, str("machine"))) {
101
- CpuFeatures_StringView_CopyString(value, strings->machine,
102
- sizeof(strings->platform));
103
- } else if (CpuFeatures_StringView_IsEquals(key, str("cpu"))) {
104
- CpuFeatures_StringView_CopyString(value, strings->cpu,
105
- sizeof(strings->platform));
106
- }
107
- }
108
- return !result.eof;
109
- }
110
-
111
- static void FillProcCpuInfoData(PPCPlatformStrings* const strings) {
112
- const int fd = CpuFeatures_OpenFile("/proc/cpuinfo");
113
- if (fd >= 0) {
114
- StackLineReader reader;
115
- StackLineReader_Initialize(&reader, fd);
116
- for (;;) {
117
- if (!HandlePPCLine(StackLineReader_NextLine(&reader), strings)) {
118
- break;
119
- }
120
- }
121
- CpuFeatures_CloseFile(fd);
122
- }
123
- }
124
-
125
- static const PPCInfo kEmptyPPCInfo;
126
-
127
- PPCInfo GetPPCInfo(void) {
128
- /*
129
- * On Power feature flags aren't currently in cpuinfo so we only look at
130
- * the auxilary vector.
131
- */
132
- PPCInfo info = kEmptyPPCInfo;
133
- const HardwareCapabilities hwcaps = CpuFeatures_GetHardwareCapabilities();
134
- for (size_t i = 0; i < PPC_LAST_; ++i) {
135
- if (CpuFeatures_IsHwCapsSet(kHardwareCapabilities[i], hwcaps)) {
136
- kSetters[i](&info.features, true);
137
- }
138
- }
139
- return info;
140
- }
141
-
142
- static const PPCPlatformStrings kEmptyPPCPlatformStrings;
143
-
144
- PPCPlatformStrings GetPPCPlatformStrings(void) {
145
- PPCPlatformStrings strings = kEmptyPPCPlatformStrings;
146
- const char* platform = CpuFeatures_GetPlatformPointer();
147
- const char* base_platform = CpuFeatures_GetBasePlatformPointer();
148
-
149
- FillProcCpuInfoData(&strings);
150
-
151
- if (platform != NULL)
152
- CpuFeatures_StringView_CopyString(str(platform), strings.type.platform,
153
- sizeof(strings.type.platform));
154
- if (base_platform != NULL)
155
- CpuFeatures_StringView_CopyString(str(base_platform),
156
- strings.type.base_platform,
157
- sizeof(strings.type.base_platform));
158
-
159
- return strings;
160
- }
161
-
162
- #endif // CPU_FEATURES_OS_LINUX
163
- #endif // CPU_FEATURES_ARCH_PPC