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