mipsr6.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. diff -Nur linux-5.10.17.orig/arch/mips/include/asm/vdso/gettimeofday.h linux-5.10.17/arch/mips/include/asm/vdso/gettimeofday.h
  2. --- linux-5.10.17.orig/arch/mips/include/asm/vdso/gettimeofday.h 2021-02-17 11:02:30.000000000 +0100
  3. +++ linux-5.10.17/arch/mips/include/asm/vdso/gettimeofday.h 2021-04-09 15:24:43.613709753 +0200
  4. @@ -30,12 +30,21 @@
  5. register long nr asm("v0") = __NR_gettimeofday;
  6. register long error asm("a3");
  7. +#if MIPS_ISA_REV >= 6
  8. + asm volatile(
  9. + " syscall\n"
  10. + : "=r" (ret), "=r" (error)
  11. + : "r" (tv), "r" (tz), "r" (nr)
  12. + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  13. + "$14", "$15", "$24", "$25", "memory");
  14. +#else
  15. asm volatile(
  16. " syscall\n"
  17. : "=r" (ret), "=r" (error)
  18. : "r" (tv), "r" (tz), "r" (nr)
  19. : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  20. "$14", "$15", "$24", "$25", "hi", "lo", "memory");
  21. +#endif
  22. return error ? -ret : ret;
  23. }
  24. @@ -54,12 +63,21 @@
  25. #endif
  26. register long error asm("a3");
  27. +#if MIPS_ISA_REV >= 6
  28. + asm volatile(
  29. + " syscall\n"
  30. + : "=r" (ret), "=r" (error)
  31. + : "r" (clkid), "r" (ts), "r" (nr)
  32. + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  33. + "$14", "$15", "$24", "$25", "memory");
  34. +#else
  35. asm volatile(
  36. " syscall\n"
  37. : "=r" (ret), "=r" (error)
  38. : "r" (clkid), "r" (ts), "r" (nr)
  39. : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  40. "$14", "$15", "$24", "$25", "hi", "lo", "memory");
  41. +#endif
  42. return error ? -ret : ret;
  43. }
  44. @@ -78,12 +96,21 @@
  45. #endif
  46. register long error asm("a3");
  47. +#if MIPS_ISA_REV >= 6
  48. + asm volatile(
  49. + " syscall\n"
  50. + : "=r" (ret), "=r" (error)
  51. + : "r" (clkid), "r" (ts), "r" (nr)
  52. + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  53. + "$14", "$15", "$24", "$25", "memory");
  54. +#else
  55. asm volatile(
  56. " syscall\n"
  57. : "=r" (ret), "=r" (error)
  58. : "r" (clkid), "r" (ts), "r" (nr)
  59. : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  60. "$14", "$15", "$24", "$25", "hi", "lo", "memory");
  61. +#endif
  62. return error ? -ret : ret;
  63. }
  64. @@ -100,12 +127,21 @@
  65. register long nr asm("v0") = __NR_clock_gettime;
  66. register long error asm("a3");
  67. +#if MIPS_ISA_REV >= 6
  68. + asm volatile(
  69. + " syscall\n"
  70. + : "=r" (ret), "=r" (error)
  71. + : "r" (clkid), "r" (ts), "r" (nr)
  72. + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  73. + "$14", "$15", "$24", "$25", "memory");
  74. +#else
  75. asm volatile(
  76. " syscall\n"
  77. : "=r" (ret), "=r" (error)
  78. : "r" (clkid), "r" (ts), "r" (nr)
  79. : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  80. "$14", "$15", "$24", "$25", "hi", "lo", "memory");
  81. +#endif
  82. return error ? -ret : ret;
  83. }
  84. @@ -120,12 +156,21 @@
  85. register long nr asm("v0") = __NR_clock_getres;
  86. register long error asm("a3");
  87. +#if MIPS_ISA_REV >= 6
  88. + asm volatile(
  89. + " syscall\n"
  90. + : "=r" (ret), "=r" (error)
  91. + : "r" (clkid), "r" (ts), "r" (nr)
  92. + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  93. + "$14", "$15", "$24", "$25", "memory");
  94. +#else
  95. asm volatile(
  96. " syscall\n"
  97. : "=r" (ret), "=r" (error)
  98. : "r" (clkid), "r" (ts), "r" (nr)
  99. : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
  100. "$14", "$15", "$24", "$25", "hi", "lo", "memory");
  101. +#endif
  102. return error ? -ret : ret;
  103. }