You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
4.1 KiB

  1. Description: Add/fix support for m68k, mips, paris, sparc
  2. Author: Guillem Jover <guillem@debian.org>
  3. Origin: vendor
  4. Forwarded: no
  5. Last-Update: 2014-10-09
  6. ---
  7. harness/main.c | 10 +++++++++
  8. src/libaio.h | 1
  9. src/syscall-m68k.h | 5 ++++
  10. src/syscall-mips.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
  11. src/syscall-parisc.h | 6 +++++
  12. src/syscall.h | 6 +++++
  13. 6 files changed, 82 insertions(+)
  14. --- /dev/null
  15. +++ b/src/syscall-m68k.h
  16. @@ -0,0 +1,5 @@
  17. +#define __NR_io_setup 241
  18. +#define __NR_io_destroy 242
  19. +#define __NR_io_getevents 243
  20. +#define __NR_io_submit 244
  21. +#define __NR_io_cancel 245
  22. --- a/src/syscall.h
  23. +++ b/src/syscall.h
  24. @@ -27,6 +27,12 @@
  25. #include "syscall-arm.h"
  26. #elif defined(__sparc__)
  27. #include "syscall-sparc.h"
  28. +#elif defined(__m68k__)
  29. +#include "syscall-m68k.h"
  30. +#elif defined(__hppa__)
  31. +#include "syscall-parisc.h"
  32. +#elif defined(__mips__)
  33. +#include "syscall-mips.h"
  34. #elif defined(__aarch64__) || defined(__riscv)
  35. #include "syscall-generic.h"
  36. #else
  37. --- /dev/null
  38. +++ b/src/syscall-mips.h
  39. @@ -0,0 +1,54 @@
  40. +/*
  41. + * This file is subject to the terms and conditions of the GNU General Public
  42. + * License. See the file "COPYING" in the main directory of this archive
  43. + * for more details.
  44. + *
  45. + * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
  46. + * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  47. + */
  48. +
  49. +#ifndef _MIPS_SIM_ABI32
  50. +#define _MIPS_SIM_ABI32 1
  51. +#define _MIPS_SIM_NABI32 2
  52. +#define _MIPS_SIM_ABI64 3
  53. +#endif
  54. +
  55. +#if _MIPS_SIM == _MIPS_SIM_ABI32
  56. +
  57. +/*
  58. + * Linux o32 style syscalls are in the range from 4000 to 4999.
  59. + */
  60. +#define __NR_Linux 4000
  61. +#define __NR_io_setup (__NR_Linux + 241)
  62. +#define __NR_io_destroy (__NR_Linux + 242)
  63. +#define __NR_io_getevents (__NR_Linux + 243)
  64. +#define __NR_io_submit (__NR_Linux + 244)
  65. +#define __NR_io_cancel (__NR_Linux + 245)
  66. +
  67. +#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
  68. +
  69. +#if _MIPS_SIM == _MIPS_SIM_ABI64
  70. +
  71. +/*
  72. + * Linux 64-bit syscalls are in the range from 5000 to 5999.
  73. + */
  74. +#define __NR_Linux 5000
  75. +#define __NR_io_setup (__NR_Linux + 200)
  76. +#define __NR_io_destroy (__NR_Linux + 201)
  77. +#define __NR_io_getevents (__NR_Linux + 202)
  78. +#define __NR_io_submit (__NR_Linux + 203)
  79. +#define __NR_io_cancel (__NR_Linux + 204)
  80. +#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
  81. +
  82. +#if _MIPS_SIM == _MIPS_SIM_NABI32
  83. +
  84. +/*
  85. + * Linux N32 syscalls are in the range from 6000 to 6999.
  86. + */
  87. +#define __NR_Linux 6000
  88. +#define __NR_io_setup (__NR_Linux + 200)
  89. +#define __NR_io_destroy (__NR_Linux + 201)
  90. +#define __NR_io_getevents (__NR_Linux + 202)
  91. +#define __NR_io_submit (__NR_Linux + 203)
  92. +#define __NR_io_cancel (__NR_Linux + 204)
  93. +#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
  94. --- a/src/libaio.h
  95. +++ b/src/libaio.h
  96. @@ -72,6 +72,7 @@ typedef enum io_iocb_cmd {
  97. /* big endian, 64 bits */
  98. #elif defined(__powerpc64__) || defined(__s390x__) || \
  99. + (defined(__hppa__) && defined(__arch64__)) || \
  100. (defined(__sparc__) && defined(__arch64__)) || \
  101. (defined(__aarch64__) && defined(__AARCH64EB__)) || \
  102. (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
  103. --- /dev/null
  104. +++ b/src/syscall-parisc.h
  105. @@ -0,0 +1,6 @@
  106. +#define __NR_Linux 0
  107. +#define __NR_io_setup (__NR_Linux + 215)
  108. +#define __NR_io_destroy (__NR_Linux + 216)
  109. +#define __NR_io_getevents (__NR_Linux + 217)
  110. +#define __NR_io_submit (__NR_Linux + 218)
  111. +#define __NR_io_cancel (__NR_Linux + 219)
  112. --- a/harness/main.c
  113. +++ b/harness/main.c
  114. @@ -12,7 +12,17 @@
  115. #include <libaio.h>
  116. #if __LP64__ == 0
  117. +#if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
  118. #define KERNEL_RW_POINTER ((void *)0xc0010000)
  119. +#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
  120. +#define KERNEL_RW_POINTER ((void *)0x00010000)
  121. +#elif defined(__hppa__)
  122. +#define KERNEL_RW_POINTER ((void *)0x10100000)
  123. +#elif defined(__sparc__)
  124. +#define KERNEL_RW_POINTER ((void *)0xf0010000)
  125. +#else
  126. +#error Unknown kernel memory address.
  127. +#endif
  128. #else
  129. //#warning Not really sure where kernel memory is. Guessing.
  130. #define KERNEL_RW_POINTER ((void *)0xffffffff81000000)