VirtualBox

Ignore:
Timestamp:
Mar 3, 2011 1:48:16 PM (14 years ago)
Author:
vboxsync
Message:

rem: Re-synced to svn://svn.savannah.nongnu.org/qemu/trunk@5495 (repo UUID c046a42c-6fe2-441c-8c8c-71466251a162).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/dyngen-exec.h

    r33656 r36140  
    4747#ifndef VBOX
    4848
     49#ifdef __OpenBSD__
     50#include <sys/types.h>
     51#else
    4952typedef unsigned char uint8_t;
    5053typedef unsigned short uint16_t;
    5154typedef unsigned int uint32_t;
    52 /* Linux/Sparc64 defines uint64_t */
    53 #if !(defined (__sparc_v9__) && defined(__linux__))
     55// Linux/Sparc64 defines uint64_t
     56#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__))
    5457/* XXX may be done for all 64 bits targets ? */
    55 #if defined (__x86_64__) || defined(__ia64)
     58#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__powerpc64__)
    5659typedef unsigned long uint64_t;
    5760#else
     
    6164
    6265/* if Solaris/__sun__, don't typedef int8_t, as it will be typedef'd
    63    prior to this and will cause an error in compilation, conflicting
     66   prior to this and will cause an error in compliation, conflicting
    6467   with /usr/include/sys/int_types.h, line 75 */
    6568#ifndef __sun__
     
    6972typedef signed int int32_t;
    7073// Linux/Sparc64 defines int64_t
    71 #if !(defined (__sparc_v9__) && defined(__linux__))
    72 #if defined (__x86_64__) || defined(__ia64)
     74#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__))
     75#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__powerpc64__)
    7376typedef signed long int64_t;
    7477#else
    7578typedef signed long long int64_t;
     79#endif
    7680#endif
    7781#endif
     
    114118#endif /* VBOX */
    115119
    116 #ifdef __i386__
     120#if defined(__i386__)
    117121#ifndef VBOX
    118122#define AREG0 "ebp"
     
    120124#define AREG2 "esi"
    121125#define AREG3 "edi"
    122 #else
    123 #define AREG0 "esi"
    124 #define AREG1 "edi"
    125 #endif
    126 #endif
    127 #ifdef __x86_64__
    128 #if defined(VBOX)
    129 /* Must be in sync with TCG register notion, see tcg-target.h */
    130 #endif
     126#else  /* VBOX - why are we different? */
     127# define AREG0 "esi"
     128# define AREG1 "edi"
     129#endif /* VBOX */
     130#elif defined(__x86_64__)
    131131#define AREG0 "r14"
    132132#define AREG1 "r15"
    133133#define AREG2 "r12"
    134134#define AREG3 "r13"
    135 #endif
    136 #ifdef __powerpc__
     135//#define AREG4 "rbp"
     136//#define AREG5 "rbx"
     137#elif defined(__powerpc__)
    137138#define AREG0 "r27"
    138139#define AREG1 "r24"
     
    150151#define AREG11 "r23"
    151152#endif
    152 #define USE_INT_TO_FLOAT_HELPERS
    153 #define BUGGY_GCC_DIV64
    154 #endif
    155 #ifdef __arm__
     153#elif defined(__arm__)
    156154#define AREG0 "r7"
    157155#define AREG1 "r4"
    158156#define AREG2 "r5"
    159157#define AREG3 "r6"
    160 #endif
    161 #ifdef __mips__
    162 #define AREG0 "s3"
     158#elif defined(__hppa__)
     159#define AREG0 "r17"
     160#define AREG1 "r14"
     161#define AREG2 "r15"
     162#define AREG3 "r16"
     163#elif defined(__mips__)
     164#define AREG0 "fp"
    163165#define AREG1 "s0"
    164166#define AREG2 "s1"
    165167#define AREG3 "s2"
    166 #endif
    167 #ifdef __sparc__
     168#define AREG4 "s3"
     169#define AREG5 "s4"
     170#define AREG6 "s5"
     171#define AREG7 "s6"
     172#define AREG8 "s7"
     173#elif defined(__sparc__)
    168174#ifdef HOST_SOLARIS
    169175#define AREG0 "g2"
     
    174180#else
    175181#ifdef __sparc_v9__
    176 #define AREG0 "g1"
    177 #define AREG1 "g4"
    178 #define AREG2 "g5"
    179 #define AREG3 "g7"
     182#define AREG0 "g5"
     183#define AREG1 "g6"
     184#define AREG2 "g7"
    180185#else
    181186#define AREG0 "g6"
     
    193198#endif
    194199#endif
    195 #define USE_FP_CONVERT
    196 #endif
    197 #ifdef __s390__
     200#elif defined(__s390__)
    198201#define AREG0 "r10"
    199202#define AREG1 "r7"
    200203#define AREG2 "r8"
    201204#define AREG3 "r9"
    202 #endif
    203 #ifdef __alpha__
     205#elif defined(__alpha__)
    204206/* Note $15 is the frame pointer, so anything in op-i386.c that would
    205207   require a frame pointer, like alloca, would probably loose.  */
     
    211213#define AREG5 "$13"
    212214#define AREG6 "$14"
    213 #endif
    214 #ifdef __mc68000
     215#elif defined(__mc68000)
    215216#define AREG0 "%a5"
    216217#define AREG1 "%a4"
     
    218219#define AREG3 "%d6"
    219220#define AREG4 "%d5"
    220 #endif
    221 #ifdef __ia64__
     221#elif defined(__ia64__)
    222222#define AREG0 "r7"
    223223#define AREG1 "r4"
    224224#define AREG2 "r5"
    225225#define AREG3 "r6"
    226 #endif
    227 
    228 #ifndef VBOX
     226#else
     227#error unsupported CPU
     228#endif
     229
     230#ifndef VBOX /* WHY DO WE UNSUBSCRIBE TO THIS MACRO? */
    229231/* force GCC to generate only one epilog at the end of the function */
    230232#define FORCE_RET() __asm__ __volatile__("" : : : "memory");
     
    259261#define PARAM2 ({ int _r; asm("" : "=r"(_r) : "0" (&__op_param2)); _r; })
    260262#define PARAM3 ({ int _r; asm("" : "=r"(_r) : "0" (&__op_param3)); _r; })
     263#elif defined(__s390__)
     264extern int __op_param1 __hidden;
     265extern int __op_param2 __hidden;
     266extern int __op_param3 __hidden;
     267#define PARAM1 ({ int _r; asm("bras %0,8; .long " ASM_NAME(__op_param1) "; l %0,0(%0)" : "=r"(_r) : ); _r; })
     268#define PARAM2 ({ int _r; asm("bras %0,8; .long " ASM_NAME(__op_param2) "; l %0,0(%0)" : "=r"(_r) : ); _r; })
     269#define PARAM3 ({ int _r; asm("bras %0,8; .long " ASM_NAME(__op_param3) "; l %0,0(%0)" : "=r"(_r) : ); _r; })
    261270#else
    262271#if defined(__APPLE__)
     
    278287#endif
    279288
    280 #ifdef VBOX
    281 #define GETPC() ASMReturnAddress()
     289#if defined(__i386__)
     290#define EXIT_TB() asm volatile ("ret")
     291#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
     292#elif defined(__x86_64__)
     293#define EXIT_TB() asm volatile ("ret")
     294#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
     295#elif defined(__powerpc__)
     296#define EXIT_TB() asm volatile ("blr")
     297#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
    282298#elif defined(__s390__)
     299#define EXIT_TB() asm volatile ("br %r14")
     300#define GOTO_LABEL_PARAM(n) asm volatile ("larl %r7,12; l %r7,0(%r7); br %r7; .long " ASM_NAME(__op_gen_label) #n)
     301#elif defined(__alpha__)
     302#define EXIT_TB() asm volatile ("ret")
     303#elif defined(__ia64__)
     304#define EXIT_TB() asm volatile ("br.ret.sptk.many b0;;")
     305#define GOTO_LABEL_PARAM(n) asm volatile ("br.sptk.many " \
     306                                          ASM_NAME(__op_gen_label) #n)
     307#elif defined(__sparc__)
     308#define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0; nop")
     309#define GOTO_LABEL_PARAM(n) asm volatile ("ba " ASM_NAME(__op_gen_label) #n ";nop")
     310#elif defined(__arm__)
     311#define EXIT_TB() asm volatile ("b exec_loop")
     312#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
     313#elif defined(__mc68000)
     314#define EXIT_TB() asm volatile ("rts")
     315#elif defined(__mips__)
     316#define EXIT_TB() asm volatile ("jr $ra")
     317#define GOTO_LABEL_PARAM(n) asm volatile (".set noat; la $1, " ASM_NAME(__op_gen_label) #n "; jr $1; .set at")
     318#elif defined(__hppa__)
     319#define GOTO_LABEL_PARAM(n) asm volatile ("b,n " ASM_NAME(__op_gen_label) #n)
     320#else
     321#error unsupported CPU
     322#endif
     323
    283324/* The return address may point to the start of the next instruction.
    284325   Subtracting one gets us the call instruction itself.  */
     326#if defined(__s390__)
    285327# define GETPC() ((void*)(((unsigned long)__builtin_return_address(0) & 0x7fffffffUL) - 1))
    286328#elif defined(__arm__)
     
    291333# define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1))
    292334#endif
     335
    293336#endif /* !defined(__DYNGEN_EXEC_H__) */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette