0007-Add-SH-support.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. From 29782e82f83ed000edecc56ac77285864ec2672b Mon Sep 17 00:00:00 2001
  2. From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  3. Date: Sun, 12 Apr 2020 03:30:41 +0200
  4. Subject: [PATCH libaio 07/11] Add SH support
  5. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  6. ---
  7. harness/main.c | 2 +-
  8. src/libaio.h | 3 ++-
  9. src/syscall-sh.h | 6 ++++++
  10. src/syscall.h | 2 ++
  11. 4 files changed, 11 insertions(+), 2 deletions(-)
  12. create mode 100644 src/syscall-sh.h
  13. diff --git a/harness/main.c b/harness/main.c
  14. index 99d393f..ac0fba2 100644
  15. --- a/harness/main.c
  16. +++ b/harness/main.c
  17. @@ -14,7 +14,7 @@
  18. #if __LP64__ == 0
  19. #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
  20. #define KERNEL_RW_POINTER ((void *)0xc0010000)
  21. -#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
  22. +#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
  23. #define KERNEL_RW_POINTER ((void *)0x00010000)
  24. #elif defined(__hppa__)
  25. #define KERNEL_RW_POINTER ((void *)0x10100000)
  26. diff --git a/src/libaio.h b/src/libaio.h
  27. index 29005d0..c748454 100644
  28. --- a/src/libaio.h
  29. +++ b/src/libaio.h
  30. @@ -52,7 +52,7 @@ typedef enum io_iocb_cmd {
  31. /* little endian, 32 bits */
  32. #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
  33. - defined(__sh__) || \
  34. + (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
  35. defined(__bfin__) || \
  36. (defined(__MIPSEL__) && !defined(__mips64)) || \
  37. defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \
  38. @@ -88,6 +88,7 @@ typedef enum io_iocb_cmd {
  39. /* big endian, 32 bits */
  40. #elif defined(__PPC__) || defined(__s390__) || \
  41. (defined(__arm__) && defined(__ARMEB__)) || \
  42. + (defined(__sh__) && defined (__BIG_ENDIAN__)) || \
  43. defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
  44. defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
  45. (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
  46. diff --git a/src/syscall-sh.h b/src/syscall-sh.h
  47. new file mode 100644
  48. index 0000000..6c00573
  49. --- /dev/null
  50. +++ b/src/syscall-sh.h
  51. @@ -0,0 +1,6 @@
  52. +/* Copy from ./arch/sh/include/asm/unistd_32.h */
  53. +#define __NR_io_setup 245
  54. +#define __NR_io_destroy 246
  55. +#define __NR_io_getevents 247
  56. +#define __NR_io_submit 248
  57. +#define __NR_io_cancel 249
  58. diff --git a/src/syscall.h b/src/syscall.h
  59. index a88876f..b86d745 100644
  60. --- a/src/syscall.h
  61. +++ b/src/syscall.h
  62. @@ -33,6 +33,8 @@
  63. #include "syscall-parisc.h"
  64. #elif defined(__mips__)
  65. #include "syscall-mips.h"
  66. +#elif defined(__sh__)
  67. +#include "syscall-sh.h"
  68. #elif defined(__aarch64__) || defined(__riscv)
  69. #include "syscall-generic.h"
  70. #else
  71. --
  72. 2.26.0.292.g33ef6b2f38