dsh-remote 0.8.45 → 0.8.47
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.
- package/LICENSE +21 -21
- package/README.en.md +361 -361
- package/README.md +368 -368
- package/cordis.patch.yml +9 -9
- package/lib/binding.js +172 -172
- package/lib/client.js +3637 -3623
- package/lib/credential.js +177 -177
- package/lib/deploy-tasks.js +142 -142
- package/lib/errors.js +87 -87
- package/lib/file-reference.js +457 -457
- package/lib/forwards.js +258 -258
- package/lib/hostkey.js +108 -108
- package/lib/http-transport.js +196 -196
- package/lib/ignore.js +156 -156
- package/lib/index.js +3771 -3747
- package/lib/openssh.js +838 -838
- package/lib/paths.js +225 -225
- package/lib/pool.js +757 -754
- package/lib/registry.js +95 -95
- package/lib/remote-fs.js +148 -143
- package/lib/routes-fs.js +233 -233
- package/lib/search.js +230 -230
- package/lib/sftp-surface.js +76 -76
- package/lib/sshconfig.js +454 -454
- package/lib/sync.js +275 -275
- package/lib/tasks.js +95 -95
- package/lib/telemetry.js +213 -213
- package/lib/update.js +472 -472
- package/lib/web-attach.js +850 -846
- package/lib/web-deploy-skill.js +205 -205
- package/lib/web-deploy.js +694 -694
- package/node_modules/asn1/Jenkinsfile +65 -0
- package/node_modules/asn1/LICENSE +19 -0
- package/node_modules/asn1/README.md +50 -0
- package/node_modules/asn1/lib/ber/errors.js +13 -0
- package/node_modules/asn1/lib/ber/index.js +27 -0
- package/node_modules/asn1/lib/ber/reader.js +262 -0
- package/node_modules/asn1/lib/ber/types.js +36 -0
- package/node_modules/asn1/lib/ber/writer.js +317 -0
- package/node_modules/asn1/lib/index.js +20 -0
- package/node_modules/asn1/package.json +31 -0
- package/node_modules/bcrypt-pbkdf/CONTRIBUTING.md +13 -0
- package/node_modules/bcrypt-pbkdf/LICENSE +66 -0
- package/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/node_modules/bcrypt-pbkdf/package.json +15 -0
- package/node_modules/buildcheck/.eslintrc.js +5 -0
- package/node_modules/buildcheck/.github/workflows/ci.yml +88 -0
- package/node_modules/buildcheck/.github/workflows/lint.yml +27 -0
- package/node_modules/buildcheck/.npmignore +3 -0
- package/node_modules/buildcheck/LICENSE +19 -0
- package/node_modules/buildcheck/README.md +106 -0
- package/node_modules/buildcheck/deps/Find-VisualStudio.cs +250 -0
- package/node_modules/buildcheck/lib/findvs.js +361 -0
- package/node_modules/buildcheck/lib/index.js +738 -0
- package/node_modules/buildcheck/package.json +36 -0
- package/node_modules/buildcheck/test/test.js +8 -0
- package/node_modules/cpu-features/.eslintrc.js +5 -0
- package/node_modules/cpu-features/.github/workflows/ci.yml +74 -0
- package/node_modules/cpu-features/.github/workflows/lint.yml +27 -0
- package/node_modules/cpu-features/LICENSE +19 -0
- package/node_modules/cpu-features/README.md +59 -0
- package/node_modules/cpu-features/binding.gyp +16 -0
- package/node_modules/cpu-features/buildcheck.js +32 -0
- package/node_modules/cpu-features/deps/cpu_features/.clang-format +4 -0
- package/node_modules/cpu-features/deps/cpu_features/.dockerignore +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +5 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +22 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +26 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +43 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +25 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +24 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +29 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +28 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +27 -0
- package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +21 -0
- package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +329 -0
- package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +261 -0
- package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +23 -0
- package/node_modules/cpu-features/deps/cpu_features/LICENSE +230 -0
- package/node_modules/cpu-features/deps/cpu_features/README.md +272 -0
- package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +19 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +5 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +30 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +252 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +40 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +64 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +312 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +7 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +48 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +34 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +22 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +107 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +15 -0
- package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +105 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +54 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +384 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +259 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +121 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +74 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +149 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +72 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +108 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +288 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +40 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +37 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +39 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +240 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +49 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +110 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +70 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +60 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +4 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +205 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +320 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +12 -0
- package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +456 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +165 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +75 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +490 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +19 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +86 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +26 -0
- package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +22 -0
- package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +62 -0
- package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +169 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +88 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +82 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +138 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +212 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +93 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +163 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +111 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +120 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +2055 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +68 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +57 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +132 -0
- package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +192 -0
- package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +461 -0
- package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +114 -0
- package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +53 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +396 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +384 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +176 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +131 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +180 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +82 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +1729 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +103 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +61 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +52 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +31 -0
- package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +132 -0
- package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +202 -0
- package/node_modules/cpu-features/lib/index.js +5 -0
- package/node_modules/cpu-features/package.json +40 -0
- package/node_modules/cpu-features/src/binding.cc +151 -0
- package/node_modules/cpu-features/test/test.js +12 -0
- package/node_modules/nan/.github/workflows/ci.yml +46 -0
- package/node_modules/nan/.pre-commit-config.yaml +8 -0
- package/node_modules/nan/CHANGELOG.md +605 -0
- package/node_modules/nan/CMakeLists.txt +138 -0
- package/node_modules/nan/LICENSE.md +9 -0
- package/node_modules/nan/README.md +457 -0
- package/node_modules/nan/doc/asyncworker.md +146 -0
- package/node_modules/nan/doc/buffers.md +54 -0
- package/node_modules/nan/doc/callback.md +76 -0
- package/node_modules/nan/doc/converters.md +41 -0
- package/node_modules/nan/doc/errors.md +226 -0
- package/node_modules/nan/doc/json.md +62 -0
- package/node_modules/nan/doc/maybe_types.md +583 -0
- package/node_modules/nan/doc/methods.md +689 -0
- package/node_modules/nan/doc/new.md +147 -0
- package/node_modules/nan/doc/node_misc.md +123 -0
- package/node_modules/nan/doc/object_wrappers.md +263 -0
- package/node_modules/nan/doc/persistent.md +296 -0
- package/node_modules/nan/doc/scopes.md +73 -0
- package/node_modules/nan/doc/script.md +58 -0
- package/node_modules/nan/doc/string_bytes.md +81 -0
- package/node_modules/nan/doc/v8_internals.md +211 -0
- package/node_modules/nan/doc/v8_misc.md +85 -0
- package/node_modules/nan/include_dirs.js +1 -0
- package/node_modules/nan/nan.h +3202 -0
- package/node_modules/nan/nan_callbacks.h +141 -0
- package/node_modules/nan/nan_callbacks_12_inl.h +730 -0
- package/node_modules/nan/nan_callbacks_pre_12_inl.h +528 -0
- package/node_modules/nan/nan_converters.h +72 -0
- package/node_modules/nan/nan_converters_43_inl.h +68 -0
- package/node_modules/nan/nan_converters_pre_43_inl.h +42 -0
- package/node_modules/nan/nan_define_own_property_helper.h +29 -0
- package/node_modules/nan/nan_implementation_12_inl.h +446 -0
- package/node_modules/nan/nan_implementation_pre_12_inl.h +263 -0
- package/node_modules/nan/nan_json.h +166 -0
- package/node_modules/nan/nan_maybe_43_inl.h +360 -0
- package/node_modules/nan/nan_maybe_pre_43_inl.h +268 -0
- package/node_modules/nan/nan_new.h +340 -0
- package/node_modules/nan/nan_object_wrap.h +156 -0
- package/node_modules/nan/nan_persistent_12_inl.h +132 -0
- package/node_modules/nan/nan_persistent_pre_12_inl.h +242 -0
- package/node_modules/nan/nan_private.h +73 -0
- package/node_modules/nan/nan_scriptorigin.h +97 -0
- package/node_modules/nan/nan_string_bytes.h +305 -0
- package/node_modules/nan/nan_typedarray_contents.h +96 -0
- package/node_modules/nan/nan_weak.h +453 -0
- package/node_modules/nan/package.json +38 -0
- package/node_modules/nan/tools/1to2.js +412 -0
- package/node_modules/nan/tools/README.md +14 -0
- package/node_modules/nan/tools/package.json +19 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/ssh2/.eslintignore +4 -0
- package/node_modules/ssh2/.eslintrc.js +5 -0
- package/node_modules/ssh2/.github/workflows/ci.yml +110 -0
- package/node_modules/ssh2/.github/workflows/lint.yml +27 -0
- package/node_modules/ssh2/LICENSE +19 -0
- package/node_modules/ssh2/README.md +1529 -0
- package/node_modules/ssh2/SFTP.md +413 -0
- package/node_modules/ssh2/examples/server-chat.js +238 -0
- package/node_modules/ssh2/examples/sftp-server-download-only.js +134 -0
- package/node_modules/ssh2/install.js +27 -0
- package/node_modules/ssh2/lib/Channel.js +295 -0
- package/node_modules/ssh2/lib/agent.js +1123 -0
- package/node_modules/ssh2/lib/client.js +2176 -0
- package/node_modules/ssh2/lib/http-agents.js +84 -0
- package/node_modules/ssh2/lib/index.js +44 -0
- package/node_modules/ssh2/lib/keygen.js +582 -0
- package/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
- package/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
- package/node_modules/ssh2/lib/protocol/constants.js +356 -0
- package/node_modules/ssh2/lib/protocol/crypto/binding.gyp +23 -0
- package/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
- package/node_modules/ssh2/lib/protocol/crypto/src/binding.cc +2300 -0
- package/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
- package/node_modules/ssh2/lib/protocol/handlers.js +16 -0
- package/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
- package/node_modules/ssh2/lib/protocol/kex.js +1908 -0
- package/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
- package/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
- package/node_modules/ssh2/lib/protocol/utils.js +356 -0
- package/node_modules/ssh2/lib/protocol/zlib.js +255 -0
- package/node_modules/ssh2/lib/server.js +1380 -0
- package/node_modules/ssh2/lib/utils.js +336 -0
- package/node_modules/ssh2/package.json +49 -0
- package/node_modules/ssh2/test/common.js +316 -0
- package/node_modules/ssh2/test/fixtures/bad_rsa_private_key +26 -0
- package/node_modules/ssh2/test/fixtures/https_cert.pem +33 -0
- package/node_modules/ssh2/test/fixtures/https_key.pem +52 -0
- package/node_modules/ssh2/test/fixtures/id_dsa +12 -0
- package/node_modules/ssh2/test/fixtures/id_ecdsa +5 -0
- package/node_modules/ssh2/test/fixtures/id_rsa +15 -0
- package/node_modules/ssh2/test/fixtures/id_rsa.ppk +26 -0
- package/node_modules/ssh2/test/fixtures/id_rsa_enc +30 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa +21 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc +22 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm +23 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa +9 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519 +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc +28 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm +29 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa +12 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc +15 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa +5 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc +30 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256 +54 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub.result +6 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.result +6 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc +17 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa +26 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc +18 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub +9 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub +11 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub +11 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub +13 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/openssh_new_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_dsa_key +12 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key +5 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_rsa_key +15 -0
- package/node_modules/ssh2/test/test-exec.js +578 -0
- package/node_modules/ssh2/test/test-integration-openssh.js +486 -0
- package/node_modules/ssh2/test/test-keygen.js +60 -0
- package/node_modules/ssh2/test/test-misc-client-server.js +1460 -0
- package/node_modules/ssh2/test/test-openssh.js +261 -0
- package/node_modules/ssh2/test/test-protocol-crypto.js +631 -0
- package/node_modules/ssh2/test/test-protocol-keyparser.js +177 -0
- package/node_modules/ssh2/test/test-server-hostkeys.js +138 -0
- package/node_modules/ssh2/test/test-sftp.js +842 -0
- package/node_modules/ssh2/test/test-shell.js +109 -0
- package/node_modules/ssh2/test/test-userauth-agent-openssh.js +110 -0
- package/node_modules/ssh2/test/test-userauth-agent.js +171 -0
- package/node_modules/ssh2/test/test-userauth.js +611 -0
- package/node_modules/ssh2/test/test-worker-imports.js +25 -0
- package/node_modules/ssh2/test/test.js +20 -0
- package/node_modules/ssh2/util/build_pagent.bat +2 -0
- package/node_modules/ssh2/util/pagent.c +88 -0
- package/node_modules/ssh2/util/pagent.exe +0 -0
- package/node_modules/tweetnacl/.npmignore +4 -0
- package/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/node_modules/tweetnacl/CHANGELOG.md +221 -0
- package/node_modules/tweetnacl/LICENSE +24 -0
- package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/node_modules/tweetnacl/README.md +459 -0
- package/node_modules/tweetnacl/nacl-fast.js +2388 -0
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -0
- package/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/node_modules/tweetnacl/nacl.js +1175 -0
- package/node_modules/tweetnacl/nacl.min.js +1 -0
- package/node_modules/tweetnacl/package.json +58 -0
- package/package.json +95 -89
|
@@ -0,0 +1,138 @@
|
|
|
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
|
|
@@ -0,0 +1,212 @@
|
|
|
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
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
|
@@ -0,0 +1,163 @@
|
|
|
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
|