VirtualBox

Changeset 37689 in vbox for trunk/src/recompiler/cpu-defs.h


Ignore:
Timestamp:
Jun 29, 2011 4:01:23 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72549
Message:

recompiler: Merged in changes from 0.13.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/cpu-defs.h

    r37675 r37689  
    3939#ifndef VBOX
    4040#include <signal.h>
    41 #endif
     41#else  /* VBOX */
     42# define sig_atomic_t int32_t
     43#endif /* VBOX */
    4244#include "osdep.h"
    4345#include "qemu-queue.h"
     
    9193#define TB_JMP_PAGE_MASK (TB_JMP_CACHE_SIZE - TB_JMP_PAGE_SIZE)
    9294
     95#if !defined(CONFIG_USER_ONLY)
    9396#define CPU_TLB_BITS 8
    9497#define CPU_TLB_SIZE (1 << CPU_TLB_BITS)
    9598
    96 #if TARGET_PHYS_ADDR_BITS == 32 && TARGET_LONG_BITS == 32
     99#if HOST_LONG_BITS == 32 && TARGET_LONG_BITS == 32
    97100#define CPU_TLB_ENTRY_BITS 4
    98101#else
     
    110113    target_ulong addr_write;
    111114    target_ulong addr_code;
    112     /* Addend to virtual address to get physical address.  IO accesses
     115    /* Addend to virtual address to get host address.  IO accesses
    113116       use the corresponding iotlb value.  */
    114 #if TARGET_PHYS_ADDR_BITS == 64
    115     /* on i386 Linux make sure it is aligned */
    116     target_phys_addr_t addend __attribute__((aligned(8)));
    117 #else
    118     target_phys_addr_t addend;
    119 #endif
     117    unsigned long addend;
    120118    /* padding to get a power of two size */
    121119    uint8_t dummy[(1 << CPU_TLB_ENTRY_BITS) -
    122120                  (sizeof(target_ulong) * 3 +
    123                    ((-sizeof(target_ulong) * 3) & (sizeof(target_phys_addr_t) - 1)) +
    124                    sizeof(target_phys_addr_t))];
     121                   ((-sizeof(target_ulong) * 3) & (sizeof(unsigned long) - 1)) +
     122                   sizeof(unsigned long))];
    125123} CPUTLBEntry;
     124
     125extern int CPUTLBEntry_wrong_size[sizeof(CPUTLBEntry) == (1 << CPU_TLB_ENTRY_BITS) ? 1 : -1];
     126
     127#define CPU_COMMON_TLB \
     128    /* The meaning of the MMU modes is defined in the target code. */   \
     129    CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
     130    target_phys_addr_t iotlb[NB_MMU_MODES][CPU_TLB_SIZE];               \
     131    target_ulong tlb_flush_addr;                                        \
     132    target_ulong tlb_flush_mask;
     133
     134#else
     135
     136#define CPU_COMMON_TLB
     137
     138#endif
     139
    126140
    127141#ifdef HOST_WORDS_BIGENDIAN
     
    139153struct kvm_run;
    140154struct KVMState;
     155struct qemu_work_item;
    141156
    142157typedef struct CPUBreakpoint {
     
    165180                                     memory was accessed */             \
    166181    uint32_t halted; /* Nonzero if the CPU is in suspend state */       \
    167     uint32_t stop;   /* Stop request */                                 \
    168     uint32_t stopped; /* Artificially stopped */                        \
    169182    uint32_t interrupt_request;                                         \
    170     volatile /*sig_atomic_t - vbox*/ int32_t exit_request;                                 \
    171     /* The meaning of the MMU modes is defined in the target code. */   \
    172     CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
    173     target_phys_addr_t iotlb[NB_MMU_MODES][CPU_TLB_SIZE]; \
    174     /** addends for HVA -> GPA translations */                          \
    175     VBOX_ONLY(target_phys_addr_t   phys_addends[NB_MMU_MODES][CPU_TLB_SIZE]); \
     183    volatile sig_atomic_t exit_request;                                 \
     184    CPU_COMMON_TLB                                                      \
    176185    struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE];           \
    177186    /* buffer for temporaries in the code generator */                  \
     
    213222                                                                        \
    214223    uint32_t created;                                                   \
     224    uint32_t stop;   /* Stop request */                                 \
     225    uint32_t stopped; /* Artificially stopped */                        \
    215226    struct QemuThread *thread;                                          \
    216227    struct QemuCond *halt_cond;                                         \
     228    struct qemu_work_item *queued_work_first, *queued_work_last;        \
    217229    const char *cpu_model_str;                                          \
    218230    struct KVMState *kvm_state;                                         \
    219231    struct kvm_run *kvm_run;                                            \
    220     int kvm_fd;
    221 
    222 #endif
     232    int kvm_fd;                                                         \
     233    int kvm_vcpu_dirty;
     234
     235#endif
Note: See TracChangeset for help on using the changeset viewer.

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