Commit 5435965f9015ce40584c98d3816c3d05e7de1d21

green 2001-04-23T00:32:03

* include/ffi_common.h: Delete, after moving contents to... * include/ffi_private.h: Subsume contents of ffi_common.h. * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h. * include/Makefile.in: Rebuilt. * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c, ia64/ffi.c: Include ffi_private.h, not ffi_common.h. * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h. * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include ffi_common.h. * debug.c: Include ffi_private.h instead of ffi_common.h. * mips/ffi.c (calc_n32_struct_flags): Make static. (FIX_ARGP): Remove call to debugging routine ffi_stop_here. * mips/n32.S: Include ffi_private.h. * mips/o32.S: Include ffi_private.h.

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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index b58d0fb..8f42ec0 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,22 @@
+Sun Apr 22 15:50:08 2001  Anthony Green  <green@redhat.com>
+
+	* include/ffi_common.h: Delete, after moving contents to...
+	* include/ffi_private.h: Subsume contents of ffi_common.h.
+	* include/Makefile.am (noinst_HEADERS): Remove ffi_common.h.
+	* include/Makefile.in: Rebuilt.
+	* arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c,
+	ia64/ffi.c: Include ffi_private.h, not ffi_common.h.
+	* alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h.
+	* types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include
+	ffi_common.h.
+	* debug.c: Include ffi_private.h instead of ffi_common.h.
+
+	* mips/ffi.c (calc_n32_struct_flags): Make static.
+	(FIX_ARGP): Remove call to debugging routine ffi_stop_here.
+
+	* mips/n32.S: Include ffi_private.h.
+	* mips/o32.S: Include ffi_private.h.
+
 Sun Apr 22 12:37:44 2001  Anthony Green  <green@redhat.com>
 
 	* README: Update some comments.
diff --git a/libffi/README b/libffi/README
index 05b0046..7dc1fa5 100644
--- a/libffi/README
+++ b/libffi/README
@@ -476,7 +476,7 @@ History
 Authors & Credits
 =================
 
-libffi was written by Anthony Green <green@cygnus.com>.
+libffi was written by Anthony Green <green@redhat.com>.
 
 Portions of libffi were derived from Gianni Mariani's free gencall
 library for Silicon Graphics machines.
@@ -488,7 +488,7 @@ The initial Sparc port was derived from code contributed by the fine
 folks at Visible Decisions Inc.  Further enhancements were made by
 Gordon Irlam while at Cygnus Solutions.
 
-The Alpha port was written by Richard Henderson at Cygnus Solutions.
+The Alpha port was written by Richard Henderson at Cygnus Solutions/Red Hat.
 
 Andreas Schwab ported libffi to m68k Linux and provided a number of
 bug fixes.
diff --git a/libffi/alpha/ffi.c b/libffi/alpha/ffi.c
index 94bd6bc..30d30f0 100644
--- a/libffi/alpha/ffi.c
+++ b/libffi/alpha/ffi.c
@@ -25,7 +25,6 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 
 #include <stdlib.h>
 
diff --git a/libffi/arm/ffi.c b/libffi/arm/ffi.c
index 0ede742..c4e8faf 100644
--- a/libffi/arm/ffi.c
+++ b/libffi/arm/ffi.c
@@ -24,7 +24,7 @@
    ----------------------------------------------------------------------- */
 
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
 
 #include <stdlib.h>
 
diff --git a/libffi/debug.c b/libffi/debug.c
index 17196ba..4241659 100644
--- a/libffi/debug.c
+++ b/libffi/debug.c
@@ -22,7 +22,7 @@
    ----------------------------------------------------------------------- */
 
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
 #include <stdlib.h>
 #include <stdio.h>
 
diff --git a/libffi/ia64/ffi.c b/libffi/ia64/ffi.c
index bb4fbb7..c84f86f 100644
--- a/libffi/ia64/ffi.c
+++ b/libffi/ia64/ffi.c
@@ -25,7 +25,7 @@
    ----------------------------------------------------------------------- */
 
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
 
 #include <stdlib.h>
 
diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am
index 4307727..525984f 100644
--- a/libffi/include/Makefile.am
+++ b/libffi/include/Makefile.am
@@ -2,5 +2,5 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-noinst_HEADERS=ffi_common.h ffi_private.h
+noinst_HEADERS=ffi_private.h
 include_HEADERS=ffi.h
diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in
index 4223d62..853774d 100644
--- a/libffi/include/Makefile.in
+++ b/libffi/include/Makefile.in
@@ -81,7 +81,7 @@ libffi_basedir = @libffi_basedir@
 
 AUTOMAKE_OPTIONS = foreign
 
