ia64/xen-unstable

view stubdom/newlib.patch @ 17588:892ae66ed82f

minios: drop volatile qualifier from some status variables
since we already use memory barriers as approriate to prevent
concurrent access with event handlers.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 06 16:35:44 2008 +0100 (2008-05-06)
parents 2424c6a3a0ed
children 54dec90cbea9
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