VirtualBox

忽略:
時間撮記:
2008-10-16 上午11:59:21 (16 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
38026
訊息:

more recompiler work

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/recompiler_new/exec-all.h

    r13230 r13337  
    4444#endif /* VBOX */
    4545
    46 #ifndef glue
    47 #define xglue(x, y) x ## y
    48 #define glue(x, y) xglue(x, y)
    49 #define stringify(s)    tostring(s)
    50 #define tostring(s)     #s
    51 #endif
    52 
    53 #if __GNUC__ < 3
    54 #define __builtin_expect(x, n) (x)
    55 #endif
    56 
    57 #ifdef __i386__
    58 #define REGPARM(n) __attribute((regparm(n)))
    59 #else
    60 #define REGPARM(n)
    61 #endif
    62 
    6346/* is_jmp field values */
    6447#define DISAS_NEXT    0 /* next instruction can be analyzed */
     
    9780typedef void (GenOpFunc3)(long, long, long);
    9881
    99 #ifndef VBOX
    100 extern FILE *logfile;
    101 extern int loglevel;
    102 #endif
     82#include "qemu-log.h"
    10383
    10484void gen_intermediate_code(CPUState *env, struct TranslationBlock *tb);
     
    171151    target_ulong pc;   /* simulated PC corresponding to this block (EIP + CS base) */
    172152    target_ulong cs_base; /* CS base for this block */
    173     unsigned int flags; /* flags defining in which context the code was generated */
     153    uint64_t flags; /* flags defining in which context the code was generated */
    174154    uint16_t size;      /* size of target code for this block (1 <=
    175155                           size <= TARGET_PAGE_SIZE) */
     
    199179#  error "First 4GB aren't reachable. jmp dword [tb_next] wont work."
    200180# endif
    201     uint32_t tb_next[2]; /* address of jump generated code */
     181    unsigned long tb_next[2]; /* address of jump generated code */
    202182#endif
    203183    /* list of TBs jumping to this one. This is a circular list using
     
    331311extern void *io_mem_opaque[IO_MEM_NB_ENTRIES];
    332312
    333 #ifdef __powerpc__
    334 static inline int testandset (int *p)
    335 {
    336     int ret;
    337     __asm__ __volatile__ (
    338                           "0:    lwarx %0,0,%1\n"
    339                           "      xor. %0,%3,%0\n"
    340                           "      bne 1f\n"
    341                           "      stwcx. %2,0,%1\n"
    342                           "      bne- 0b\n"
    343                           "1:    "
    344                           : "=&r" (ret)
    345                           : "r" (p), "r" (1), "r" (0)
    346                           : "cr0", "memory");
    347     return ret;
    348 }
    349 #endif
    350 
    351 #ifdef __i386__
    352 static inline int testandset (int *p)
    353 {
    354     long int readval = 0;
    355 
    356     __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
    357                           : "+m" (*p), "+a" (readval)
    358                           : "r" (1)
    359                           : "cc");
    360     return readval;
    361 }
    362 #endif
    363 
    364 #ifdef __x86_64__
    365 static inline int testandset (int *p)
    366 {
    367     long int readval = 0;
    368 
    369     __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
    370                           : "+m" (*p), "+a" (readval)
    371                           : "r" (1)
    372                           : "cc");
    373     return readval;
    374 }
    375 #endif
    376 
    377 #ifdef __s390__
    378 static inline int testandset (int *p)
    379 {
    380     int ret;
    381 
    382     __asm__ __volatile__ ("0: cs    %0,%1,0(%2)\n"
    383                           "   jl    0b"
    384                           : "=&d" (ret)
    385                           : "r" (1), "a" (p), "0" (*p)
    386                           : "cc", "memory" );
    387     return ret;
    388 }
    389 #endif
    390 
    391 #ifdef __alpha__
    392 static inline int testandset (int *p)
    393 {
    394     int ret;
    395     unsigned long one;
    396 
    397     __asm__ __volatile__ ("0:   mov 1,%2\n"
    398                           "     ldl_l %0,%1\n"
    399                           "     stl_c %2,%1\n"
    400                           "     beq %2,1f\n"
    401                           ".subsection 2\n"
    402                           "1:   br 0b\n"
    403                           ".previous"
    404                           : "=r" (ret), "=m" (*p), "=r" (one)
    405                           : "m" (*p));
    406     return ret;
    407 }
    408 #endif
    409 
    410 #ifdef __sparc__
    411 static inline int testandset (int *p)
    412 {
    413         int ret;
    414 
    415         __asm__ __volatile__("ldstub    [%1], %0"
    416                              : "=r" (ret)
    417                              : "r" (p)
    418                              : "memory");
    419 
    420         return (ret ? 1 : 0);
    421 }
    422 #endif
    423 
    424 #ifdef __arm__
    425 static inline int testandset (int *spinlock)
    426 {
    427     register unsigned int ret;
    428     __asm__ __volatile__("swp %0, %1, [%2]"
    429                          : "=r"(ret)
    430                          : "0"(1), "r"(spinlock));
    431 
    432     return ret;
    433 }
    434 #endif
    435 
    436 #ifdef __mc68000
    437 static inline int testandset (int *p)
    438 {
    439     char ret;
    440     __asm__ __volatile__("tas %1; sne %0"
    441                          : "=r" (ret)
    442                          : "m" (p)
    443                          : "cc","memory");
    444     return ret;
    445 }
    446 #endif
    447 
    448 #ifdef __ia64
    449 #include <ia64intrin.h>
    450 
    451 static inline int testandset (int *p)
    452 {
    453     return __sync_lock_test_and_set (p, 1);
    454 }
    455 #endif
    456 
    457 typedef int spinlock_t;
    458 
    459 #define SPIN_LOCK_UNLOCKED 0
    460 
    461 #if defined(CONFIG_USER_ONLY)
    462 static inline void spin_lock(spinlock_t *lock)
    463 {
    464     while (testandset(lock));
    465 }
    466 
    467 static inline void spin_unlock(spinlock_t *lock)
    468 {
    469     *lock = 0;
    470 }
    471 
    472 static inline int spin_trylock(spinlock_t *lock)
    473 {
    474     return !testandset(lock);
    475 }
    476 #else
    477 static inline void spin_lock(spinlock_t *lock)
    478 {
    479 }
    480 
    481 static inline void spin_unlock(spinlock_t *lock)
    482 {
    483 }
    484 
    485 static inline int spin_trylock(spinlock_t *lock)
    486 {
    487     return 1;
    488 }
    489 #endif
     313#include "qemu-lock.h"
    490314
    491315extern spinlock_t tb_lock;
     
    497321void tlb_fill(target_ulong addr, int is_write, int is_user,
    498322              void *retaddr);
     323
     324#include "softmmu_defs.h"
    499325
    500326#define ACCESS_TYPE (NB_MMU_MODES + 1)
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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