uapi.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. diff -Nur linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/byteorder.h linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/byteorder.h
  2. --- linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/byteorder.h 1970-01-01 01:00:00.000000000 +0100
  3. +++ linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/byteorder.h 2019-10-30 14:32:57.868397215 +0100
  4. @@ -0,0 +1,16 @@
  5. +#ifndef _LM32_ASM_BYTEORDER_H
  6. +#define _LM32_ASM_BYTEORDER_H
  7. +
  8. +#include <asm/types.h>
  9. +
  10. +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
  11. +// there is a 64bit data type supported by the processor
  12. +# define __BYTEORDER_HAS_U64__
  13. +
  14. +// so we don't have to implement swab64 in assembler ;)
  15. +# define __SWAB_64_THRU_32__
  16. +#endif
  17. +
  18. +#include <linux/byteorder/big_endian.h>
  19. +
  20. +#endif /* _LM32_BYTEORDER_H */
  21. diff -Nur linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/Kbuild linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/Kbuild
  22. --- linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/Kbuild 1970-01-01 01:00:00.000000000 +0100
  23. +++ linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/Kbuild 2019-10-30 14:34:14.357298364 +0100
  24. @@ -0,0 +1,6 @@
  25. +# UAPI Header export list
  26. +include include/uapi/asm-generic/Kbuild.asm
  27. +
  28. +header-y += byteorder.h
  29. +header-y += ptrace.h
  30. +header-y += unistd.h
  31. diff -Nur linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/ptrace.h linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/ptrace.h
  32. --- linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/ptrace.h 1970-01-01 01:00:00.000000000 +0100
  33. +++ linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/ptrace.h 2019-10-30 14:32:57.888398498 +0100
  34. @@ -0,0 +1,103 @@
  35. +/*
  36. + * (C) Copyright 2007
  37. + * Theobroma Systems <www.theobroma-systems.com>
  38. + *
  39. + * See file CREDITS for list of people who contributed to this
  40. + * project.
  41. + *
  42. + * This program is free software; you can redistribute it and/or
  43. + * modify it under the terms of the GNU General Public License as
  44. + * published by the Free Software Foundation; either version 2 of
  45. + * the License, or (at your option) any later version.
  46. + *
  47. + * This program is distributed in the hope that it will be useful,
  48. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  49. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  50. + * GNU General Public License for more details.
  51. + *
  52. + * You should have received a copy of the GNU General Public License
  53. + * along with this program; if not, write to the Free Software
  54. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  55. + * MA 02111-1307 USA
  56. + */
  57. +
  58. +#ifndef _ASM_LM32_PTRACE_H
  59. +#define _ASM_LM32_PTRACE_H
  60. +
  61. +#define PT_MODE_KERNEL 1
  62. +#define PT_MODE_USER 0
  63. +
  64. +#ifndef __ASSEMBLY__
  65. +
  66. +#define user_stack_pointer(regs) ((regs)->sp)
  67. +
  68. +typedef unsigned long lm32_reg_t;
  69. +
  70. +struct pt_regs {
  71. + lm32_reg_t r0;
  72. + lm32_reg_t r1;
  73. + lm32_reg_t r2;
  74. + lm32_reg_t r3;
  75. + lm32_reg_t r4;
  76. + lm32_reg_t r5;
  77. + lm32_reg_t r6;
  78. + lm32_reg_t r7;
  79. + lm32_reg_t r8;
  80. + lm32_reg_t r9;
  81. + lm32_reg_t r10;
  82. + lm32_reg_t r11;
  83. + lm32_reg_t r12;
  84. + lm32_reg_t r13;
  85. + lm32_reg_t r14;
  86. + lm32_reg_t r15;
  87. + lm32_reg_t r16;
  88. + lm32_reg_t r17;
  89. + lm32_reg_t r18;
  90. + lm32_reg_t r19;
  91. + lm32_reg_t r20;
  92. + lm32_reg_t r21;
  93. + lm32_reg_t r22;
  94. + lm32_reg_t r23;
  95. + lm32_reg_t r24;
  96. + lm32_reg_t r25;
  97. + lm32_reg_t gp;
  98. + lm32_reg_t fp;
  99. + lm32_reg_t sp;
  100. + lm32_reg_t ra;
  101. + lm32_reg_t ea;
  102. + lm32_reg_t ba;
  103. + unsigned int pt_mode;
  104. +};
  105. +
  106. +#ifdef __KERNEL__
  107. +#define user_mode(regs) ((regs)->pt_mode == PT_MODE_USER)
  108. +
  109. +#define instruction_pointer(regs) ((regs)->ea)
  110. +#define profile_pc(regs) instruction_pointer(regs)
  111. +
  112. +void show_regs(struct pt_regs *);
  113. +
  114. +#else /* !__KERNEL__ */
  115. +
  116. +/* TBD (gdbserver/ptrace) */
  117. +
  118. +#endif /* !__KERNEL__ */
  119. +
  120. +/* FIXME: remove this ? */
  121. +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  122. +#define PTRACE_GETREGS 12
  123. +#define PTRACE_SETREGS 13
  124. +
  125. +#define PTRACE_GETFDPIC 31
  126. +
  127. +#define PTRACE_GETFDPIC_EXEC 0
  128. +#define PTRACE_GETFDPIC_INTERP 1
  129. +
  130. +/* for gdb */
  131. +#define PT_TEXT_ADDR 50
  132. +#define PT_TEXT_END_ADDR 51
  133. +#define PT_DATA_ADDR 52
  134. +
  135. +#endif /* !__ASSEMBLY__ */
  136. +
  137. +#endif /* _ASM_LM32_PTRACE_H */
  138. diff -Nur linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/unistd.h linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/unistd.h
  139. --- linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8.orig/arch/lm32/include/uapi/asm/unistd.h 1970-01-01 01:00:00.000000000 +0100
  140. +++ linux-b6a72d383cf0d4c9c448c1f4e5e8d496ea5c1fd8/arch/lm32/include/uapi/asm/unistd.h 2019-10-30 14:32:57.884398247 +0100
  141. @@ -0,0 +1,15 @@
  142. +#if !defined(_ASM_LM32_UNISTD_H) || defined(__SYSCALL)
  143. +#define _ASM_LM32_UNISTD_H
  144. +
  145. +#define __ARCH_WANT_SYSCALL_NO_AT
  146. +#define __ARCH_WANT_SYSCALL_NO_FLAGS
  147. +#define __ARCH_WANT_SYSCALL_OFF_T
  148. +#define __ARCH_WANT_SYSCALL_DEPRECATED
  149. +
  150. +#define __ARCH_WANT_SYS_CLONE
  151. +
  152. +#include <asm-generic/unistd.h>
  153. +
  154. +#undef __NR_mmap
  155. +
  156. +#endif /* _ASM_LM32_UNISTD_H */