mirror of
https://github.com/partic2/libffi
synced 2026-11-09 17:47:19 +00:00
Merge remote branch 'upstream/master'
This commit is contained in:
+6
-4
@@ -1,7 +1,9 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
|
||||
Copyright (c) 2011 Plausible Labs Cooperative, Inc.
|
||||
|
||||
ffi.c - Copyright (c) 2011 Plausible Labs Cooperative, Inc.
|
||||
Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 2011 Free Software Foundation
|
||||
Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
|
||||
|
||||
ARM Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -582,7 +584,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
||||
else if (cif->abi == FFI_VFP)
|
||||
closure_func = &ffi_closure_VFP;
|
||||
else
|
||||
FFI_ASSERT (0);
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
#if FFI_EXEC_TRAMPOLINE_TABLE
|
||||
void **config = FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc);
|
||||
|
||||
+4
-2
@@ -1,5 +1,6 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
|
||||
ffi.c - Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
|
||||
|
||||
AVR32 Foreign Function Interface
|
||||
|
||||
@@ -394,7 +395,8 @@ ffi_status ffi_prep_closure_loc(ffi_closure* closure, ffi_cif* cif,
|
||||
void (*fun)(ffi_cif*, void*, void**, void*), void *user_data,
|
||||
void *codeloc)
|
||||
{
|
||||
FFI_ASSERT(cif->abi == FFI_SYSV);
|
||||
if (cif->abi != FFI_SYSV)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
unsigned char *__tramp = (unsigned char*)(&closure->tramp[0]);
|
||||
unsigned int __fun = (unsigned int)(&ffi_closure_SYSV);
|
||||
|
||||
+6
-4
@@ -1,7 +1,8 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 1998, 2007, 2008 Red Hat, Inc.
|
||||
Copyright (c) 2000 Hewlett Packard Company
|
||||
|
||||
ffi.c - Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 2000 Hewlett Packard Company
|
||||
Copyright (c) 1998, 2007, 2008 Red Hat, Inc.
|
||||
|
||||
IA64 Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -425,7 +426,8 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
||||
struct ffi_ia64_trampoline_struct *tramp;
|
||||
struct ia64_fd *fd;
|
||||
|
||||
FFI_ASSERT (cif->abi == FFI_UNIX);
|
||||
if (cif->abi != FFI_UNIX)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
tramp = (struct ffi_ia64_trampoline_struct *)closure->tramp;
|
||||
fd = (struct ia64_fd *)(void *)ffi_closure_unix;
|
||||
|
||||
+7
-4
@@ -1,6 +1,7 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 1996, 2007, 2008 Red Hat, Inc.
|
||||
Copyright (c) 2008 David Daney
|
||||
ffi.c - Copyright (c) 2011 Anthony Green
|
||||
Copyright (c) 2008 David Daney
|
||||
Copyright (c) 1996, 2007, 2008, 2011 Red Hat, Inc.
|
||||
|
||||
MIPS Foreign Function Interface
|
||||
|
||||
@@ -662,10 +663,12 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
||||
char *clear_location = (char *) codeloc;
|
||||
|
||||
#if defined(FFI_MIPS_O32)
|
||||
FFI_ASSERT(cif->abi == FFI_O32 || cif->abi == FFI_O32_SOFT_FLOAT);
|
||||
if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT)
|
||||
return FFI_BAD_ABI;
|
||||
fn = ffi_closure_O32;
|
||||
#else /* FFI_MIPS_N32 */
|
||||
FFI_ASSERT(cif->abi == FFI_N32 || cif->abi == FFI_N64);
|
||||
if (cif->abi != FFI_N32 && cif->abi != FFI_N64)
|
||||
return FFI_BAD_ABI;
|
||||
fn = ffi_closure_N32;
|
||||
#endif /* FFI_MIPS_O32 */
|
||||
|
||||
|
||||
+7
-4
@@ -1,9 +1,11 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - (c) 2003-2004 Randolph Chung <tausq@debian.org>
|
||||
ffi.c - (c) 2011 Anthony Green
|
||||
(c) 2008 Red Hat, Inc.
|
||||
|
||||
(c) 2006 Free Software Foundation, Inc.
|
||||
(c) 2003-2004 Randolph Chung <tausq@debian.org>
|
||||
|
||||
HPPA Foreign Function Interface
|
||||
HP-UX PA ABI support (c) 2006 Free Software Foundation, Inc.
|
||||
HP-UX PA ABI support
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
@@ -633,7 +635,8 @@ ffi_prep_closure_loc (ffi_closure* closure,
|
||||
UINT32 *tmp;
|
||||
#endif
|
||||
|
||||
FFI_ASSERT (cif->abi == FFI_PA32);
|
||||
if (cif->abi != FFI_PA32)
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
/* Make a small trampoline that will branch to our
|
||||
handler function. Use PC-relative addressing. */
|
||||
|
||||
+8
-5
@@ -1,7 +1,8 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 1998 Geoffrey Keating
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc
|
||||
Copyright (C) 2008 Red Hat, Inc
|
||||
ffi.c - Copyright (C) 2011 Anthony Green
|
||||
Copyright (C) 2008 Red Hat, Inc
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc
|
||||
Copyright (c) 1998 Geoffrey Keating
|
||||
|
||||
PowerPC Foreign Function Interface
|
||||
|
||||
@@ -949,14 +950,16 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
||||
#ifdef POWERPC64
|
||||
void **tramp = (void **) &closure->tramp[0];
|
||||
|
||||
FFI_ASSERT (cif->abi == FFI_LINUX64);
|
||||
if (cif->abi != FFI_LINUX64)
|
||||
return FFI_BAD_ABI;
|
||||
/* Copy function address and TOC from ffi_closure_LINUX64. */
|
||||
memcpy (tramp, (char *) ffi_closure_LINUX64, 16);
|
||||
tramp[2] = codeloc;
|
||||
#else
|
||||
unsigned int *tramp;
|
||||
|
||||
FFI_ASSERT (cif->abi == FFI_GCC_SYSV || cif->abi == FFI_SYSV);
|
||||
if (! (cif->abi == FFI_GCC_SYSV || cif->abi == FFI_SYSV))
|
||||
return FFI_BAD_ABI;
|
||||
|
||||
tramp = (unsigned int *) &closure->tramp[0];
|
||||
tramp[0] = 0x7c0802a6; /* mflr r0 */
|
||||
|
||||
+4
-10
@@ -27,12 +27,6 @@
|
||||
#include <ffi_common.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define __builtin_expect(x, expected_value) (x)
|
||||
#endif
|
||||
#define LIKELY(x) __builtin_expect((x),1)
|
||||
#define UNLIKELY(x) __builtin_expect((x),1)
|
||||
|
||||
/* Round up to FFI_SIZEOF_ARG. */
|
||||
|
||||
#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
|
||||
@@ -44,11 +38,11 @@ static ffi_status initialize_aggregate(ffi_type *arg)
|
||||
{
|
||||
ffi_type **ptr;
|
||||
|
||||
FFI_ASSERT(arg != NULL);
|
||||
if (UNLIKELY(arg == NULL || arg->elements == NULL))
|
||||
return FFI_BAD_TYPEDEF;
|
||||
|
||||
FFI_ASSERT(arg->elements != NULL);
|
||||
FFI_ASSERT(arg->size == 0);
|
||||
FFI_ASSERT(arg->alignment == 0);
|
||||
arg->size = 0;
|
||||
arg->alignment = 0;
|
||||
|
||||
ptr = &(arg->elements[0]);
|
||||
|
||||
|
||||
+3
-8
@@ -1,7 +1,8 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi64.c - Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
|
||||
ffi64.c - Copyright (c) 20011 Anthony Green
|
||||
Copyright (c) 2008, 2010 Red Hat, Inc.
|
||||
|
||||
Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
|
||||
|
||||
x86-64 Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -28,12 +29,6 @@
|
||||
#include <ffi.h>
|
||||
#include <ffi_common.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define __builtin_expect(x, expected_value) (x)
|
||||
#endif
|
||||
#define LIKELY(x) __builtin_expect((x),1)
|
||||
#define UNLIKELY(x) __builtin_expect((x),1)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user