Annotation of /trunk/nspr/patches/nspr-4.4.1-amd64.patch
Parent Directory | Revision Log
Revision 153 -
(hide annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 7713 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 7713 byte(s)
-import
1 | niro | 153 | diff -ruN mozilla.old/nsprpub/configure mozilla/nsprpub/configure |
2 | --- mozilla.old/nsprpub/configure 2003-05-19 15:05:42.000000000 -0400 | ||
3 | +++ mozilla/nsprpub/configure 2003-09-27 16:20:55.085325144 -0400 | ||
4 | @@ -3729,6 +3729,9 @@ | ||
5 | ia64) | ||
6 | PR_MD_ASFILES=os_Linux_ia64.s | ||
7 | ;; | ||
8 | + x86_64) | ||
9 | + PR_MD_ASFILES=os_Linux_x86_64.s | ||
10 | + ;; | ||
11 | m68k) | ||
12 | CFLAGS="$CFLAGS -m68020-60" | ||
13 | CXXFLAGS="$CXXFLAGS -m68020-60" | ||
14 | diff -ruN mozilla.old/nsprpub/configure.in mozilla/nsprpub/configure.in | ||
15 | --- mozilla.old/nsprpub/configure.in 2003-05-19 15:05:48.000000000 -0400 | ||
16 | +++ mozilla/nsprpub/configure.in 2003-09-27 16:20:55.077326360 -0400 | ||
17 | @@ -1218,6 +1218,9 @@ | ||
18 | ia64) | ||
19 | PR_MD_ASFILES=os_Linux_ia64.s | ||
20 | ;; | ||
21 | + x86_64) | ||
22 | + PR_MD_ASFILES=os_Linux_x86_64.s | ||
23 | + ;; | ||
24 | m68k) | ||
25 | CFLAGS="$CFLAGS -m68020-60" | ||
26 | CXXFLAGS="$CXXFLAGS -m68020-60" | ||
27 | diff -ruN mozilla.old/nsprpub/pr/include/md/_linux.cfg mozilla/nsprpub/pr/include/md/_linux.cfg | ||
28 | --- mozilla.old/nsprpub/pr/include/md/_linux.cfg 2003-02-26 18:53:38.000000000 -0500 | ||
29 | +++ mozilla/nsprpub/pr/include/md/_linux.cfg 2003-09-27 16:20:55.053330008 -0400 | ||
30 | @@ -182,6 +182,52 @@ | ||
31 | #define PR_BYTES_PER_WORD_LOG2 3 | ||
32 | #define PR_BYTES_PER_DWORD_LOG2 3 | ||
33 | |||
34 | +#elif defined(__x86_64__) | ||
35 | + | ||
36 | +#define IS_LITTLE_ENDIAN 1 | ||
37 | +#undef IS_BIG_ENDIAN | ||
38 | +#define IS_64 | ||
39 | + | ||
40 | +#define PR_BYTES_PER_BYTE 1 | ||
41 | +#define PR_BYTES_PER_SHORT 2 | ||
42 | +#define PR_BYTES_PER_INT 4 | ||
43 | +#define PR_BYTES_PER_INT64 8 | ||
44 | +#define PR_BYTES_PER_LONG 8 | ||
45 | +#define PR_BYTES_PER_FLOAT 4 | ||
46 | +#define PR_BYTES_PER_DOUBLE 8 | ||
47 | +#define PR_BYTES_PER_WORD 8 | ||
48 | +#define PR_BYTES_PER_DWORD 8 | ||
49 | + | ||
50 | +#define PR_BITS_PER_BYTE 8 | ||
51 | +#define PR_BITS_PER_SHORT 16 | ||
52 | +#define PR_BITS_PER_INT 32 | ||
53 | +#define PR_BITS_PER_INT64 64 | ||
54 | +#define PR_BITS_PER_LONG 64 | ||
55 | +#define PR_BITS_PER_FLOAT 32 | ||
56 | +#define PR_BITS_PER_DOUBLE 64 | ||
57 | +#define PR_BITS_PER_WORD 64 | ||
58 | + | ||
59 | +#define PR_BITS_PER_BYTE_LOG2 3 | ||
60 | +#define PR_BITS_PER_SHORT_LOG2 4 | ||
61 | +#define PR_BITS_PER_INT_LOG2 5 | ||
62 | +#define PR_BITS_PER_INT64_LOG2 6 | ||
63 | +#define PR_BITS_PER_LONG_LOG2 6 | ||
64 | +#define PR_BITS_PER_FLOAT_LOG2 5 | ||
65 | +#define PR_BITS_PER_DOUBLE_LOG2 6 | ||
66 | +#define PR_BITS_PER_WORD_LOG2 6 | ||
67 | + | ||
68 | +#define PR_ALIGN_OF_SHORT 2 | ||
69 | +#define PR_ALIGN_OF_INT 4 | ||
70 | +#define PR_ALIGN_OF_LONG 8 | ||
71 | +#define PR_ALIGN_OF_INT64 8 | ||
72 | +#define PR_ALIGN_OF_FLOAT 4 | ||
73 | +#define PR_ALIGN_OF_DOUBLE 8 | ||
74 | +#define PR_ALIGN_OF_POINTER 8 | ||
75 | +#define PR_ALIGN_OF_WORD 8 | ||
76 | + | ||
77 | +#define PR_BYTES_PER_WORD_LOG2 3 | ||
78 | +#define PR_BYTES_PER_DWORD_LOG2 3 | ||
79 | + | ||
80 | #elif defined(__mc68000__) | ||
81 | |||
82 | #undef IS_LITTLE_ENDIAN | ||
83 | diff -ruN mozilla.old/nsprpub/pr/include/md/_linux.h mozilla/nsprpub/pr/include/md/_linux.h | ||
84 | --- mozilla.old/nsprpub/pr/include/md/_linux.h 2003-02-26 18:53:39.000000000 -0500 | ||
85 | +++ mozilla/nsprpub/pr/include/md/_linux.h 2003-09-27 16:20:55.053330008 -0400 | ||
86 | @@ -49,6 +49,8 @@ | ||
87 | #define _PR_SI_ARCHITECTURE "alpha" | ||
88 | #elif defined(__ia64__) | ||
89 | #define _PR_SI_ARCHITECTURE "ia64" | ||
90 | +#elif defined(__x86_64__) | ||
91 | +#define _PR_SI_ARCHITECTURE "x86-64" | ||
92 | #elif defined(__mc68000__) | ||
93 | #define _PR_SI_ARCHITECTURE "m68k" | ||
94 | #elif defined(__sparc__) | ||
95 | @@ -107,6 +109,19 @@ | ||
96 | #define _MD_ATOMIC_SET _PR_ia64_AtomicSet | ||
97 | #endif | ||
98 | |||
99 | +#if defined(__x86_64__) | ||
100 | +#define _PR_HAVE_ATOMIC_OPS | ||
101 | +#define _MD_INIT_ATOMIC() | ||
102 | +extern PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val); | ||
103 | +#define _MD_ATOMIC_INCREMENT _PR_x86_64_AtomicIncrement | ||
104 | +extern PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val); | ||
105 | +#define _MD_ATOMIC_DECREMENT _PR_x86_64_AtomicDecrement | ||
106 | +extern PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val); | ||
107 | +#define _MD_ATOMIC_ADD _PR_x86_64_AtomicAdd | ||
108 | +extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval); | ||
109 | +#define _MD_ATOMIC_SET _PR_x86_64_AtomicSet | ||
110 | +#endif | ||
111 | + | ||
112 | #define USE_SETJMP | ||
113 | #if defined(__GLIBC__) && __GLIBC__ >= 2 | ||
114 | #define _PR_POLL_AVAILABLE | ||
115 | diff -ruN mozilla.old/nsprpub/pr/src/io/prprf.c mozilla/nsprpub/pr/src/io/prprf.c | ||
116 | --- mozilla.old/nsprpub/pr/src/io/prprf.c 2003-02-26 18:53:42.000000000 -0500 | ||
117 | +++ mozilla/nsprpub/pr/src/io/prprf.c 2003-09-27 16:20:55.068327728 -0400 | ||
118 | @@ -51,7 +51,10 @@ | ||
119 | ** Note: on some platforms va_list is defined as an array, | ||
120 | ** and requires array notation. | ||
121 | */ | ||
122 | -#if (defined(LINUX) && defined(__powerpc__)) || \ | ||
123 | +#if (defined(LINUX) && defined(__x86_64__)) | ||
124 | +#include <stdarg.h> | ||
125 | +#define VARARGS_ASSIGN(foo, bar) __va_copy((foo), (bar)) | ||
126 | +#elif (defined(LINUX) && defined(__powerpc__)) || \ | ||
127 | (defined(LINUX) && defined(__s390__)) || \ | ||
128 | (defined(LINUX) && defined(__s390x__)) || \ | ||
129 | defined(WIN16) || defined(QNX) || \ | ||
130 | diff -ruN mozilla.old/nsprpub/pr/src/md/unix/os_Linux_x86_64.s mozilla/nsprpub/pr/src/md/unix/os_Linux_x86_64.s | ||
131 | --- mozilla.old/nsprpub/pr/src/md/unix/os_Linux_x86_64.s 1969-12-31 19:00:00.000000000 -0500 | ||
132 | +++ mozilla/nsprpub/pr/src/md/unix/os_Linux_x86_64.s 2003-09-27 16:20:55.068327728 -0400 | ||
133 | @@ -0,0 +1,91 @@ | ||
134 | +/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- | ||
135 | +/ | ||
136 | +/ The contents of this file are subject to the Mozilla Public | ||
137 | +/ License Version 1.1 (the "License"); you may not use this file | ||
138 | +/ except in compliance with the License. You may obtain a copy of | ||
139 | +/ the License at http://www.mozilla.org/MPL/ | ||
140 | +/ | ||
141 | +/ Software distributed under the License is distributed on an "AS | ||
142 | +/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | ||
143 | +/ implied. See the License for the specific language governing | ||
144 | +/ rights and limitations under the License. | ||
145 | +/ | ||
146 | +/ The Original Code is the Netscape Portable Runtime (NSPR). | ||
147 | +/ | ||
148 | +/ The Initial Developer of the Original Code is Netscape | ||
149 | +/ Communications Corporation. Portions created by Netscape are | ||
150 | +/ Copyright (C) 2000 Netscape Communications Corporation. All | ||
151 | +/ Rights Reserved. | ||
152 | +/ | ||
153 | +/ Contributor(s): | ||
154 | +/ | ||
155 | +/ Alternatively, the contents of this file may be used under the | ||
156 | +/ terms of the GNU General Public License Version 2 or later (the | ||
157 | +/ "GPL"), in which case the provisions of the GPL are applicable | ||
158 | +/ instead of those above. If you wish to allow use of your | ||
159 | +/ version of this file only under the terms of the GPL and not to | ||
160 | +/ allow others to use your version of this file under the MPL, | ||
161 | +/ indicate your decision by deleting the provisions above and | ||
162 | +/ replace them with the notice and other provisions required by | ||
163 | +/ the GPL. If you do not delete the provisions above, a recipient | ||
164 | +/ may use your version of this file under either the MPL or the | ||
165 | +/ GPL. | ||
166 | +/ | ||
167 | + | ||
168 | +/ PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val) | ||
169 | +/ | ||
170 | +/ Atomically increment the integer pointed to by 'val' and return | ||
171 | +/ the result of the increment. | ||
172 | +/ | ||
173 | + .text | ||
174 | + .globl _PR_x86_64_AtomicIncrement | ||
175 | + .align 4 | ||
176 | +_PR_x86_64_AtomicIncrement: | ||
177 | + movl $1, %eax | ||
178 | + lock | ||
179 | + xaddl %eax, (%rdi) | ||
180 | + incl %eax | ||
181 | + ret | ||
182 | + | ||
183 | +/ PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val) | ||
184 | +/ | ||
185 | +/ Atomically decrement the integer pointed to by 'val' and return | ||
186 | +/ the result of the decrement. | ||
187 | +/ | ||
188 | + .text | ||
189 | + .globl _PR_x86_64_AtomicDecrement | ||
190 | + .align 4 | ||
191 | +_PR_x86_64_AtomicDecrement: | ||
192 | + movl $-1, %eax | ||
193 | + lock | ||
194 | + xaddl %eax, (%rdi) | ||
195 | + decl %eax | ||
196 | + ret | ||
197 | + | ||
198 | +/ PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval) | ||
199 | +/ | ||
200 | +/ Atomically set the integer pointed to by 'val' to the new | ||
201 | +/ value 'newval' and return the old value. | ||
202 | + .text | ||
203 | + .globl _PR_x86_64_AtomicSet | ||
204 | + .align 4 | ||
205 | +_PR_x86_64_AtomicSet: | ||
206 | + movl %esi, %eax | ||
207 | + lock | ||
208 | + xchgl %eax, (%rdi) | ||
209 | + ret | ||
210 | + | ||
211 | +/ PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val) | ||
212 | +/ | ||
213 | +/ Atomically add 'val' to the integer pointed to by 'ptr' | ||
214 | +/ and return the result of the addition. | ||
215 | +/ | ||
216 | + .text | ||
217 | + .globl _PR_x86_64_AtomicAdd | ||
218 | + .align 4 | ||
219 | +_PR_x86_64_AtomicAdd: | ||
220 | + movl %esi, %eax | ||
221 | + lock | ||
222 | + xaddl %eax, (%rdi) | ||
223 | + addl %esi, %eax | ||
224 | + ret |