Commit 204a1b8d5ec12af7f0e4757f51802672fc2e6681

Authored by ths
1 parent 522777bb

Another #elif'ication.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2792 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 12 additions and 27 deletions
exec-all.h
@@ -357,7 +357,7 @@ extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4]; @@ -357,7 +357,7 @@ extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
357 extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4]; 357 extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];
358 extern void *io_mem_opaque[IO_MEM_NB_ENTRIES]; 358 extern void *io_mem_opaque[IO_MEM_NB_ENTRIES];
359 359
360 -#ifdef __powerpc__ 360 +#if defined(__powerpc__)
361 static inline int testandset (int *p) 361 static inline int testandset (int *p)
362 { 362 {
363 int ret; 363 int ret;
@@ -373,9 +373,7 @@ static inline int testandset (int *p) @@ -373,9 +373,7 @@ static inline int testandset (int *p)
373 : "cr0", "memory"); 373 : "cr0", "memory");
374 return ret; 374 return ret;
375 } 375 }
376 -#endif  
377 -  
378 -#ifdef __i386__ 376 +#elif defined(__i386__)
379 static inline int testandset (int *p) 377 static inline int testandset (int *p)
380 { 378 {
381 long int readval = 0; 379 long int readval = 0;
@@ -386,9 +384,7 @@ static inline int testandset (int *p) @@ -386,9 +384,7 @@ static inline int testandset (int *p)
386 : "cc"); 384 : "cc");
387 return readval; 385 return readval;
388 } 386 }
389 -#endif  
390 -  
391 -#ifdef __x86_64__ 387 +#elif defined(__x86_64__)
392 static inline int testandset (int *p) 388 static inline int testandset (int *p)
393 { 389 {
394 long int readval = 0; 390 long int readval = 0;
@@ -399,9 +395,7 @@ static inline int testandset (int *p) @@ -399,9 +395,7 @@ static inline int testandset (int *p)
399 : "cc"); 395 : "cc");
400 return readval; 396 return readval;
401 } 397 }
402 -#endif  
403 -  
404 -#ifdef __s390__ 398 +#elif defined(__s390__)
405 static inline int testandset (int *p) 399 static inline int testandset (int *p)
406 { 400 {
407 int ret; 401 int ret;
@@ -413,9 +407,7 @@ static inline int testandset (int *p) @@ -413,9 +407,7 @@ static inline int testandset (int *p)
413 : "cc", "memory" ); 407 : "cc", "memory" );
414 return ret; 408 return ret;
415 } 409 }
416 -#endif  
417 -  
418 -#ifdef __alpha__ 410 +#elif defined(__alpha__)
419 static inline int testandset (int *p) 411 static inline int testandset (int *p)
420 { 412 {
421 int ret; 413 int ret;
@@ -432,9 +424,7 @@ static inline int testandset (int *p) @@ -432,9 +424,7 @@ static inline int testandset (int *p)
432 : "m" (*p)); 424 : "m" (*p));
433 return ret; 425 return ret;
434 } 426 }
435 -#endif  
436 -  
437 -#ifdef __sparc__ 427 +#elif defined(__sparc__)
438 static inline int testandset (int *p) 428 static inline int testandset (int *p)
439 { 429 {
440 int ret; 430 int ret;
@@ -446,9 +436,7 @@ static inline int testandset (int *p) @@ -446,9 +436,7 @@ static inline int testandset (int *p)
446 436
447 return (ret ? 1 : 0); 437 return (ret ? 1 : 0);
448 } 438 }
449 -#endif  
450 -  
451 -#ifdef __arm__ 439 +#elif defined(__arm__)
452 static inline int testandset (int *spinlock) 440 static inline int testandset (int *spinlock)
453 { 441 {
454 register unsigned int ret; 442 register unsigned int ret;
@@ -458,9 +446,7 @@ static inline int testandset (int *spinlock) @@ -458,9 +446,7 @@ static inline int testandset (int *spinlock)
458 446
459 return ret; 447 return ret;
460 } 448 }
461 -#endif  
462 -  
463 -#ifdef __mc68000 449 +#elif defined(__mc68000)
464 static inline int testandset (int *p) 450 static inline int testandset (int *p)
465 { 451 {
466 char ret; 452 char ret;
@@ -470,18 +456,15 @@ static inline int testandset (int *p) @@ -470,18 +456,15 @@ static inline int testandset (int *p)
470 : "cc","memory"); 456 : "cc","memory");
471 return ret; 457 return ret;
472 } 458 }
473 -#endif 459 +#elif defined(__ia64)
474 460
475 -#ifdef __ia64  
476 #include <ia64intrin.h> 461 #include <ia64intrin.h>
477 462
478 static inline int testandset (int *p) 463 static inline int testandset (int *p)
479 { 464 {
480 return __sync_lock_test_and_set (p, 1); 465 return __sync_lock_test_and_set (p, 1);
481 } 466 }
482 -#endif  
483 -  
484 -#ifdef __mips__ 467 +#elif defined(__mips__)
485 static inline int testandset (int *p) 468 static inline int testandset (int *p)
486 { 469 {
487 int ret; 470 int ret;
@@ -501,6 +484,8 @@ static inline int testandset (int *p) @@ -501,6 +484,8 @@ static inline int testandset (int *p)
501 484
502 return ret; 485 return ret;
503 } 486 }
  487 +#else
  488 +#error unimplemented CPU support
504 #endif 489 #endif
505 490
506 typedef int spinlock_t; 491 typedef int spinlock_t;