diff options
Diffstat (limited to 'arch/blackfin/kernel/ipipe.c')
| -rw-r--r-- | arch/blackfin/kernel/ipipe.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c index 5d7382396dc0..a77307a4473b 100644 --- a/arch/blackfin/kernel/ipipe.c +++ b/arch/blackfin/kernel/ipipe.c | |||
| @@ -335,3 +335,70 @@ void __ipipe_enable_root_irqs_hw(void) | |||
| 335 | __clear_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)); | 335 | __clear_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)); |
| 336 | bfin_sti(bfin_irq_flags); | 336 | bfin_sti(bfin_irq_flags); |
| 337 | } | 337 | } |
| 338 | |||
| 339 | /* | ||
| 340 | * We could use standard atomic bitops in the following root status | ||
| 341 | * manipulation routines, but let's prepare for SMP support in the | ||
| 342 | * same move, preventing CPU migration as required. | ||
| 343 | */ | ||
| 344 | void __ipipe_stall_root(void) | ||
| 345 | { | ||
| 346 | unsigned long *p, flags; | ||
| 347 | |||
| 348 | local_irq_save_hw(flags); | ||
| 349 | p = &__ipipe_root_status; | ||
| 350 | __set_bit(IPIPE_STALL_FLAG, p); | ||
| 351 | local_irq_restore_hw(flags); | ||
| 352 | } | ||
| 353 | EXPORT_SYMBOL(__ipipe_stall_root); | ||
| 354 | |||
| 355 | unsigned long __ipipe_test_and_stall_root(void) | ||
| 356 | { | ||
| 357 | unsigned long *p, flags; | ||
| 358 | int x; | ||
| 359 | |||
| 360 | local_irq_save_hw(flags); | ||
| 361 | p = &__ipipe_root_status; | ||
| 362 | x = __test_and_set_bit(IPIPE_STALL_FLAG, p); | ||
| 363 | local_irq_restore_hw(flags); | ||
| 364 | |||
| 365 | return x; | ||
| 366 | } | ||
| 367 | EXPORT_SYMBOL(__ipipe_test_and_stall_root); | ||
| 368 | |||
| 369 | unsigned long __ipipe_test_root(void) | ||
| 370 | { | ||
| 371 | const unsigned long *p; | ||
| 372 | unsigned long flags; | ||
| 373 | int x; | ||
| 374 | |||
| 375 | local_irq_save_hw_smp(flags); | ||
| 376 | p = &__ipipe_root_status; | ||
| 377 | x = test_bit(IPIPE_STALL_FLAG, p); | ||
| 378 | local_irq_restore_hw_smp(flags); | ||
| 379 | |||
| 380 | return x; | ||
| 381 | } | ||
| 382 | EXPORT_SYMBOL(__ipipe_test_root); | ||
| 383 | |||
| 384 | void __ipipe_lock_root(void) | ||
| 385 | { | ||
| 386 | unsigned long *p, flags; | ||
| 387 | |||
| 388 | local_irq_save_hw(flags); | ||
| 389 | p = &__ipipe_root_status; | ||
| 390 | __set_bit(IPIPE_SYNCDEFER_FLAG, p); | ||
| 391 | local_irq_restore_hw(flags); | ||
| 392 | } | ||
| 393 | EXPORT_SYMBOL(__ipipe_lock_root); | ||
| 394 | |||
| 395 | void __ipipe_unlock_root(void) | ||
| 396 | { | ||
| 397 | unsigned long *p, flags; | ||
| 398 | |||
| 399 | local_irq_save_hw(flags); | ||
| 400 | p = &__ipipe_root_status; | ||
| 401 | __clear_bit(IPIPE_SYNCDEFER_FLAG, p); | ||
| 402 | local_irq_restore_hw(flags); | ||
| 403 | } | ||
| 404 | EXPORT_SYMBOL(__ipipe_unlock_root); | ||
