VirtualBox

Changeset 13440

Show
Ignore:
Timestamp:
10/21/08 15:18:34 (3 months ago)
Author:
vboxsync
Message:

further MSVC stuff, almost there

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/recompiler_new/cpu-exec.c

    r13382 r13440  
    345345            { 
    346346                interrupt_request = env->interrupt_request; 
     347#ifndef VBOX 
    347348                if (__builtin_expect(interrupt_request, 0)) 
     349#else 
     350                if (RT_UNLIKELY(interrupt_request != 0)) 
     351#endif 
    348352                { 
    349353                    /** @todo: reconscille with what QEMU really does */ 
  • trunk/src/recompiler_new/exec.c

    r13382 r13440  
    297297        qemu_host_page_size = TARGET_PAGE_SIZE; 
    298298    qemu_host_page_bits = 0; 
     299#ifndef VBOX 
    299300    while ((1 << qemu_host_page_bits) < qemu_host_page_size) 
     301#else 
     302    while ((1 << qemu_host_page_bits) < (int)qemu_host_page_size) 
     303#endif 
    300304        qemu_host_page_bits++; 
    301305    qemu_host_page_mask = ~(qemu_host_page_size - 1); 
     
    13331337 
    13341338    if (nb_tbs >= code_gen_max_blocks || 
     1339#ifndef VBOX 
    13351340        (code_gen_ptr - code_gen_buffer) >= code_gen_buffer_max_size) 
     1341#else 
     1342        (code_gen_ptr - code_gen_buffer) >= (int)code_gen_buffer_max_size)      
     1343#endif 
    13361344        return NULL; 
    13371345    tb = &tbs[nb_tbs++]; 
  • trunk/src/recompiler_new/target-i386/exec.h

    r13382 r13440  
    236236#undef ldexp 
    237237#endif /* !VBOX */ 
     238#if !defined(VBOX) || !defined(_MSC_VER) 
    238239#define sin sinl 
    239240#define cos cosl 
     
    246247#define ceil ceill 
    247248#define ldexp ldexpl 
     249#endif 
    248250#else 
    249251#define floatx_to_int32 float64_to_int32 
  • trunk/src/recompiler_new/target-i386/helper.c

    r13437 r13440  
    3131#include <stdio.h> 
    3232#include <string.h> 
     33#ifndef VBOX 
    3334#include <inttypes.h> 
    34 #ifndef VBOX 
    3535#include <signal.h> 
    3636#include <assert.h> 
     
    147147} x86_def_t; 
    148148 
     149#ifndef VBOX 
    149150#define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE) 
    150151#define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \ 
     
    413414        (*cpu_fprintf)(f, "x86 %16s\n", x86_defs[i].name); 
    414415} 
     416#endif /* !VBOX */ 
    415417 
    416418static int cpu_x86_register (CPUX86State *env, const char *cpu_model) 
  • trunk/src/recompiler_new/target-i386/ops_sse.h

    r13337 r13440  
    3030#if SHIFT == 0 
    3131#define Reg MMXReg 
     32#ifndef VBOX 
    3233#define XMM_ONLY(x...) 
     34#else 
     35#define XMM_ONLY(x) 
     36#endif 
    3337#define B(n) MMX_B(n) 
    3438#define W(n) MMX_W(n) 
     
    3842#else 
    3943#define Reg XMMReg 
     44#ifndef VBOX 
    4045#define XMM_ONLY(x...) x 
     46#else 
     47#define XMM_ONLY(x) x 
     48#endif 
    4149#define B(n) XMM_B(n) 
    4250#define W(n) XMM_W(n) 
     
    303311 
    304312#if SHIFT == 0 
     313#ifndef VBOX 
    305314static inline int satub(int x) 
     315#else /* VBOX */ 
     316DECLINLINE(int) satub(int x) 
     317#endif /* VBOX */ 
    306318{ 
    307319    if (x < 0) 
     
    313325} 
    314326 
     327#ifndef VBOX 
    315328static inline int satuw(int x) 
     329#else /* VBOX */ 
     330DECLINLINE(int) satuw(int x) 
     331#endif /* VBOX */ 
    316332{ 
    317333    if (x < 0) 
     
    323339} 
    324340 
     341#ifndef VBOX 
    325342static inline int satsb(int x) 
     343#else /* VBOX */ 
     344DECLINLINE(int) satsb(int x) 
     345#endif /* VBOX */ 
    326346{ 
    327347    if (x < -128) 
     
    333353} 
    334354 
     355#ifndef VBOX 
    335356static inline int satsw(int x) 
     357#else /* VBOX */ 
     358DECLINLINE(int) satsw(int x) 
     359#endif /* VBOX */ 
    336360{ 
    337361    if (x < -32768) 
     
    446470 
    447471#if SHIFT == 0 
     472#ifndef VBOX 
    448473static inline int abs1(int a) 
     474#else /* VBOX */ 
     475DECLINLINE(int) abs1(int a) 
     476#endif /* VBOX */ 
    449477{ 
    450478    if (a < 0) 
     
    18021830SSE_HELPER_Q(helper_pcmpgtq, FCMPGTQ) 
    18031831 
     1832#ifndef VBOX 
    18041833static inline int pcmp_elen(int reg, uint32_t ctrl) 
     1834#else /* VBOX */ 
     1835DECLINLINE(int) pcmp_elen(int reg, uint32_t ctrl) 
     1836#endif /* VBOX */ 
    18051837{ 
    18061838    int val; 
     
    18221854} 
    18231855 
     1856#ifndef VBOX 
    18241857static inline int pcmp_ilen(Reg *r, uint8_t ctrl) 
     1858#else /* VBOX */ 
     1859DECLINLINE(int) pcmp_ilen(Reg *r, uint8_t ctrl) 
     1860#endif /* VBOX */ 
    18251861{ 
    18261862    int val = 0; 
     
    18361872} 
    18371873 
     1874#ifndef VBOX 
    18381875static inline int pcmp_val(Reg *r, uint8_t ctrl, int i) 
     1876#else /* VBOX */ 
     1877DECLINLINE(int) pcmp_val(Reg *r, uint8_t ctrl, int i) 
     1878#endif /* VBOX */ 
    18391879{ 
    18401880    switch ((ctrl >> 0) & 3) { 
     
    18511891} 
    18521892 
     1893#ifndef VBOX 
    18531894static inline unsigned pcmpxstrx(Reg *d, Reg *s, 
     1895#else /* VBOX */ 
     1896DECLINLINE(unsigned) pcmpxstrx(Reg *d, Reg *s, 
     1897#endif /* VBOX */ 
    18541898                int8_t ctrl, int valids, int validd) 
    18551899{ 
     
    19181962} 
    19191963 
     1964#ifndef VBOX 
    19201965static inline int rffs1(unsigned int val) 
     1966#else /* VBOX */ 
     1967DECLINLINE(int) rffs1(unsigned int val) 
     1968#endif /* VBOX */ 
    19211969{ 
    19221970    int ret = 1, hi; 
     
    19311979} 
    19321980 
     1981#ifndef VBOX 
    19331982static inline int ffs1(unsigned int val) 
     1983#else /* VBOX */ 
     1984DECLINLINE(int) ffs1(unsigned int val) 
     1985#endif /* VBOX */ 
    19341986{ 
    19351987    int ret = 1, hi; 
  • trunk/src/recompiler_new/target-i386/translate.c

    r13357 r13440  
    3131#include <stdio.h> 
    3232#include <string.h> 
     33#ifndef VBOX 
    3334#include <inttypes.h> 
    34 #ifndef VBOX 
    3535#include <signal.h> 
    3636#include <assert.h> 
     
    5151#ifdef TARGET_X86_64 
    5252#define X86_64_ONLY(x) x 
     53#ifndef VBOX 
    5354#define X86_64_DEF(x...) x 
     55#else 
     56#define X86_64_DEF(x...) x 
     57#endif 
    5458#define CODE64(s) ((s)->code64) 
    5559#define REX_X(s) ((s)->rex_x) 
     
    6165#else 
    6266#define X86_64_ONLY(x) NULL 
     67#ifndef VBOX 
    6368#define X86_64_DEF(x...) 
     69#else 
     70#define X86_64_DEF(x) 
     71#endif 
    6472#define CODE64(s) 0 
    6573#define REX_X(s) 0 
     
    222230}; 
    223231 
     232#ifndef VBOX 
    224233static inline void gen_op_movl_T0_0(void) 
     234#else /* VBOX */ 
     235DECLINLINE(void) gen_op_movl_T0_0(void) 
     236#endif /* VBOX */ 
    225237{ 
    226238    tcg_gen_movi_tl(cpu_T[0], 0); 
    227239} 
    228240 
     241#ifndef VBOX 
    229242static inline void gen_op_movl_T0_im(int32_t val) 
     243#else /* VBOX */ 
     244DECLINLINE(void) gen_op_movl_T0_im(int32_t val) 
     245#endif /* VBOX */ 
    230246{ 
    231247    tcg_gen_movi_tl(cpu_T[0], val); 
    232248} 
    233249 
     250#ifndef VBOX 
    234251static inline void gen_op_movl_T0_imu(uint32_t val) 
     252#else /* VBOX */ 
     253DECLINLINE(void) gen_op_movl_T0_imu(uint32_t val) 
     254#endif /* VBOX */ 
    235255{ 
    236256    tcg_gen_movi_tl(cpu_T[0], val); 
    237257} 
    238258 
     259#ifndef VBOX 
    239260static inline void gen_op_movl_T1_im(int32_t val) 
     261#else /* VBOX */ 
     262DECLINLINE(void) gen_op_movl_T1_im(int32_t val) 
     263#endif /* VBOX */ 
    240264{ 
    241265    tcg_gen_movi_tl(cpu_T[1], val); 
    242266} 
    243267 
     268#ifndef VBOX 
    244269static inline void gen_op_movl_T1_imu(uint32_t val) 
     270#else /* VBOX */ 
     271DECLINLINE(void) gen_op_movl_T1_imu(uint32_t val) 
     272#endif /* VBOX */ 
    245273{ 
    246274    tcg_gen_movi_tl(cpu_T[1], val); 
    247275} 
    248276 
     277#ifndef VBOX 
    249278static inline void gen_op_movl_A0_im(uint32_t val) 
     279#else /* VBOX */ 
     280DECLINLINE(void) gen_op_movl_A0_im(uint32_t val) 
     281#endif /* VBOX */ 
    250282{ 
    251283    tcg_gen_movi_tl(cpu_A0, val); 
     
    253285 
    254286#ifdef TARGET_X86_64 
     287#ifndef VBOX 
    255288static inline void gen_op_movq_A0_im(int64_t val) 
     289#else /* VBOX */ 
     290DECLINLINE(void) gen_op_movq_A0_im(int64_t val) 
     291#endif /* VBOX */ 
    256292{ 
    257293    tcg_gen_movi_tl(cpu_A0, val); 
     
    259295#endif 
    260296 
     297#ifndef VBOX 
    261298static inline void gen_movtl_T0_im(target_ulong val) 
     299#else /* VBOX */ 
     300DECLINLINE(void) gen_movtl_T0_im(target_ulong val) 
     301#endif /* VBOX */ 
    262302{ 
    263303    tcg_gen_movi_tl(cpu_T[0], val); 
    264304} 
    265305 
     306#ifndef VBOX 
    266307static inline void gen_movtl_T1_im(target_ulong val) 
     308#else /* VBOX */ 
     309DECLINLINE(void) gen_movtl_T1_im(target_ulong val) 
     310#endif /* VBOX */ 
    267311{ 
    268312    tcg_gen_movi_tl(cpu_T[1], val); 
    269313} 
    270314 
     315#ifndef VBOX 
    271316static inline void gen_op_andl_T0_ffff(void) 
     317#else /* VBOX */ 
     318DECLINLINE(void) gen_op_andl_T0_ffff(void) 
     319#endif /* VBOX */ 
    272320{ 
    273321    tcg_gen_andi_tl(cpu_T[0], cpu_T[0], 0xffff); 
    274322} 
    275323 
     324#ifndef VBOX 
    276325static inline void gen_op_andl_T0_im(uint32_t val) 
     326#else /* VBOX */ 
     327DECLINLINE(void) gen_op_andl_T0_im(uint32_t val) 
     328#endif /* VBOX */ 
    277329{ 
    278330    tcg_gen_andi_tl(cpu_T[0], cpu_T[0], val); 
    279331} 
    280332 
     333#ifndef VBOX 
    281334static inline void gen_op_movl_T0_T1(void) 
     335#else /* VBOX */ 
     336DECLINLINE(void) gen_op_movl_T0_T1(void) 
     337#endif /* VBOX */ 
    282338{ 
    283339    tcg_gen_mov_tl(cpu_T[0], cpu_T[1]); 
    284340} 
    285341 
     342#ifndef VBOX 
    286343static inline void gen_op_andl_A0_ffff(void) 
     344#else /* VBOX */ 
     345DECLINLINE(void) gen_op_andl_A0_ffff(void) 
     346#endif /* VBOX */ 
    287347{ 
    288348    tcg_gen_andi_tl(cpu_A0, cpu_A0, 0xffff); 
     
    313373#endif 
    314374 
     375#ifndef VBOX 
    315376static inline void gen_op_mov_reg_v(int ot, int reg, TCGv t0) 
     377#else /* VBOX */ 
     378DECLINLINE(void) gen_op_mov_reg_v(int ot, int reg, TCGv t0) 
     379#endif /* VBOX */ 
    316380{ 
    317381    switch(ot) { 
     
    346410} 
    347411 
     412#ifndef VBOX 
    348413static inline void gen_op_mov_reg_T0(int ot, int reg) 
     414#else /* VBOX */ 
     415DECLINLINE(void) gen_op_mov_reg_T0(int ot, int reg) 
     416#endif /* VBOX */ 
    349417{ 
    350418    gen_op_mov_reg_v(ot, reg, cpu_T[0]); 
    351419} 
    352420 
     421#ifndef VBOX 
    353422static inline void gen_op_mov_reg_T1(int ot, int reg) 
     423#else /* VBOX */ 
     424DECLINLINE(void) gen_op_mov_reg_T1(int ot, int reg) 
     425#endif /* VBOX */ 
    354426{ 
    355427    gen_op_mov_reg_v(ot, reg, cpu_T[1]); 
    356428} 
    357429 
     430#ifndef VBOX 
    358431static inline void gen_op_mov_reg_A0(int size, int reg) 
     432#else /* VBOX */ 
     433DECLINLINE(void) gen_op_mov_reg_A0(int size, int reg) 
     434#endif /* VBOX */ 
    359435{ 
    360436    switch(size) { 
     
    382458} 
    383459 
     460#ifndef VBOX 
    384461static inline void gen_op_mov_v_reg(int ot, TCGv t0, int reg) 
     462#else /* VBOX */ 
     463DECLINLINE(void) gen_op_mov_v_reg(int ot, TCGv t0, int reg) 
     464#endif /* VBOX */ 
    385465{ 
    386466    switch(ot) { 
     
    399479} 
    400480 
     481#ifndef VBOX 
    401482static inline void gen_op_mov_TN_reg(int ot, int t_index, int reg) 
     483#else /* VBOX */ 
     484DECLINLINE(void) gen_op_mov_TN_reg(int ot, int t_index, int reg) 
     485#endif /* VBOX */ 
    402486{ 
    403487    gen_op_mov_v_reg(ot, cpu_T[t_index], reg); 
    404488} 
    405489 
     490#ifndef VBOX 
    406491static inline void gen_op_movl_A0_reg(int reg) 
     492#else /* VBOX */ 
     493DECLINLINE(void) gen_op_movl_A0_reg(int reg) 
     494#endif /* VBOX */ 
    407495{ 
    408496    tcg_gen_ld32u_tl(cpu_A0, cpu_env, offsetof(CPUState, regs[reg]) + REG_L_OFFSET); 
    409497} 
    410498 
     499#ifndef VBOX 
    411500static inline void gen_op_addl_A0_im(int32_t val) 
     501#else /* VBOX */ 
     502DECLINLINE(void) gen_op_addl_A0_im(int32_t val) 
     503#endif /* VBOX */ 
    412504{ 
    413505    tcg_gen_addi_tl(cpu_A0, cpu_A0, val); 
     
    418510 
    419511#ifdef TARGET_X86_64 
     512#ifndef VBOX 
    420513static inline void gen_op_addq_A0_im(int64_t val) 
     514#else /* VBOX */ 
     515DECLINLINE(void) gen_op_addq_A0_im(int64_t val) 
     516#endif /* VBOX */ 
    421517{ 
    422518    tcg_gen_addi_tl(cpu_A0, cpu_A0, val); 
     
    434530} 
    435531 
     532#ifndef VBOX 
    436533static inline void gen_op_addl_T0_T1(void) 
     534#else /* VBOX */ 
     535DECLINLINE(void) gen_op_addl_T0_T1(void) 
     536#endif /* VBOX */ 
    437537{ 
    438538    tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]); 
    439539} 
    440540 
     541#ifndef VBOX 
    441542static inline void gen_op_jmp_T0(void) 
     543#else /* VBOX */ 
     544DECLINLINE(void) gen_op_jmp_T0(void) 
     545#endif /* VBOX */ 
    442546{ 
    443547    tcg_gen_st_tl(cpu_T[0], cpu_env, offsetof(CPUState, eip)); 
    444548} 
    445549 
     550#ifndef VBOX 
    446551static inline void gen_op_add_reg_im(int size, int reg, int32_t val) 
     552#else /* VBOX */ 
     553DECLINLINE(void) gen_op_add_reg_im(int size, int reg, int32_t val) 
     554#endif /* VBOX */ 
    447555{ 
    448556    switch(size) { 
     
    470578} 
    471579 
     580#ifndef VBOX 
    472581static inline void gen_op_add_reg_T0(int size, int reg) 
     582#else /* VBOX */ 
     583DECLINLINE(void) gen_op_add_reg_T0(int size, int reg) 
     584#endif /* VBOX */ 
    473585{ 
    474586    switch(size) { 
     
    496608} 
    497609 
     610#ifndef VBOX 
    498611static inline void gen_op_set_cc_op(int32_t val) 
     612#else /* VBOX */ 
     613DECLINLINE(void) gen_op_set_cc_op(int32_t val) 
     614#endif /* VBOX */ 
    499615{ 
    500616    tcg_gen_movi_i32(cpu_cc_op, val); 
    501617} 
    502618 
     619#ifndef VBOX 
    503620static inline void gen_op_addl_A0_reg_sN(int shift, int reg) 
     621#else /* VBOX */ 
     622DECLINLINE(void) gen_op_addl_A0_reg_sN(int shift, int reg) 
     623#endif /* VBOX */ 
    504624{ 
    505625    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, regs[reg])); 
     
    512632} 
    513633 
     634#ifndef VBOX 
    514635static inline void gen_op_movl_A0_seg(int reg) 
     636#else /* VBOX */ 
     637DECLINLINE(void) gen_op_movl_A0_seg(int reg) 
     638#endif /* VBOX */ 
    515639{ 
    516640    tcg_gen_ld32u_tl(cpu_A0, cpu_env, offsetof(CPUState, segs[reg].base) + REG_L_OFFSET); 
    517641} 
    518642 
     643#ifndef VBOX 
    519644static inline void gen_op_addl_A0_seg(int reg) 
     645#else /* VBOX */ 
     646DECLINLINE(void) gen_op_addl_A0_seg(int reg) 
     647#endif /* VBOX */ 
    520648{ 
    521649    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, segs[reg].base)); 
     
    527655 
    528656#ifdef TARGET_X86_64 
     657#ifndef VBOX 
    529658static inline void gen_op_movq_A0_seg(int reg) 
     659#else /* VBOX */ 
     660DECLINLINE(void) gen_op_movq_A0_seg(int reg) 
     661#endif /* VBOX */ 
    530662{ 
    531663    tcg_gen_ld_tl(cpu_A0, cpu_env, offsetof(CPUState, segs[reg].base)); 
    532664} 
    533665 
     666#ifndef VBOX 
    534667static inline void gen_op_addq_A0_seg(int reg) 
     668#else /* VBOX */ 
     669DECLINLINE(void) gen_op_addq_A0_seg(int reg) 
     670#endif /* VBOX */ 
    535671{ 
    536672    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, segs[reg].base)); 
     
    538674} 
    539675 
     676#ifndef VBOX 
    540677static inline void gen_op_movq_A0_reg(int reg) 
     678#else /* VBOX */ 
     679DECLINLINE(void) gen_op_movq_A0_reg(int reg) 
     680#endif /* VBOX */ 
    541681{ 
    542682    tcg_gen_ld_tl(cpu_A0, cpu_env, offsetof(CPUState, regs[reg])); 
    543683} 
    544684 
     685#ifndef VBOX 
    545686static inline void gen_op_addq_A0_reg_sN(int shift, int reg) 
     687#else /* VBOX */ 
     688DECLINLINE(void) gen_op_addq_A0_reg_sN(int shift, int reg) 
     689#endif /* VBOX */ 
    546690{ 
    547691    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, regs[reg])); 
     
    552696#endif 
    553697 
     698#ifndef VBOX 
    554699static inline void gen_op_lds_T0_A0(int idx) 
     700#else /* VBOX */ 
     701DECLINLINE(void) gen_op_lds_T0_A0(int idx) 
     702#endif /* VBOX */ 
    555703{ 
    556704    int mem_index = (idx >> 2) - 1; 
     
    569717} 
    570718 
     719#ifndef VBOX 
    571720static inline void gen_op_ld_v(int idx, TCGv t0, TCGv a0) 
     721#else /* VBOX */ 
     722DECLINLINE(void) gen_op_ld_v(int idx, TCGv t0, TCGv a0) 
     723#endif /* VBOX */ 
    572724{ 
    573725    int mem_index = (idx >> 2) - 1; 
     
    590742 
    591743/* XXX: always use ldu or lds */ 
     744#ifndef VBOX 
    592745static inline void gen_op_ld_T0_A0(int idx) 
     746#else /* VBOX */ 
     747DECLINLINE(void) gen_op_ld_T0_A0(int idx) 
     748#endif /* VBOX */ 
    593749{ 
    594750    gen_op_ld_v(idx, cpu_T[0], cpu_A0); 
    595751} 
    596752 
     753#ifndef VBOX 
    597754static inline void gen_op_ldu_T0_A0(int idx) 
     755#else /* VBOX */ 
     756DECLINLINE(void) gen_op_ldu_T0_A0(int idx) 
     757#endif /* VBOX */ 
    598758{ 
    599759    gen_op_ld_v(idx, cpu_T[0], cpu_A0); 
    600760} 
    601761 
     762#ifndef VBOX 
    602763static inline void gen_op_ld_T1_A0(int idx) 
     764#else /* VBOX */ 
     765DECLINLINE(void) gen_op_ld_T1_A0(int idx) 
     766#endif /* VBOX */ 
    603767{ 
    604768    gen_op_ld_v(idx, cpu_T[1], cpu_A0); 
    605769} 
    606770 
     771#ifndef VBOX 
    607772static inline void gen_op_st_v(int idx, TCGv t0, TCGv a0) 
     773#else /* VBOX */ 
     774DECLINLINE(void) gen_op_st_v(int idx, TCGv t0, TCGv a0) 
     775#endif /* VBOX */ 
    608776{ 
    609777    int mem_index = (idx >> 2) - 1; 
     
    625793} 
    626794 
     795#ifndef VBOX 
    627796static inline void gen_op_st_T0_A0(int idx) 
     797#else /* VBOX */ 
     798DECLINLINE(void) gen_op_st_T0_A0(int idx) 
     799#endif /* VBOX */ 
    628800{ 
    629801    gen_op_st_v(idx, cpu_T[0], cpu_A0); 
    630802} 
    631803 
     804#ifndef VBOX 
    632805static inline void gen_op_st_T1_A0(int idx) 
     806#else /* VBOX */ 
     807DECLINLINE(void) gen_op_st_T1_A0(int idx) 
     808#endif /* VBOX */ 
    633809{ 
    634810    gen_op_st_v(idx, cpu_T[1], cpu_A0); 
    635811} 
    636812 
     813#ifndef VBOX 
    637814static inline void gen_jmp_im(target_ulong pc) 
     815#else /* VBOX */ 
     816DECLINLINE(void) gen_jmp_im(target_ulong pc) 
     817#endif /* VBOX */ 
    638818{ 
    639819#ifdef VBOX 
     
    652832} 
    653833 
     834#ifndef VBOX 
    654835static inline void gen_update_eip(target_ulong pc) 
     836#else /* VBOX */ 
     837DECLINLINE(void) gen_update_eip(target_ulong pc) 
     838#endif /* VBOX */ 
    655839{ 
    656840    gen_jmp_im(pc); 
     
    659843#endif 
    660844 
     845#ifndef VBOX 
    661846static inline void gen_string_movl_A0_ESI(DisasContext *s) 
     847#else /* VBOX */ 
     848DECLINLINE(void) gen_string_movl_A0_ESI(DisasContext *s) 
     849#endif /* VBOX */ 
    662850{ 
    663851    int override; 
     
    694882} 
    695883 
     884#ifndef VBOX 
    696885static inline void gen_string_movl_A0_EDI(DisasContext *s) 
     886#else /* VBOX */ 
     887DECLINLINE(void) gen_string_movl_A0_EDI(DisasContext *s) 
     888#endif /* VBOX */ 
    697889{ 
    698890#ifdef TARGET_X86_64 
     
    715907} 
    716908 
     909#ifndef VBOX 
    717910static inline void gen_op_movl_T0_Dshift(int ot)  
     911#else /* VBOX */ 
     912DECLINLINE(void) gen_op_movl_T0_Dshift(int ot)  
     913#endif /* VBOX */ 
    718914{ 
    719915    tcg_gen_ld32s_tl(cpu_T[0], cpu_env, offsetof(CPUState, df)); 
     
    755951} 
    756952 
     953#ifndef VBOX 
    757954static inline void gen_op_jnz_ecx(int size, int label1) 
     955#else /* VBOX */ 
     956DECLINLINE(void) gen_op_jnz_ecx(int size, int label1) 
     957#endif /* VBOX */ 
    758958{ 
    759959    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, regs[R_ECX])); 
     
    762962} 
    763963 
     964#ifndef VBOX 
    764965static inline void gen_op_jz_ecx(int size, int label1) 
     966#else /* VBOX */ 
     967DECLINLINE(void) gen_op_jz_ecx(int size, int label1) 
     968#endif /* VBOX */ 
    765969{ 
    766970    tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, regs[R_ECX])); 
     
    8201024} 
    8211025 
     1026#ifndef VBOX 
    8221027static inline void gen_movs(DisasContext *s, int ot) 
     1028#else /* VBOX */ 
     1029DECLINLINE(void) gen_movs(DisasContext *s, int ot) 
     1030#endif /* VBOX */ 
    8231031{ 
    8241032    gen_string_movl_A0_ESI(s); 
     
    8311039} 
    8321040 
     1041#ifndef VBOX 
    8331042static inline void gen_update_cc_op(DisasContext *s) 
     1043#else /* VBOX */ 
     1044DECLINLINE(void) gen_update_cc_op(DisasContext *s) 
     1045#endif /* VBOX */ 
    8341046{ 
    8351047    if (s->cc_op != CC_OP_DYNAMIC) { 
     
    8511063} 
    8521064 
     1065#ifndef VBOX 
    8531066static inline void gen_op_cmpl_T0_T1_cc(void) 
     1067#else /* VBOX */ 
     1068DECLINLINE(void) gen_op_cmpl_T0_T1_cc(void) 
     1069#endif /* VBOX */ 
    8541070{ 
    8551071    tcg_gen_mov_tl(cpu_cc_src, cpu_T[1]); 
     
    8571073} 
    8581074 
     1075#ifndef VBOX 
    8591076static inline void gen_op_testl_T0_T1_cc(void) 
     1077#else /* VBOX */ 
     1078DECLINLINE(void) gen_op_testl_T0_T1_cc(void) 
     1079#endif /* VBOX */ 
    8601080{ 
    8611081    tcg_gen_discard_tl(cpu_cc_src); 
     
    9131133} 
    9141134 
     1135#ifndef VBOX 
    9151136static inline void gen_setcc_slow_T0(DisasContext *s, int jcc_op) 
     1137#else /* VBOX */ 
     1138DECLINLINE(void) gen_setcc_slow_T0(DisasContext *s, int jcc_op) 
     1139#endif /* VBOX */ 
    9161140{ 
    9171141    if (s->cc_op != CC_OP_DYNAMIC) 
     
    10201244/* generate a conditional jump to label 'l1' according to jump opcode 
    10211245   value 'b'. In the fast case, T0 is guaranted not to be used. */ 
     1246#ifndef VBOX 
    10221247static inline void gen_jcc1(DisasContext *s, int cc_op, int b, int l1) 
     1248#else /* VBOX */ 
     1249DECLINLINE(void) gen_jcc1(DisasContext *s, int cc_op, int b, int l1) 
     1250#endif /* VBOX */ 
    10231251{ 
    10241252    int inv, jcc_op, size, cond; 
     
    12311459} 
    12321460 
     1461#ifndef VBOX 
    12331462static inline void gen_stos(DisasContext *s, int ot) 
     1463#else /* VBOX */ 
     1464DECLINLINE(void) gen_stos(DisasContext *s, int ot) 
     1465#endif /* VBOX */ 
    12341466{ 
    12351467    gen_op_mov_TN_reg(OT_LONG, 0, R_EAX); 
     
    12401472} 
    12411473 
     1474#ifndef VBOX 
    12421475static inline void gen_lods(DisasContext *s, int ot) 
     1476#else /* VBOX */ 
     1477DECLINLINE(void) gen_lods(DisasContext *s, int ot) 
     1478#endif /* VBOX */ 
    12431479{ 
    12441480    gen_string_movl_A0_ESI(s); 
     
    12491485} 
    12501486 
     1487#ifndef VBOX 
    12511488static inline void gen_scas(DisasContext *s, int ot) 
     1489#else /* VBOX */ 
     1490DECLINLINE(void) gen_scas(DisasContext *s, int ot) 
     1491#endif /* VBOX */ 
    12521492{ 
    12531493    gen_op_mov_TN_reg(OT_LONG, 0, R_EAX); 
     
    12591499} 
    12601500 
     1501#ifndef VBOX 
    12611502static inline void gen_cmps(DisasContext *s, int ot) 
     1503#else /* VBOX */ 
     1504DECLINLINE(void) gen_cmps(DisasContext *s, int ot) 
     1505#endif /* VBOX */ 
    12621506{ 
    12631507    gen_string_movl_A0_ESI(s); 
     
    12711515} 
    12721516 
     1517#ifndef VBOX 
    12731518static inline void gen_ins(DisasContext *s, int ot) 
     1519#else /* VBOX */ 
     1520DECLINLINE(void) gen_ins(DisasContext *s, int ot) 
     1521#endif /* VBOX */ 
    12741522{ 
    12751523    if (use_icount) 
     
    12911539} 
    12921540 
     1541#ifndef VBOX 
    12931542static inline void gen_outs(DisasContext *s, int ot) 
     1543#else /* VBOX */ 
     1544DECLINLINE(void) gen_outs(DisasContext *s, int ot) 
     1545#endif /* VBOX */ 
    12941546{ 
    12951547    if (use_icount) 
     
    13121564/* same method as Valgrind : we generate jumps to current or next 
    13131565   instruction */ 
     1566#ifndef VBOX 
    13141567#define GEN_REPZ(op)                                                          \ 
    13151568static inline void gen_repz_ ## op(DisasContext *s, int ot,                   \ 
    13161569                                 target_ulong cur_eip, target_ulong next_eip) \ 
    13171570{                                                                             \ 
    1318     int l2;
     1571    int l2;                                                                   
    13191572    gen_update_cc_op(s);                                                      \ 
    13201573    l2 = gen_jz_ecx_string(s, next_eip);                                      \ 
     
    13271580    gen_jmp(s, cur_eip);                                                      \ 
    13281581} 
    1329  
     1582#else /* VBOX */ 
     1583#define GEN_REPZ(op)                                                          \ 
     1584DECLINLINE(void) gen_repz_ ## op(DisasContext *s, int ot,                     \ 
     1585                                 target_ulong cur_eip, target_ulong next_eip) \ 
     1586{                                                                             \ 
     1587    int l2;                                                                   \ 
     1588    gen_update_cc_op(s);                                                      \ 
     1589    l2 = gen_jz_ecx_string(s, next_eip);                                      \ 
     1590    gen_ ## op(s, ot);                                                        \ 
     1591    gen_op_add_reg_im(s->aflag, R_ECX, -1);                                   \ 
     1592    /* a loop would cause two single step exceptions if ECX = 1               \ 
     1593       before rep string_insn */                                              \ 
     1594    if (!s->jmp_opt)                                                          \ 
     1595        gen_op_jz_ecx(s->aflag, l2);                                          \ 
     1596    gen_jmp(s, cur_eip);                                                      \ 
     1597
     1598#endif /* VBOX */ 
     1599 
     1600#ifndef VBOX 
    13301601#define GEN_REPZ2(op)                                                         \ 
    13311602static inline void gen_repz_ ## op(DisasContext *s, int ot,                   \ 
     1603                                   target_ulong cur_eip,                      \ 
     1604                                   target_ulong next_eip,                     \ 
     1605                                   int nz)                                    \ 
     1606{                                                                             \ 
     1607    int l2;                                                                   \ 
     1608    gen_update_cc_op(s);                                                      \ 
     1609    l2 = gen_jz_ecx_string(s, next_eip);                                      \ 
     1610    gen_ ## op(s, ot);                                                        \ 
     1611    gen_op_add_reg_im(s->aflag, R_ECX, -1);                                   \ 
     1612    gen_op_set_cc_op(CC_OP_SUBB + ot);                                        \ 
     1613    gen_jcc1(s, CC_OP_SUBB + ot, (JCC_Z << 1) | (nz ^ 1), l2);                \ 
     1614    if (!s->jmp_opt)                                                          \ 
     1615        gen_op_jz_ecx(s->aflag, l2);                                          \ 
     1616    gen_jmp(s, cur_eip);                                                      \ 
     1617} 
     1618#else /* VBOX */ 
     1619#define GEN_REPZ2(op)                                                         \ 
     1620DECLINLINE(void) gen_repz_ ## op(DisasContext *s, int ot,                     \ 
    13321621                                   target_ulong cur_eip,                      \ 
    13331622                                   target_ulong next_eip,                     \ 
     
    13451634    gen_jmp(s, cur_eip);                                                      \ 
    13461635} 
     1636#endif /* VBOX */ 
    13471637 
    13481638GEN_REPZ(movs) 
     
    16191909} 
    16201910 
     1911#ifndef VBOX 
    16211912static inline void tcg_gen_lshift(TCGv ret, TCGv arg1, target_long arg2) 
     1913#else /* VBOX */ 
     1914DECLINLINE(void) tcg_gen_lshift(TCGv ret, TCGv arg1, target_long arg2) 
     1915#endif /* VBOX */ 
    16221916{ 
    16231917    if (arg2 >= 0) 
     
    22402534} 
    22412535 
     2536#ifndef VBOX 
    22422537static inline uint32_t insn_get(DisasContext *s, int ot) 
     2538#else /* VBOX */ 
     2539DECLINLINE(uint32_t) insn_get(DisasContext *s, int ot) 
     2540#endif /* VBOX */ 
    22432541{ 
    22442542    uint32_t ret; 
     
    22622560} 
    22632561 
     2562#ifndef VBOX 
    22642563static inline int insn_const_size(unsigned int ot) 
     2564#else /* VBOX */ 
     2565DECLINLINE(int) insn_const_size(unsigned int ot) 
     2566#endif /* VBOX */ 
    22652567{ 
    22662568    if (ot <= OT_LONG) 
     
    22702572} 
    22712573 
     2574#ifndef VBOX 
    22722575static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) 
     2576#else /* VBOX */ 
     2577DECLINLINE(void) gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) 
     2578#endif /* VBOX */ 
    22732579{ 
    22742580    TranslationBlock *tb; 
     
    22912597} 
    22922598 
     2599#ifndef VBOX 
    22932600static inline void gen_jcc(DisasContext *s, int b, 
     2601#else /* VBOX */ 
     2602DECLINLINE(void) gen_jcc(DisasContext *s, int b, 
     2603#endif /* VBOX */ 
    22942604                           target_ulong val, target_ulong next_eip) 
    22952605{ 
     
    23582668} 
    23592669 
     2670#ifndef VBOX 
    23602671static inline void gen_op_movl_T0_seg(int seg_reg) 
     2672#else /* VBOX */ 
     2673DECLINLINE(void) gen_op_movl_T0_seg(int seg_reg) 
     2674#endif /* VBOX */ 
    23612675{ 
    23622676    tcg_gen_ld32u_tl(cpu_T[0], cpu_env,  
     
    23642678} 
    23652679 
     2680#ifndef VBOX 
    23662681static inline void gen_op_movl_seg_T0_vm(int seg_reg) 
     2682#else /* VBOX */ 
     2683DECLINLINE(void) gen_op_movl_seg_T0_vm(int seg_reg) 
     2684#endif /* VBOX */ 
    23672685{ 
    23682686    tcg_gen_andi_tl(cpu_T[0], cpu_T[0], 0xffff); 
     
    23982716} 
    23992717 
     2718#ifndef VBOX 
    24002719static inline int svm_is_rep(int prefixes) 
     2720#else /* VBOX */ 
     2721DECLINLINE(int) svm_is_rep(int prefixes) 
     2722#endif /* VBOX */ 
    24012723{ 
    24022724    return ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) ? 8 : 0); 
    24032725} 
    24042726 
     2727#ifndef VBOX 
    24052728static inline void 
     2729#else /* VBOX */ 
     2730DECLINLINE(void) 
     2731#endif /* VBOX */ 
    24062732gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, 
    24072733                              uint32_t type, uint64_t param) 
     
    24172743} 
    24182744 
     2745#ifndef VBOX 
    24192746static inline void 
     2747#else /* VBOX */ 
     2748DECLINLINE(void) 
     2749#endif 
    24202750gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, uint64_t type) 
    24212751{ 
     
    24232753} 
    24242754 
     2755#ifndef VBOX 
    24252756static inline void gen_stack_update(DisasContext *s, int addend) 
     2757#else /* VBOX */ 
     2758DECLINLINE(void) gen_stack_update(DisasContext *s, int addend) 
     2759#endif /* VBOX */ 
    24262760{ 
    24272761#ifdef TARGET_X86_64 
     
    27343068} 
    27353069 
     3070#ifndef VBOX 
    27363071static inline void gen_ldq_env_A0(int idx, int offset) 
     3072#else /* VBOX */ 
     3073DECLINLINE(void) gen_ldq_env_A0(int idx, int offset) 
     3074#endif /* VBOX */ 
    27373075{ 
    27383076    int mem_index = (idx >> 2) - 1; 
     
    27413079} 
    27423080 
     3081#ifndef VBOX 
    27433082static inline void gen_stq_env_A0(int idx, int offset) 
     3083#else /* VBOX */ 
     3084DECLINLINE(void) gen_stq_env_A0(int idx, int offset) 
     3085#endif /* VBOX */ 
    27443086{ 
    27453087    int mem_index = (idx >> 2) - 1; 
     
    27483090} 
    27493091 
     3092#ifndef VBOX 
    27503093static inline void gen_ldo_env_A0(int idx, int offset) 
     3094#else /* VBOX */ 
     3095DECLINLINE(void) gen_ldo_env_A0(int idx, int offset) 
     3096#endif /* VBOX */ 
    27513097{ 
    27523098    int mem_index = (idx >> 2) - 1; 
     
    27583104} 
    27593105 
     3106#ifndef VBOX 
    2760