Home | History | Annotate | Download | only in include
      1 /* -----------------------------------------------------------------*-C-*-
      2    ppc-ffitarget.h - Copyright (c) 1996-2003  Red Hat, Inc.
      3    Target configuration macros for PowerPC.
      4 
      5    Permission is hereby granted, free of charge, to any person obtaining
      6    a copy of this software and associated documentation files (the
      7    ``Software''), to deal in the Software without restriction, including
      8    without limitation the rights to use, copy, modify, merge, publish,
      9    distribute, sublicense, and/or sell copies of the Software, and to
     10    permit persons to whom the Software is furnished to do so, subject to
     11    the following conditions:
     12 
     13    The above copyright notice and this permission notice shall be included
     14    in all copies or substantial portions of the Software.
     15 
     16    THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
     17    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     18    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     19    IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
     20    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     21    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     22    OTHER DEALINGS IN THE SOFTWARE.
     23    ----------------------------------------------------------------------- */
     24 
     25 #ifndef LIBFFI_TARGET_H
     26 #define LIBFFI_TARGET_H
     27 
     28 /* ---- System specific configurations ----------------------------------- */
     29 
     30 #if (defined(POWERPC) && defined(__powerpc64__)) ||		\
     31 	(defined(POWERPC_DARWIN) && defined(__ppc64__))
     32 #define POWERPC64
     33 #endif
     34 
     35 #ifndef LIBFFI_ASM
     36 
     37 typedef unsigned long	ffi_arg;
     38 typedef signed long		ffi_sarg;
     39 
     40 typedef enum ffi_abi {
     41 	FFI_FIRST_ABI = 0,
     42 
     43 #ifdef POWERPC
     44 	FFI_SYSV,
     45 	FFI_GCC_SYSV,
     46 	FFI_LINUX64,
     47 #	ifdef POWERPC64
     48 	FFI_DEFAULT_ABI = FFI_LINUX64,
     49 #	else
     50 	FFI_DEFAULT_ABI = FFI_GCC_SYSV,
     51 #	endif
     52 #endif
     53 
     54 #ifdef POWERPC_AIX
     55 	FFI_AIX,
     56 	FFI_DARWIN,
     57 	FFI_DEFAULT_ABI = FFI_AIX,
     58 #endif
     59 
     60 #ifdef POWERPC_DARWIN
     61 	FFI_AIX,
     62 	FFI_DARWIN,
     63 	FFI_DEFAULT_ABI = FFI_DARWIN,
     64 #endif
     65 
     66 #ifdef POWERPC_FREEBSD
     67 	FFI_SYSV,
     68 	FFI_GCC_SYSV,
     69 	FFI_LINUX64,
     70 	FFI_DEFAULT_ABI = FFI_SYSV,
     71 #endif
     72 
     73 	FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
     74 } ffi_abi;
     75 
     76 #endif	// #ifndef LIBFFI_ASM
     77 
     78 /* ---- Definitions for closures ----------------------------------------- */
     79 
     80 #define FFI_CLOSURES 1
     81 #define FFI_NATIVE_RAW_API 0
     82 
     83 /* Needed for FFI_SYSV small structure returns.  */
     84 #define FFI_SYSV_TYPE_SMALL_STRUCT  (FFI_TYPE_LAST)
     85 
     86 #if defined(POWERPC64) /*|| defined(POWERPC_AIX)*/
     87 #	define FFI_TRAMPOLINE_SIZE 48
     88 #elif defined(POWERPC_AIX)
     89 #	define FFI_TRAMPOLINE_SIZE 24
     90 #else
     91 #	define FFI_TRAMPOLINE_SIZE 40
     92 #endif
     93 
     94 #ifndef LIBFFI_ASM
     95 #	if defined(POWERPC_DARWIN) || defined(POWERPC_AIX)
     96 typedef struct ffi_aix_trampoline_struct {
     97 	void*	code_pointer;	/* Pointer to ffi_closure_ASM */
     98 	void*	toc;			/* TOC */
     99 	void*	static_chain;	/* Pointer to closure */
    100 } ffi_aix_trampoline_struct;
    101 #	endif
    102 #endif	// #ifndef LIBFFI_ASM
    103 
    104 #endif	// #ifndef LIBFFI_TARGET_H