~ubuntu-branches/debian/jessie/qemu/jessie

« back to all changes in this revision

Viewing changes to debian/patches/qemu-mipsel-debian-rootfs.patch

  • Committer: Package Import Robot
  • Author(s): Vagrant Cascadian
  • Date: 2011-10-03 12:29:18 UTC
  • mfrom: (1.2.13) (10.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20111003122918-zc4kv6epchrbgdta
Tags: 0.15.0+dfsg-1
* New upstream version.
* Install new qemu-system, qemu-user and qemu-user-static variants: 
  lm32, microblazeel, s390x, unicore32
* Patch from upstream to set QEMU_INCLUDES before QEMU_CFLAGS.
* Update debian/watch to check http://qemu.org/download.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
apply patch to fix debian bug #562887, qemu-user-static mipsel emulation not 
2
 
working:
3
 
http://lists.nongnu.org/archive/html/qemu-devel/2011-07/msg00313.html
4
 
 
5
 
Index: qemu-0.14.1.1/linux-user/main.c
6
 
===================================================================
7
 
--- qemu-0.14.1.1.orig/linux-user/main.c        2011-07-04 19:37:39.000000000 +0200
8
 
+++ qemu-0.14.1.1/linux-user/main.c     2011-07-05 10:39:30.000000000 +0200
9
 
@@ -1875,7 +1875,7 @@
10
 
        MIPS_SYS(sys_getcwd     , 2)
11
 
        MIPS_SYS(sys_capget     , 2)
12
 
        MIPS_SYS(sys_capset     , 2)    /* 4205 */
13
 
-       MIPS_SYS(sys_sigaltstack        , 0)
14
 
+       MIPS_SYS(sys_sigaltstack        , 2)
15
 
        MIPS_SYS(sys_sendfile   , 4)
16
 
        MIPS_SYS(sys_ni_syscall , 0)
17
 
        MIPS_SYS(sys_ni_syscall , 0)
18
 
@@ -1985,6 +1985,20 @@
19
 
        MIPS_SYS(sys_epoll_pwait, 6)
20
 
        MIPS_SYS(sys_ioprio_set, 3)
21
 
        MIPS_SYS(sys_ioprio_get, 2)
22
 
+       MIPS_SYS(sys_utimensat, 4)
23
 
+       MIPS_SYS(sys_ni_syscall, 0) /* signalfd */
24
 
+       MIPS_SYS(sys_ni_syscall, 0) /* timerfd */
25
 
+       MIPS_SYS(sys_eventfd, 1)
26
 
+       MIPS_SYS(sys_fallocate, 4)
27
 
+       MIPS_SYS(sys_ni_syscall, 0) /* timerfd_create */
28
 
+       MIPS_SYS(sys_ni_syscall, 0) /* timerfd_gettime */
29
 
+       MIPS_SYS(sys_ni_syscall, 0) /* timerfd_settime */
30
 
+       MIPS_SYS(sys_ni_syscall, 0) /* signalfd4 */
31
 
+       MIPS_SYS(sys_eventfd2, 2)
32
 
+       MIPS_SYS(sys_epoll_create1, 1)
33
 
+       MIPS_SYS(sys_dup3, 3)
34
 
+       MIPS_SYS(sys_pipe2, 2)
35
 
+       MIPS_SYS(sys_inotify_init1, 1)
36
 
 };
37
 
 
38
 
 #undef MIPS_SYS
39
 
@@ -2053,7 +2067,7 @@
40
 
             syscall_num = env->active_tc.gpr[2] - 4000;
41
 
             env->active_tc.PC += 4;
42
 
             if (syscall_num >= sizeof(mips_syscall_args)) {
43
 
-                ret = -ENOSYS;
44
 
+                ret = -TARGET_ENOSYS;
45
 
             } else {
46
 
                 int nb_args;
47
 
                 abi_ulong sp_reg;
48
 
@@ -2093,6 +2107,8 @@
49
 
             break;
50
 
         case EXCP_TLBL:
51
 
         case EXCP_TLBS:
52
 
+        case EXCP_AdEL:
53
 
+        case EXCP_AdES:
54
 
             info.si_signo = TARGET_SIGSEGV;
55
 
             info.si_errno = 0;
56
 
             /* XXX: check env->error_code */
57
 
Index: qemu-0.14.1.1/linux-user/syscall.c
58
 
===================================================================
59
 
--- qemu-0.14.1.1.orig/linux-user/syscall.c     2011-07-04 19:37:39.000000000 +0200
60
 
+++ qemu-0.14.1.1/linux-user/syscall.c  2011-07-04 19:37:41.000000000 +0200
61
 
@@ -933,6 +933,44 @@
62
 
         return tswapl(rlim);
63
 
 }
