* 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.
This commit is contained in:
green
2001-04-23 00:32:03 +00:00
parent 6fdb7de0fe
commit 5435965f90
23 changed files with 88 additions and 118 deletions

View File

@@ -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.

View File

@@ -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.

View File

@@ -25,7 +25,6 @@
#include <ffi.h>
#include <ffi_private.h>
#include <ffi_common.h>
#include <stdlib.h>

View File

@@ -24,7 +24,7 @@
----------------------------------------------------------------------- */
#include <ffi.h>
#include <ffi_common.h>
#include <ffi_private.h>
#include <stdlib.h>

View File

@@ -22,7 +22,7 @@
----------------------------------------------------------------------- */
#include <ffi.h>
#include <ffi_common.h>
#include <ffi_private.h>
#include <stdlib.h>
#include <stdio.h>

View File

@@ -25,7 +25,7 @@
----------------------------------------------------------------------- */
#include <ffi.h>
#include <ffi_common.h>
#include <ffi_private.h>
#include <stdlib.h>

View File

@@ -2,5 +2,5 @@
AUTOMAKE_OPTIONS = foreign
noinst_HEADERS=ffi_common.h ffi_private.h
noinst_HEADERS=ffi_private.h
include_HEADERS=ffi.h

View File

@@ -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

View File

@@ -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

View File

@@ -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__ */

View File

@@ -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)

View File

@@ -5,7 +5,7 @@
----------------------------------------------------------------------- */
#include <ffi.h>
#include <ffi_common.h>
#include <ffi_private.h>
#include <stdlib.h>

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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>

View File

@@ -23,7 +23,6 @@
#include <ffi.h>
#include <ffi_private.h>
#include <ffi_common.h>
#include <stdlib.h>

View File

@@ -27,7 +27,6 @@
#include <ffi.h>
#include <ffi_private.h>
#include <ffi_common.h>
#if !FFI_NO_RAW_API

View File

@@ -28,7 +28,7 @@
/*====================================================================*/
#include <ffi.h>
#include <ffi_common.h>
#include <ffi_private.h>
#include <stdlib.h>
#include <stdio.h>

View File

@@ -25,7 +25,6 @@
#include <ffi.h>
#include <ffi_private.h>
#include <ffi_common.h>
#include <stdlib.h>

View File

@@ -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:

View File

@@ -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();
}
}

View File

@@ -25,7 +25,6 @@
#include <ffi.h>
#include <ffi_private.h>
#include <ffi_common.h>
/* Type definitions */