-noinst_HEADERS = ffi_common.h ffi_private.h
+noinst_HEADERS = ffi_private.h
 include_HEADERS = ffi.h
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../fficonfig.h
diff --git a/libffi/include/ffi_common.h b/libffi/include/ffi_common.h
deleted file mode 100644
index 2120754..0000000
--- a/libffi/include/ffi_common.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi_common.h - Copyright (c) 1996  Red Hat, Inc.
-
-   $Id: ffi_common.h,v 1.3 2001/04/09 00:58:37 green Exp $
-
-   Common internal definitions and macros. Only necessary for building
-   libffi.
-   ----------------------------------------------------------------------- */
-
-#ifndef FFI_COMMON_H
-#define FFI_COMMON_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Do not move this. Some versions of AIX are very picky about where
-   this is positioned. */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #pragma alloca
-#  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#   endif
-#  endif
-# endif
-#endif
-
-/* Check for the existence of memcpy. */
-#if STDC_HEADERS
-# include <string.h>
-#else
-# ifndef HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE (!FALSE)
-#endif
-
-#ifndef __cplusplus
-/* bool is a keyword in C++ */
-/*@-cppnames@*/
-typedef int bool;
-/*@=cppnames@*/
-#endif
-
-#ifdef FFI_DEBUG
-
-/* Debugging functions */
-/*@exits@*/ int ffi_assert(/*@temp@*/ char *file, int line);
-void ffi_stop_here(void);
-bool ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a);
-
-#define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__))
-
-#else
-
-#define FFI_ASSERT(x) 
-
-#endif
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
-
-/* Extended cif, used in callback from assembly routine */
-typedef struct
-{
-  /*@dependent@*/ ffi_cif *cif;
-  /*@dependent@*/ void *rvalue;
-  /*@dependent@*/ void **avalue;
-} extended_cif;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/libffi/include/ffi_private.h b/libffi/include/ffi_private.h
index 59644b9..d3af43b 100644
--- a/libffi/include/ffi_private.h
+++ b/libffi/include/ffi_private.h
@@ -119,3 +119,50 @@
 #define SIZEOF_ARG SIZEOF_VOID_P
 #endif
 
+#ifndef __ASSEMBLER__
+/* This part of the private header file is only for C code.  */
+
+/* Check for the existence of memcpy. */
+#if STDC_HEADERS
+# include <string.h>
+#else
+# ifndef HAVE_MEMCPY
+#  define memcpy(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef TRUE
+#define TRUE (!FALSE)
+#endif
+
+#ifndef __cplusplus
+/* bool is a keyword in C++ */
+typedef int bool;
+#endif
+
+#ifdef FFI_DEBUG
+/* Debugging functions */
+void ffi_stop_here(void);
+bool ffi_type_test(ffi_type *a);
+#define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__))
+#else
+#define FFI_ASSERT(x) 
+#endif
+
+/* Perform machine dependent cif processing */
+ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
+
+/* Extended cif, used in callback from assembly routine */
+typedef struct
+{
+  ffi_cif *cif;
+  void *rvalue;
+  void **avalue;
+} extended_cif;
+
+#endif /* __ASSEMBLER__ */
+
diff --git a/libffi/java_raw_api.c b/libffi/java_raw_api.c
index 9d82e4b..1b00cd3 100644
--- a/libffi/java_raw_api.c
+++ b/libffi/java_raw_api.c
@@ -34,7 +34,6 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 
 #if !defined(NO_JAVA_RAW_API) && !defined(FFI_NO_RAW_API)
 
diff --git a/libffi/m68k/ffi.c b/libffi/m68k/ffi.c
index c5d9507..e9686f4 100644
--- a/libffi/m68k/ffi.c
+++ b/libffi/m68k/ffi.c
@@ -5,7 +5,7 @@
    ----------------------------------------------------------------------- */
 
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
 
 #include <stdlib.h>
 
diff --git a/libffi/mips/ffi.c b/libffi/mips/ffi.c
index fb733b2..9709819 100644
--- a/libffi/mips/ffi.c
+++ b/libffi/mips/ffi.c
@@ -24,7 +24,7 @@
    ----------------------------------------------------------------------- */
 
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
 #include <mips/mips.h>
 
 #include <stdlib.h>
@@ -35,7 +35,6 @@ FFI_ASSERT(argp <= &stack[bytes]); \
 if (argp == &stack[bytes]) \
 { \
   argp = stack; \
-  ffi_stop_here(); \
 }
 #else
 #define FIX_ARGP 
