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