0002-src-shared-missing.h-fix-getrandom-system-call-numbe.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From f80fe0e68686060e861338cf7b3b32e0637b3e0b Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Thu, 4 Aug 2016 10:13:09 +0200
  4. Subject: [PATCH] src/shared/missing.h: fix getrandom system call number on
  5. ARM64
  6. The getrandom() system call number is indeed 384 on ARM, but it is not
  7. the same on ARM64. ARM64 uses the asm-generic headers, including for
  8. system call numbers, so the getrandom() system call number on ARM64 is
  9. 278. This fixes runtime issues of eudev on ARM64, such as:
  10. Populating /dev using udev: [ 6.186817] udevd[1204]: starting version 3.1.5
  11. [ 6.191662] udevd[1204]: syscall 384
  12. [ 6.195217] Code: aa0503e4 aa0603e5 aa0703e6 d4000001 (b13ffc1f)
  13. [ 6.201291] CPU: 4 PID: 1204 Comm: udevd Not tainted 4.7.0+ #1
  14. [ 6.207079] Hardware name: ARM Juno development board (r2) (DT)
  15. [ 6.212954] task: ffff800976421900 task.stack: ffff800975610000
  16. [ 6.218825] PC is at 0xffff97f12234
  17. [ 6.222281] LR is at 0x41b15c
  18. [ 6.225214] pc : [<0000ffff97f12234>] lr : [<000000000041b15c>] pstate: 80000000
  19. [ 6.232544] sp : 0000ffffcf9b3870
  20. [ 6.235828] x29: 0000ffffcf9b3870 x28: 0000000000428218
  21. [ 6.241110] x27: 0000000000000000 x26: 000000000042a7e3
  22. [ 6.246395] x25: 0000ffffcf9b39c8 x24: 0000000000428000
  23. [ 6.251670] x23: 0000000000449000 x22: 0000000000449678
  24. [ 6.256946] x21: 0000000000000010 x20: 0000000000449000
  25. [ 6.262233] x19: 0000000000449678 x18: 0000000000000000
  26. [ 6.267507] x17: 0000ffff97f12210 x16: 0000000000449440
  27. [ 6.272779] x15: 0000ffff97e4f730 x14: 0000ffff98050cb8
  28. [ 6.278060] x13: 000000000000033c x12: 00000000000004b4
  29. [ 6.283331] x11: 0000000000000000 x10: 0101010101010101
  30. [ 6.288604] x9 : 0000000000001010 x8 : 0000000000000180
  31. [ 6.293882] x7 : ffffffffffffffff x6 : ffffffffffffffff
  32. [ 6.299154] x5 : 00000000271e36c0 x4 : 0007061c00190d07
  33. [ 6.304426] x3 : 00000000271e36d0 x2 : 0000000000000001
  34. [ 6.309705] x1 : 0000000000000010 x0 : 0000000000449678
  35. [ 6.314976]
  36. [ 6.398734] sky2 0000:08:00.0 enp8s0: renamed from eth0
  37. Reported-by: Kevin Hilman <khilman@baylibre.com>
  38. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  39. ---
  40. src/shared/missing.h | 4 +++-
  41. 1 file changed, 3 insertions(+), 1 deletion(-)
  42. diff --git a/src/shared/missing.h b/src/shared/missing.h
  43. index 9031119..5ad5997 100644
  44. --- a/src/shared/missing.h
  45. +++ b/src/shared/missing.h
  46. @@ -47,8 +47,10 @@
  47. # define __NR_getrandom 318
  48. # elif defined(__i386__)
  49. # define __NR_getrandom 355
  50. -# elif defined(__arm__) || defined(__aarch64__)
  51. +# elif defined(__arm__)
  52. # define __NR_getrandom 384
  53. +# elif defined(__aarch64__)
  54. +# define __NR_getrandom 278
  55. # elif defined(__ia64__)
  56. # define __NR_getrandom 1339
  57. # elif defined(__m68k__)
  58. --
  59. 2.7.4