@@ -194,7 +193,7 @@ static void ffi_prep_args(char *stack,
    passed in an integer register". This code traverses structure
    definitions and generates the appropriate flags. */
 
-unsigned calc_n32_struct_flags(ffi_type *arg, unsigned *shift)
+static unsigned calc_n32_struct_flags(ffi_type *arg, unsigned *shift)
 {
   unsigned flags = 0;
   unsigned index = 0;
diff --git a/libffi/mips/n32.S b/libffi/mips/n32.S
index ee137b7..4eeef07 100644
--- a/libffi/mips/n32.S
+++ b/libffi/mips/n32.S
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
-   n32.S - Copyright (c) 1996, 1998  Cygnus Solutions
+   n32.S - Copyright (c) 1996, 1998, 2001  Red Hat, Inc.
    
    MIPS Foreign Function Interface 
 
@@ -25,6 +25,7 @@
 
 #define LIBFFI_ASM	
 #include <ffi.h>
+#include <ffi_private.h>
 #include <mips/mips.h>
 	
 /* Only build this code if we are compiling for n32 */	
diff --git a/libffi/mips/o32.S b/libffi/mips/o32.S
index 9c8bbb2..6efc8f7 100644
--- a/libffi/mips/o32.S
+++ b/libffi/mips/o32.S
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
-   o32.S - Copyright (c) 1996, 1998  Cygnus Solutions
+   o32.S - Copyright (c) 1996, 1998, 2001  Red Hat, Inc.
    
    MIPS Foreign Function Interface 
 
@@ -25,6 +25,7 @@
 
 #define LIBFFI_ASM	
 #include <ffi.h>
+#include <ffi_private.h>
 #include <mips/mips.h>
 
 /* Only build this code if we are compiling for o32 */	
diff --git a/libffi/powerpc/ffi.c b/libffi/powerpc/ffi.c
index 309848e..2042962 100644
--- a/libffi/powerpc/ffi.c
+++ b/libffi/powerpc/ffi.c
@@ -3,7 +3,7 @@
    
    PowerPC Foreign Function Interface 
 
-   $Id: ffi.c,v 1.1 2001/04/22 18:28:36 green Exp $
+   $Id: ffi.c,v 1.2 2001/04/23 00:32:03 green Exp $
 
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@
    ----------------------------------------------------------------------- */
 
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
 
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/libffi/prep_cif.c b/libffi/prep_cif.c
index 5e97a18..1073303 100644
--- a/libffi/prep_cif.c
+++ b/libffi/prep_cif.c
@@ -23,7 +23,6 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 #include <stdlib.h>
 
 
diff --git a/libffi/raw_api.c b/libffi/raw_api.c
index 4830709..c41cf2e 100644
--- a/libffi/raw_api.c
+++ b/libffi/raw_api.c
@@ -27,7 +27,6 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 
 #if !FFI_NO_RAW_API
 
diff --git a/libffi/s390/ffi.c b/libffi/s390/ffi.c
index 5498883..f605152 100644
--- a/libffi/s390/ffi.c
+++ b/libffi/s390/ffi.c
@@ -28,7 +28,7 @@
 /*====================================================================*/
  
 #include <ffi.h>
-#include <ffi_common.h>
+#include <ffi_private.h>
  
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/libffi/sparc/ffi.c b/libffi/sparc/ffi.c
index 65e295b..f7d909b 100644
--- a/libffi/sparc/ffi.c
+++ b/libffi/sparc/ffi.c
@@ -25,7 +25,6 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 
 #include <stdlib.h>
 
diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp
index 58c5408..00c28d3 100644
--- a/libffi/testsuite/lib/libffi.exp
+++ b/libffi/testsuite/lib/libffi.exp
@@ -34,9 +34,9 @@ proc test_libffi {src} {
 
     $status "$testcase"
 
-    if { $status == "pass" } {
-	remote_file build delete $executable;
-    }
+#    if { $status == "pass" } {
+#	remote_file build delete $executable;
+#    }
 } 
 
 # Local Variables:
diff --git a/libffi/testsuite/libffi.call/many.c b/libffi/testsuite/libffi.call/many.c
index 01a2138..1b3d72c 100644
--- a/libffi/testsuite/libffi.call/many.c
+++ b/libffi/testsuite/libffi.call/many.c
@@ -16,7 +16,7 @@ static float many(float f1,
 		  float f12,
 		  float f13)
 {
-#if 0
+#if 1
   printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
 	 (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, 
 	 (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
@@ -60,4 +60,4 @@ main ()
       exit(0);
     else
       abort();
-  }
+}
diff --git a/libffi/types.c b/libffi/types.c
index d1eb089..9ab573d 100644
--- a/libffi/types.c
+++ b/libffi/types.c
@@ -25,7 +25,6 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 
 /* Type definitions */