vbox的更動 13337 路徑 trunk/src/recompiler_new/exec-all.h
- 時間撮記:
- 2008-10-16 上午11:59:21 (16 年 以前)
- svn:sync-xref-src-repo-rev:
- 38026
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/recompiler_new/exec-all.h
r13230 r13337 44 44 #endif /* VBOX */ 45 45 46 #ifndef glue47 #define xglue(x, y) x ## y48 #define glue(x, y) xglue(x, y)49 #define stringify(s) tostring(s)50 #define tostring(s) #s51 #endif52 53 #if __GNUC__ < 354 #define __builtin_expect(x, n) (x)55 #endif56 57 #ifdef __i386__58 #define REGPARM(n) __attribute((regparm(n)))59 #else60 #define REGPARM(n)61 #endif62 63 46 /* is_jmp field values */ 64 47 #define DISAS_NEXT 0 /* next instruction can be analyzed */ … … 97 80 typedef void (GenOpFunc3)(long, long, long); 98 81 99 #ifndef VBOX 100 extern FILE *logfile; 101 extern int loglevel; 102 #endif 82 #include "qemu-log.h" 103 83 104 84 void gen_intermediate_code(CPUState *env, struct TranslationBlock *tb); … … 171 151 target_ulong pc; /* simulated PC corresponding to this block (EIP + CS base) */ 172 152 target_ulong cs_base; /* CS base for this block */ 173 u nsigned int flags; /* flags defining in which context the code was generated */153 uint64_t flags; /* flags defining in which context the code was generated */ 174 154 uint16_t size; /* size of target code for this block (1 <= 175 155 size <= TARGET_PAGE_SIZE) */ … … 199 179 # error "First 4GB aren't reachable. jmp dword [tb_next] wont work." 200 180 # endif 201 u int32_ttb_next[2]; /* address of jump generated code */181 unsigned long tb_next[2]; /* address of jump generated code */ 202 182 #endif 203 183 /* list of TBs jumping to this one. This is a circular list using … … 331 311 extern void *io_mem_opaque[IO_MEM_NB_ENTRIES]; 332 312 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" 490 314 491 315 extern spinlock_t tb_lock; … … 497 321 void tlb_fill(target_ulong addr, int is_write, int is_user, 498 322 void *retaddr); 323 324 #include "softmmu_defs.h" 499 325 500 326 #define ACCESS_TYPE (NB_MMU_MODES + 1)
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器