64
 
 
65
 
+static inline int target_to_host_resource(int code)
66
 
+{
67
 
+    switch (code) {
68
 
+    case TARGET_RLIMIT_AS:
69
 
+        return RLIMIT_AS;
70
 
+    case TARGET_RLIMIT_CORE:
71
 
+        return RLIMIT_CORE;
72
 
+    case TARGET_RLIMIT_CPU:
73
 
+        return RLIMIT_CPU;
74
 
+    case TARGET_RLIMIT_DATA:
75
 
+        return RLIMIT_DATA;
76
 
+    case TARGET_RLIMIT_FSIZE:
77
 
+        return RLIMIT_FSIZE;
78
 
+    case TARGET_RLIMIT_LOCKS:
79
 
+        return RLIMIT_LOCKS;
80
 
+    case TARGET_RLIMIT_MEMLOCK:
81
 
+        return RLIMIT_MEMLOCK;
82
 
+    case TARGET_RLIMIT_MSGQUEUE:
83
 
+        return RLIMIT_MSGQUEUE;
84
 
+    case TARGET_RLIMIT_NICE:
85
 
+        return RLIMIT_NICE;
86
 
+    case TARGET_RLIMIT_NOFILE:
87
 
+        return RLIMIT_NOFILE;
88
 
+    case TARGET_RLIMIT_NPROC:
89
 
+        return RLIMIT_NPROC;
90
 
+    case TARGET_RLIMIT_RSS:
91
 
+        return RLIMIT_RSS;
92
 
+    case TARGET_RLIMIT_RTPRIO:
93
 
+        return RLIMIT_RTPRIO;
94
 
+    case TARGET_RLIMIT_SIGPENDING:
95
 
+        return RLIMIT_SIGPENDING;
96
 
+    case TARGET_RLIMIT_STACK:
97
 
+        return RLIMIT_STACK;
98
 
+    default:
99
 
+        return code;
100
 
+    }
101
 
+}
102
 
+
103
 
 static inline abi_long copy_from_user_timeval(struct timeval *tv,
104
 
                                               abi_ulong target_tv_addr)
105
 
 {
106
 
@@ -4317,6 +4355,10 @@
107
 
         arg3 = arg4;
108
 
       }
109
 
 #endif
110
 
+#ifdef TARGET_MIPS
111
 
+    arg2 = arg3;
112
 
+    arg3 = arg4;
113
 
+#endif
114
 
     return get_errno(truncate64(arg1, target_offset64(arg2, arg3)));
115
 
 }
116
 
 #endif
117
 
@@ -4334,6 +4376,10 @@
118
 
         arg3 = arg4;
119
 
       }
120
 
 #endif
121
 
+#ifdef TARGET_MIPS
122
 
+    arg2 = arg3;
123
 
+    arg3 = arg4;
124
 
+#endif
125
 
     return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3)));
126
 
 }
127
 
 #endif
128
 
@@ -5543,7 +5589,7 @@
129
 
         break;
130
 
     case TARGET_NR_setrlimit:
