0009-components-update_client-add-riscv64-arch-definition.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From b919c1f1a31b647ef3f5f124c22f5ee0b5950f08 Mon Sep 17 00:00:00 2001
  2. From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
  3. Date: Tue, 5 Apr 2022 02:27:27 +0000
  4. Subject: [PATCH 09/22] components: update_client: add riscv64 arch definition
  5. Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
  6. ---
  7. components/update_client/update_query_params.cc | 4 ++++
  8. components/update_client/update_query_params.h | 2 +-
  9. 2 files changed, 5 insertions(+), 1 deletion(-)
  10. diff --git a/components/update_client/update_query_params.cc b/components/update_client/update_query_params.cc
  11. index a707c0ea2ca62..29136a51488cf 100644
  12. --- a/components/update_client/update_query_params.cc
  13. +++ b/components/update_client/update_query_params.cc
  14. @@ -63,6 +63,8 @@ const char kArch[] =
  15. "loong32";
  16. #elif defined(__loongarch64)
  17. "loong64";
  18. +#elif defined(__riscv) && (__riscv_xlen == 64)
  19. + "riscv64";
  20. #else
  21. #error "unknown arch"
  22. #endif
  23. @@ -136,6 +138,8 @@ const char* UpdateQueryParams::GetNaclArch() {
  24. return "loong32";
  25. #elif defined(ARCH_CPU_LOONG64)
  26. return "loong64";
  27. +#elif defined(ARCH_CPU_RISCV64)
  28. + return "riscv64";
  29. #else
  30. // NOTE: when adding new values here, please remember to update the
  31. // comment in the .h file about possible return values from this function.
  32. diff --git a/components/update_client/update_query_params.h b/components/update_client/update_query_params.h
  33. index a22f8b85bc0d9..969582bf92289 100644
  34. --- a/components/update_client/update_query_params.h
  35. +++ b/components/update_client/update_query_params.h
  36. @@ -44,7 +44,7 @@ class UpdateQueryParams {
  37. // Returns the value we use for the "nacl_arch" parameter. Note that this may
  38. // be different from the "arch" parameter above (e.g. one may be 32-bit and
  39. // the other 64-bit). Possible return values include: "x86-32", "x86-64",
  40. - // "arm", "mips32", and "ppc64".
  41. + // "arm", "mips32", "ppc64", and "riscv64".
  42. static const char* GetNaclArch();
  43. // Returns the current version of Chrome/Chromium.
  44. --
  45. 2.25.1