ia64/xen-unstable

view stubdom/newlib.patch @ 19828:180ae4bca33e

VT-d: don't disable VT-d engine in suspend for security purpose

force_iommu option is used to force enabling and using IOMMU for
security purpose. So when force_iommu is set, it shouldn't disable
VT-d engines in suspend.

Signed-off-by: Weidong Han <weidong.han@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jun 24 11:15:31 2009 +0100 (2009-06-24)
parents 26afc8557f9f
children
line source
1 There is a mix between longs and long longs.
3 Index: newlib/libc/include/inttypes.h
4 ===================================================================
5 RCS file: /cvs/src/src/newlib/libc/include/inttypes.h,v
6 retrieving revision 1.3
7 diff -u -p -r1.3 inttypes.h
8 --- newlib/libc/include/inttypes.h 16 Dec 2005 19:03:12 -0000 1.3
9 +++ newlib/libc/include/inttypes.h 8 Nov 2007 16:32:44 -0000
10 @@ -163,12 +163,12 @@
13 /* 64-bit types */
14 -#if __have_longlong64
15 -#define __PRI64(x) __STRINGIFY(ll##x)
16 -#define __SCN64(x) __STRINGIFY(ll##x)
17 -#elif __have_long64
18 +#if __have_long64
19 #define __PRI64(x) __STRINGIFY(l##x)
20 #define __SCN64(x) __STRINGIFY(l##x)
21 +#elif __have_longlong64
22 +#define __PRI64(x) __STRINGIFY(ll##x)
23 +#define __SCN64(x) __STRINGIFY(ll##x)
24 #else
25 #define __PRI64(x) __STRINGIFY(x)
26 #define __SCN64(x) __STRINGIFY(x)
27 @@ -217,12 +217,12 @@
28 #endif
30 /* max-bit types */
31 -#if __have_longlong64
32 -#define __PRIMAX(x) __STRINGIFY(ll##x)
33 -#define __SCNMAX(x) __STRINGIFY(ll##x)
34 -#elif __have_long64
35 +#if __have_long64
36 #define __PRIMAX(x) __STRINGIFY(l##x)
37 #define __SCNMAX(x) __STRINGIFY(l##x)
38 +#elif __have_longlong64
39 +#define __PRIMAX(x) __STRINGIFY(ll##x)
40 +#define __SCNMAX(x) __STRINGIFY(ll##x)
41 #else
42 #define __PRIMAX(x) __STRINGIFY(x)
43 #define __SCNMAX(x) __STRINGIFY(x)
44 @@ -242,12 +242,12 @@
45 #define SCNxMAX __SCNMAX(x)
47 /* ptr types */
48 -#if __have_longlong64
49 -#define __PRIPTR(x) __STRINGIFY(ll##x)
50 -#define __SCNPTR(x) __STRINGIFY(ll##x)
51 -#elif __have_long64
52 +#if __have_long64
53 #define __PRIPTR(x) __STRINGIFY(l##x)
54 #define __SCNPTR(x) __STRINGIFY(l##x)
55 +#elif __have_longlong64
56 +#define __PRIPTR(x) __STRINGIFY(ll##x)
57 +#define __SCNPTR(x) __STRINGIFY(ll##x)
58 #else
59 #define __PRIPTR(x) __STRINGIFY(x)
60 #define __SCNPTR(x) __STRINGIFY(x)
62 We don't want u?int32_t to be long as our code assume in a lot of places to be
63 int.
65 Index: newlib/libc/include/stdint.h
66 ===================================================================
67 RCS file: /cvs/src/src/newlib/libc/include/stdint.h,v
68 retrieving revision 1.10
69 diff -u -p -r1.10 stdint.h
70 --- newlib/libc/include/stdint.h 16 Aug 2006 21:39:43 -0000 1.10
71 +++ newlib/libc/include/stdint.h 12 Feb 2008 13:07:52 -0000
72 @@ -38,7 +38,7 @@ extern "C" {
73 #if __STDINT_EXP(LONG_MAX) > 0x7fffffff
74 #define __have_long64 1
75 #elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
76 -#define __have_long32 1
77 +/* #define __have_long32 1 */
78 #endif
80 #if __STDINT_EXP(SCHAR_MAX) == 0x7f
82 Define the basic ia64 jump buffer
84 Index: newlib/libc/include/machine/setjmp.h
85 ===================================================================
86 RCS file: /cvs/src/src/newlib/libc/include/machine/setjmp.h,v
87 retrieving revision 1.34
88 diff -u -p -r1.34 setjmp.h
89 --- newlib/libc/include/machine/setjmp.h 7 Nov 2007 21:42:24 -0000 1.34
90 +++ newlib/libc/include/machine/setjmp.h 11 Jan 2008 18:10:43 -0000
91 @@ -72,6 +72,11 @@ _BEGIN_STD_C
92 #define _JBLEN 8
93 #endif
95 +#ifdef __ia64__
96 +#define _JBTYPE long
97 +#define _JBLEN 70
98 +#endif
99 +
100 #ifdef __i960__
101 #define _JBLEN 35
102 #endif
104 In mini-os we use a dynamic reentrency buffer.
106 Index: newlib/libc/include/sys/config.h
107 ===================================================================
108 RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
109 retrieving revision 1.47
110 diff -u -p -r1.47 config.h
111 --- newlib/libc/include/sys/config.h 15 Mar 2007 21:32:12 -0000 1.47
112 +++ newlib/libc/include/sys/config.h 8 Nov 2007 16:32:44 -0000
113 @@ -71,6 +71,10 @@
114 #endif
115 #endif
117 +#ifndef __DYNAMIC_REENT__
118 +#define __DYNAMIC_REENT__
119 +#endif
120 +
121 #ifdef __mn10200__
122 #define __SMALL_BITFIELDS
123 #endif
125 Dynamic pointer to our reentrancy zone
127 Index: newlib/libc/reent/getreent.c
128 ===================================================================
129 RCS file: /cvs/src/src/newlib/libc/reent/getreent.c,v
130 retrieving revision 1.2
131 diff -u -p -r1.2 getreent.c
132 --- newlib/libc/reent/getreent.c 7 Sep 2007 00:45:55 -0000 1.2
133 +++ newlib/libc/reent/getreent.c 8 Nov 2007 16:32:44 -0000
134 @@ -3,12 +3,20 @@
135 #include <_ansi.h>
136 #include <reent.h>
138 +#define weak_alias(name, aliasname) \
139 + extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
140 +
141 #ifdef __getreent
142 #undef __getreent
143 #endif
144 +#ifdef __libc_getreent
145 +#undef __libc_getreent
146 +#endif
148 struct _reent *
149 -_DEFUN_VOID(__getreent)
150 +__libc_getreent (void)
151 {
152 return _impure_ptr;
153 }
154 +weak_alias(__libc_getreent,__getreent)
155 +
157 We can't provide a red zone in mini-os.
159 Index: newlib/libc/machine/x86_64/memcpy.S
160 ===================================================================
161 RCS file: /cvs/src/src/newlib/libc/machine/x86_64/memcpy.S,v
162 retrieving revision 1.1
163 diff -u -p -r1.1 memcpy.S
164 --- newlib/libc/machine/x86_64/memcpy.S 28 Aug 2007 21:56:49 -0000 1.1
165 +++ newlib/libc/machine/x86_64/memcpy.S 8 Nov 2007 16:32:44 -0000
166 @@ -30,10 +30,18 @@ quadword_aligned:
167 cmpq $256, rdx
168 jb quadword_copy
170 +#if 1
171 + subq $32, rsp
172 + movq rax, 24 (rsp)
173 + movq r12, 16 (rsp)
174 + movq r13, 8 (rsp)
175 + movq r14, 0 (rsp)
176 +#else
177 movq rax, -8 (rsp)
178 movq r12, -16 (rsp)
179 movq r13, -24 (rsp)
180 movq r14, -32 (rsp)
181 +#endif
183 movq rdx, rcx /* Copy 128 bytes at a time with minimum cache polution */
184 shrq $7, rcx
185 @@ -89,10 +97,18 @@ loop:
186 movq rdx, rcx
187 andq $127, rcx
188 rep movsb
189 +#if 1
190 + movq 24 (rsp), rax
191 + movq 16 (rsp), r12
192 + movq 8 (rsp), r13
193 + movq 0 (rsp), r14
194 + addq $32, rsp
195 +#else
196 movq -8 (rsp), rax
197 movq -16 (rsp), r12
198 movq -24 (rsp), r13
199 movq -32 (rsp), r14
200 +#endif
201 ret
204 --- newlib/libc/machine/x86_64/x86_64mach.h.orig 2008-07-11 14:57:23.062269000 +0100
205 +++ newlib/libc/machine/x86_64/x86_64mach.h 2008-07-11 14:58:01.262503000 +0100
206 @@ -22,81 +22,81 @@
208 #define REG(x) CONCAT1(__REG_PREFIX__, x)
210 -#define rax REG(rax)
211 -#define rbx REG(rbx)
212 -#define rcx REG(rcx)
213 -#define rdx REG(rdx)
214 -#define rsi REG(rsi)
215 -#define rdi REG(rdi)
216 -#define rbp REG(rbp)
217 -#define rsp REG(rsp)
218 -
219 -#define r8 REG(r8)
220 -#define r9 REG(r9)
221 -#define r10 REG(r10)
222 -#define r11 REG(r11)
223 -#define r12 REG(r12)
224 -#define r13 REG(r13)
225 -#define r14 REG(r14)
226 -#define r15 REG(r15)
227 -
228 -#define eax REG(eax)
229 -#define ebx REG(ebx)
230 -#define ecx REG(ecx)
231 -#define edx REG(edx)
232 -#define esi REG(esi)
233 -#define edi REG(edi)
234 -#define ebp REG(ebp)
235 -#define esp REG(esp)
236 -
237 -#define st0 REG(st)
238 -#define st1 REG(st(1))
239 -#define st2 REG(st(2))
240 -#define st3 REG(st(3))
241 -#define st4 REG(st(4))
242 -#define st5 REG(st(5))
243 -#define st6 REG(st(6))
244 -#define st7 REG(st(7))
245 -
246 -#define ax REG(ax)
247 -#define bx REG(bx)
248 -#define cx REG(cx)
249 -#define dx REG(dx)
250 -
251 -#define ah REG(ah)
252 -#define bh REG(bh)
253 -#define ch REG(ch)
254 -#define dh REG(dh)
255 -
256 -#define al REG(al)
257 -#define bl REG(bl)
258 -#define cl REG(cl)
259 -#define dl REG(dl)
260 -
261 -#define sil REG(sil)
262 -
263 -#define mm1 REG(mm1)
264 -#define mm2 REG(mm2)
265 -#define mm3 REG(mm3)
266 -#define mm4 REG(mm4)
267 -#define mm5 REG(mm5)
268 -#define mm6 REG(mm6)
269 -#define mm7 REG(mm7)
270 -
271 -#define xmm0 REG(xmm0)
272 -#define xmm1 REG(xmm1)
273 -#define xmm2 REG(xmm2)
274 -#define xmm3 REG(xmm3)
275 -#define xmm4 REG(xmm4)
276 -#define xmm5 REG(xmm5)
277 -#define xmm6 REG(xmm6)
278 -#define xmm7 REG(xmm7)
279 -
280 -#define cr0 REG(cr0)
281 -#define cr1 REG(cr1)
282 -#define cr2 REG(cr2)
283 -#define cr3 REG(cr3)
284 -#define cr4 REG(cr4)
285 +#define rax %rax
286 +#define rbx %rbx
287 +#define rcx %rcx
288 +#define rdx %rdx
289 +#define rsi %rsi
290 +#define rdi %rdi
291 +#define rbp %rbp
292 +#define rsp %rsp
293 +
294 +#define r8 %r8
295 +#define r9 %r9
296 +#define r10 %r10
297 +#define r11 %r11
298 +#define r12 %r12
299 +#define r13 %r13
300 +#define r14 %r14
301 +#define r15 %r15
302 +
303 +#define eax %eax
304 +#define ebx %ebx
305 +#define ecx %ecx
306 +#define edx %edx
307 +#define esi %esi
308 +#define edi %edi
309 +#define ebp %ebp
310 +#define esp %esp
311 +
312 +#define st0 %st
313 +#define st1 %st(1)
314 +#define st2 %st(2)
315 +#define st3 %st(3)
316 +#define st4 %st(4)
317 +#define st5 %st(5)
318 +#define st6 %st(6)
319 +#define st7 %st(7)
320 +
321 +#define ax %ax
322 +#define bx %bx
323 +#define cx %cx
324 +#define dx %dx
325 +
326 +#define ah %ah
327 +#define bh %bh
328 +#define ch %ch
329 +#define dh %dh
330 +
331 +#define al %al
332 +#define bl %bl
333 +#define cl %cl
334 +#define dl %dl
335 +
336 +#define sil %sil
337 +
338 +#define mm1 %mm1
339 +#define mm2 %mm2
340 +#define mm3 %mm3
341 +#define mm4 %mm4
342 +#define mm5 %mm5
343 +#define mm6 %mm6
344 +#define mm7 %mm7
345 +
346 +#define xmm0 %xmm0
347 +#define xmm1 %xmm1
348 +#define xmm2 %xmm2
349 +#define xmm3 %xmm3
350 +#define xmm4 %xmm4
351 +#define xmm5 %xmm5
352 +#define xmm6 %xmm6
353 +#define xmm7 %xmm7
354 +
355 +#define cr0 %cr0
356 +#define cr1 %cr1
357 +#define cr2 %cr2
358 +#define cr3 %cr3
359 +#define cr4 %cr4
361 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION
362 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
363 --- newlib/libc/machine/x86_64/memcpy.S.orig 2008-07-11 15:12:27.494693000 +0100
364 +++ newlib/libc/machine/x86_64/memcpy.S 2008-07-11 15:12:29.448706000 +0100
365 @@ -60,14 +60,14 @@
366 movq 48 (rsi), r13
367 movq 56 (rsi), r14
369 - movntiq rax, (rdi)
370 - movntiq r8 , 8 (rdi)
371 - movntiq r9 , 16 (rdi)
372 - movntiq r10, 24 (rdi)
373 - movntiq r11, 32 (rdi)
374 - movntiq r12, 40 (rdi)
375 - movntiq r13, 48 (rdi)
376 - movntiq r14, 56 (rdi)
377 + movnti rax, (rdi)
378 + movnti r8 , 8 (rdi)
379 + movnti r9 , 16 (rdi)
380 + movnti r10, 24 (rdi)
381 + movnti r11, 32 (rdi)
382 + movnti r12, 40 (rdi)
383 + movnti r13, 48 (rdi)
384 + movnti r14, 56 (rdi)
386 movq 64 (rsi), rax
387 movq 72 (rsi), r8
388 @@ -78,14 +78,14 @@
389 movq 112 (rsi), r13
390 movq 120 (rsi), r14
392 - movntiq rax, 64 (rdi)
393 - movntiq r8 , 72 (rdi)
394 - movntiq r9 , 80 (rdi)
395 - movntiq r10, 88 (rdi)
396 - movntiq r11, 96 (rdi)
397 - movntiq r12, 104 (rdi)
398 - movntiq r13, 112 (rdi)
399 - movntiq r14, 120 (rdi)
400 + movnti rax, 64 (rdi)
401 + movnti r8 , 72 (rdi)
402 + movnti r9 , 80 (rdi)
403 + movnti r10, 88 (rdi)
404 + movnti r11, 96 (rdi)
405 + movnti r12, 104 (rdi)
406 + movnti r13, 112 (rdi)
407 + movnti r14, 120 (rdi)
409 leaq 128 (rsi), rsi
410 leaq 128 (rdi), rdi
411 --- newlib/libc/machine/i386/i386mach.h 2000-08-28 18:50:06.000000000 +0100
412 +++ newlib/libc/machine/i386/i386mach.h 2008-07-11 15:17:13.874409000 +0100
413 @@ -27,46 +27,46 @@
415 #define REG(x) CONCAT1(__REG_PREFIX__, x)
417 -#define eax REG(eax)
418 -#define ebx REG(ebx)
419 -#define ecx REG(ecx)
420 -#define edx REG(edx)
421 -#define esi REG(esi)
422 -#define edi REG(edi)
423 -#define ebp REG(ebp)
424 -#define esp REG(esp)
425 -
426 -#define st0 REG(st)
427 -#define st1 REG(st(1))
428 -#define st2 REG(st(2))
429 -#define st3 REG(st(3))
430 -#define st4 REG(st(4))
431 -#define st5 REG(st(5))
432 -#define st6 REG(st(6))
433 -#define st7 REG(st(7))
434 -
435 -#define ax REG(ax)
436 -#define bx REG(bx)
437 -#define cx REG(cx)
438 -#define dx REG(dx)
439 -
440 -#define ah REG(ah)
441 -#define bh REG(bh)
442 -#define ch REG(ch)
443 -#define dh REG(dh)
444 -
445 -#define al REG(al)
446 -#define bl REG(bl)
447 -#define cl REG(cl)
448 -#define dl REG(dl)
449 -
450 -#define mm1 REG(mm1)
451 -#define mm2 REG(mm2)
452 -#define mm3 REG(mm3)
453 -#define mm4 REG(mm4)
454 -#define mm5 REG(mm5)
455 -#define mm6 REG(mm6)
456 -#define mm7 REG(mm7)
457 +#define eax %eax
458 +#define ebx %ebx
459 +#define ecx %ecx
460 +#define edx %edx
461 +#define esi %esi
462 +#define edi %edi
463 +#define ebp %ebp
464 +#define esp %esp
465 +
466 +#define st0 %st
467 +#define st1 %st(1)
468 +#define st2 %st(2)
469 +#define st3 %st(3)
470 +#define st4 %st(4)
471 +#define st5 %st(5)
472 +#define st6 %st(6)
473 +#define st7 %st(7)
474 +
475 +#define ax %ax
476 +#define bx %bx
477 +#define cx %cx
478 +#define dx %dx
479 +
480 +#define ah %ah
481 +#define bh %bh
482 +#define ch %ch
483 +#define dh %dh
484 +
485 +#define al %al
486 +#define bl %bl
487 +#define cl %cl
488 +#define dl %dl
489 +
490 +#define mm1 %mm1
491 +#define mm2 %mm2
492 +#define mm3 %mm3
493 +#define mm4 %mm4
494 +#define mm5 %mm5
495 +#define mm6 %mm6
496 +#define mm7 %mm7
498 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION
499 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
500 --- newlib/libc/machine/x86_64/memset.S 2007-08-28 22:56:49.000000000 +0100
501 +++ newlib/libc/machine/x86_64/memset.S 2008-07-11 15:16:59.098320000 +0100
502 @@ -40,22 +40,22 @@
504 .p2align 4
505 loop:
506 - movntiq rax, (rdi)
507 - movntiq rax, 8 (rdi)
508 - movntiq rax, 16 (rdi)
509 - movntiq rax, 24 (rdi)
510 - movntiq rax, 32 (rdi)
511 - movntiq rax, 40 (rdi)
512 - movntiq rax, 48 (rdi)
513 - movntiq rax, 56 (rdi)
514 - movntiq rax, 64 (rdi)
515 - movntiq rax, 72 (rdi)
516 - movntiq rax, 80 (rdi)
517 - movntiq rax, 88 (rdi)
518 - movntiq rax, 96 (rdi)
519 - movntiq rax, 104 (rdi)
520 - movntiq rax, 112 (rdi)
521 - movntiq rax, 120 (rdi)
522 + movnti rax, (rdi)
523 + movnti rax, 8 (rdi)
524 + movnti rax, 16 (rdi)
525 + movnti rax, 24 (rdi)
526 + movnti rax, 32 (rdi)
527 + movnti rax, 40 (rdi)
528 + movnti rax, 48 (rdi)
529 + movnti rax, 56 (rdi)
530 + movnti rax, 64 (rdi)
531 + movnti rax, 72 (rdi)
532 + movnti rax, 80 (rdi)
533 + movnti rax, 88 (rdi)
534 + movnti rax, 96 (rdi)
535 + movnti rax, 104 (rdi)
536 + movnti rax, 112 (rdi)
537 + movnti rax, 120 (rdi)
539 leaq 128 (rdi), rdi
541 --- newlib/libm/machine/i386/i386mach.h.orig 2008-07-11 15:30:37.367227000 +0100
542 +++ newlib/libm/machine/i386/i386mach.h 2008-07-11 15:30:55.232337000 +0100
543 @@ -27,46 +27,46 @@
545 #define REG(x) CONCAT1(__REG_PREFIX__, x)
547 -#define eax REG(eax)
548 -#define ebx REG(ebx)
549 -#define ecx REG(ecx)
550 -#define edx REG(edx)
551 -#define esi REG(esi)
552 -#define edi REG(edi)
553 -#define ebp REG(ebp)
554 -#define esp REG(esp)
555 -
556 -#define st0 REG(st)
557 -#define st1 REG(st(1))
558 -#define st2 REG(st(2))
559 -#define st3 REG(st(3))
560 -#define st4 REG(st(4))
561 -#define st5 REG(st(5))
562 -#define st6 REG(st(6))
563 -#define st7 REG(st(7))
564 -
565 -#define ax REG(ax)
566 -#define bx REG(bx)
567 -#define cx REG(cx)
568 -#define dx REG(dx)
569 -
570 -#define ah REG(ah)
571 -#define bh REG(bh)
572 -#define ch REG(ch)
573 -#define dh REG(dh)
574 -
575 -#define al REG(al)
576 -#define bl REG(bl)
577 -#define cl REG(cl)
578 -#define dl REG(dl)
579 -
580 -#define mm1 REG(mm1)
581 -#define mm2 REG(mm2)
582 -#define mm3 REG(mm3)
583 -#define mm4 REG(mm4)
584 -#define mm5 REG(mm5)
585 -#define mm6 REG(mm6)
586 -#define mm7 REG(mm7)
587 +#define eax %eax
588 +#define ebx %ebx
589 +#define ecx %ecx
590 +#define edx %edx
591 +#define esi %esi
592 +#define edi %edi
593 +#define ebp %ebp
594 +#define esp %esp
595 +
596 +#define st0 %st
597 +#define st1 %st(1)
598 +#define st2 %st(2)
599 +#define st3 %st(3)
600 +#define st4 %st(4)
601 +#define st5 %st(5)
602 +#define st6 %st(6)
603 +#define st7 %st(7)
604 +
605 +#define ax %ax
606 +#define bx %bx
607 +#define cx %cx
608 +#define dx %dx
609 +
610 +#define ah %ah
611 +#define bh %bh
612 +#define ch %ch
613 +#define dh %dh
614 +
615 +#define al %al
616 +#define bl %bl
617 +#define cl %cl
618 +#define dl %dl
619 +
620 +#define mm1 %mm1
621 +#define mm2 %mm2
622 +#define mm3 %mm3
623 +#define mm4 %mm4
624 +#define mm5 %mm5
625 +#define mm6 %mm6
626 +#define mm7 %mm7
628 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION
629 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
632 We want to have a 64bit offsets libc even on 32bit platforms.
634 --- ./newlib/configure.host.orig 2008-08-07 16:01:17.801946000 +0100
635 +++ ./newlib/configure.host 2008-08-07 16:01:34.181064000 +0100
636 @@ -317,6 +317,8 @@
637 oext=lo
638 lpfx=
639 aext=la ;;
640 + i[34567]86-xen-elf)
641 + stdio64_dir=stdio64 ;;
642 *) ;; #shared library not supported for ${host}
643 esac
645 --- newlib/libc/include/sys/_types.h.orig 2008-08-07 15:22:44.925008000 +0100
646 +++ newlib/libc/include/sys/_types.h 2008-08-07 15:22:50.824044000 +0100
647 @@ -13,8 +13,12 @@
648 #include <sys/lock.h>
650 #ifndef __off_t_defined
651 +#ifdef __MINIOS__
652 +typedef long long _off_t;
653 +#else
654 typedef long _off_t;
655 #endif
656 +#endif
658 #if defined(__rtems__)
659 /* device numbers are 32-bit major and and 32-bit minor */
660 --- ./newlib/libc/include/sys/config.h.orig 2008-08-07 14:43:25.915866000 +0100
661 +++ ./newlib/libc/include/sys/config.h 2008-08-07 14:44:13.508154000 +0100
662 @@ -69,6 +69,10 @@
663 /* we use some glibc header files so turn on glibc large file feature */
664 #define _LARGEFILE64_SOURCE 1
665 #endif
666 +#ifdef __MINIOS__
667 +#define __LARGE64_FILES 1
668 +#define _LARGEFILE64_SOURCE 1
669 +#endif
670 #endif
672 #ifndef __DYNAMIC_REENT__
673 --- ./newlib/libc/include/sys/_default_fcntl.h.orig 2008-08-07 15:08:22.377836000 +0100
674 +++ ./newlib/libc/include/sys/_default_fcntl.h 2008-08-07 15:08:31.651890000 +0100
675 @@ -170,7 +170,11 @@
676 /* Provide _<systemcall> prototypes for functions provided by some versions
677 of newlib. */
678 #ifdef _COMPILING_NEWLIB
679 -extern int _open _PARAMS ((const char *, int, ...));
680 +extern int _open _PARAMS ((const char *, int, ...))
681 +#ifdef __MINIOS__
682 + asm("open64")
683 +#endif
684 + ;
685 extern int _fcntl _PARAMS ((int, int, ...));
686 #ifdef __LARGE64_FILES
687 extern int _open64 _PARAMS ((const char *, int, ...));
688 --- ./newlib/libc/include/sys/unistd.h.orig 2008-08-07 15:09:36.449280000 +0100
689 +++ ./newlib/libc/include/sys/unistd.h 2008-08-07 15:09:51.210370000 +0100
690 @@ -101,7 +101,11 @@
691 int _EXFUN(link, (const char *__path1, const char *__path2 ));
692 int _EXFUN(nice, (int __nice_value ));
693 #if !defined(__INSIDE_CYGWIN__)
694 -off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
695 +off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ))
696 +#ifdef __MINIOS__
697 + asm("lseek64")
698 +#endif
699 + ;
700 #endif
701 #if defined(__SPU__)
702 #define F_ULOCK 0
703 --- ./newlib/libc/include/sys/stat.h.orig 2008-08-07 16:08:50.495116000 +0100
704 +++ ./newlib/libc/include/sys/stat.h 2008-08-07 16:10:21.799753000 +0100
705 @@ -49,6 +49,9 @@
706 long st_spare4[2];
707 #endif
708 };
709 +#ifdef __MINIOS__
710 +#define stat64 stat
711 +#endif
712 #endif
714 #define _IFMT 0170000 /* type of file */
715 @@ -132,7 +135,11 @@
716 /* Provide prototypes for most of the _<systemcall> names that are
717 provided in newlib for some compilers. */
718 #ifdef _COMPILING_NEWLIB
719 -int _EXFUN(_fstat,( int __fd, struct stat *__sbuf ));
720 +int _EXFUN(_fstat,( int __fd, struct stat *__sbuf ))
721 +#ifdef __MINIOS__
722 + asm("fstat64")
723 +#endif
724 + ;
725 int _EXFUN(_stat,( const char *__path, struct stat *__sbuf ));
726 #ifdef __LARGE64_FILES
727 struct stat64;
728 --- ./newlib/libc/include/_syslist.h.orig 2008-08-07 16:24:19.122605000 +0100
729 +++ ./newlib/libc/include/_syslist.h 2008-08-07 16:24:21.548628000 +0100
730 @@ -14,6 +14,7 @@
731 #define _kill kill
732 #define _link link
733 #define _lseek lseek
734 +#define _lseek64 lseek64
735 #define _open open
736 #define _read read
737 #define _sbrk sbrk
738 --- newlib/libc/include/reent.h.orig 2008-08-07 16:28:49.846502000 +0100
739 +++ newlib/libc/include/reent.h 2008-08-07 16:29:02.096586000 +0100
740 @@ -87,6 +87,9 @@
741 #if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB)
742 #define stat64 __stat64
743 #endif
744 +#if defined(__MINIOS__)
745 +#define stat64 stat
746 +#endif
748 struct stat64;