131
 
         {
132
 
-            int resource = arg1;
133
 
+            int resource = target_to_host_resource(arg1);
134
 
             struct target_rlimit *target_rlim;
135
 
             struct rlimit rlim;
136
 
             if (!lock_user_struct(VERIFY_READ, target_rlim, arg2, 1))
137
 
@@ -5556,7 +5602,7 @@
138
 
         break;
139
 
     case TARGET_NR_getrlimit:
140
 
         {
141
 
-            int resource = arg1;
142
 
+            int resource = target_to_host_resource(arg1);
143
 
             struct target_rlimit *target_rlim;
144
 
             struct rlimit rlim;
145
 
 
146
 
@@ -6791,6 +6837,9 @@
147
 
         if (((CPUARMState *)cpu_env)->eabi)
148
 
             arg4 = arg5;
149
 
 #endif
150
 
+#ifdef TARGET_MIPS
151
 
+        arg4 = arg5;
152
 
+#endif
153
 
         if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
154
 
             goto efault;
155
 
         ret = get_errno(pread(arg1, p, arg3, arg4));
156
 
@@ -6801,6 +6850,9 @@
157
 
         if (((CPUARMState *)cpu_env)->eabi)
158
 
             arg4 = arg5;
159
 
 #endif
160
 
+#ifdef TARGET_MIPS
161
 
+        arg4 = arg5;
162
 
+#endif
163
 
         if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
164
 
             goto efault;
165
 
         ret = get_errno(pwrite(arg1, p, arg3, arg4));
166
 
@@ -6860,7 +6912,8 @@
167
 
     case TARGET_NR_ugetrlimit:
168
 
     {
169
 
        struct rlimit rlim;
170
 
-       ret = get_errno(getrlimit(arg1, &rlim));
171
 
+       int resource = target_to_host_resource(arg1);
172
 
+       ret = get_errno(getrlimit(resource, &rlim));
173
 
        if (!is_error(ret)) {
174
 
            struct target_rlimit *target_rlim;
175
 
             if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0))
176
 
@@ -7558,6 +7611,11 @@
177
 
             arg4 = arg5;
178
 
         }
179
 
 #endif
180
 
+#ifdef TARGET_MIPS
181
 
+        arg2 = arg3;
182
 
+        arg3 = arg4;
183
 
+        arg4 = arg5;
184
 
+#endif
185
 
         ret = get_errno(readahead(arg1, ((off64_t)arg3 << 32) | arg2, arg4));
186
 
 #else
187
 
         ret = get_errno(readahead(arg1, arg2, arg3));
188
 
Index: qemu-0.14.1.1/linux-user/syscall_defs.h
189
 
===================================================================
190
 
--- qemu-0.14.1.1.orig/linux-user/syscall_defs.h        2011-07-04 19:37:39.000000000 +0200
191
 
+++ qemu-0.14.1.1/linux-user/syscall_defs.h     2011-07-04 19:37:41.000000000 +0200
192
 
@@ -693,6 +693,40 @@
193
 
 #define TARGET_RLIM_INFINITY   ((target_ulong)~0UL)
194
 
 #endif
195
 
 
196
 
+#if defined(TARGET_MIPS)
197
 
+#define TARGET_RLIMIT_CPU              0
198
 
+#define TARGET_RLIMIT_FSIZE            1
199
 
+#define TARGET_RLIMIT_DATA             2
200
 
+#define TARGET_RLIMIT_STACK            3
201
 
+#define TARGET_RLIMIT_CORE             4
202
 
+#define TARGET_RLIMIT_RSS              7
203
 
+#define TARGET_RLIMIT_NPROC            8
204
 
+#define TARGET_RLIMIT_NOFILE           5
205
 
+#define TARGET_RLIMIT_MEMLOCK          9
206
 
+#define TARGET_RLIMIT_AS               6
207
 
+#define TARGET_RLIMIT_LOCKS            10
208
 
+#define TARGET_RLIMIT_SIGPENDING       11
209
 
+#define TARGET_RLIMIT_MSGQUEUE         12
210
 
+#define TARGET_RLIMIT_NICE             13
211
 
+#define TARGET_RLIMIT_RTPRIO           14
212
 
+#else
213
 
+#define TARGET_RLIMIT_CPU              0
214
 
+#define TARGET_RLIMIT_FSIZE            1
215
 
+#define TARGET_RLIMIT_DATA             2
216
 
+#define TARGET_RLIMIT_STACK            3
217
 
+#define TARGET_RLIMIT_CORE             4
218
 
+#define TARGET_RLIMIT_RSS              5
219
 
+#define TARGET_RLIMIT_NPROC            6
220
 
+#define TARGET_RLIMIT_NOFILE           7
221
 
+#define TARGET_RLIMIT_MEMLOCK          8
222
 
+#define TARGET_RLIMIT_AS               9
223
 
+#define TARGET_RLIMIT_LOCKS            10
224
 
+#define TARGET_RLIMIT_SIGPENDING       11
225
 
+#define TARGET_RLIMIT_MSGQUEUE         12
226
 
+#define TARGET_RLIMIT_NICE             13
227
 
+#define TARGET_RLIMIT_RTPRIO           14
228
 
+#endif
229
 
+
230
 
 struct target_pollfd {
231
 
     int fd;           /* file descriptor */
232
 
     short events;     /* requested events */