Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Split spinlock implementation out into its own file, so it can be |
| 3 | * compiled in a FTRACE-compatible way. |
| 4 | */ |
| 5 | #include <linux/spinlock.h> |
| 6 | #include <linux/module.h> |
| 7 | |
| 8 | #include <asm/paravirt.h> |
| 9 | |
| 10 | struct pv_lock_ops pv_lock_ops = { |
| 11 | #ifdef CONFIG_SMP |
| 12 | .spin_is_locked = __ticket_spin_is_locked, |
| 13 | .spin_is_contended = __ticket_spin_is_contended, |
| 14 | |
| 15 | .spin_lock = __ticket_spin_lock, |
| 16 | .spin_trylock = __ticket_spin_trylock, |
| 17 | .spin_unlock = __ticket_spin_unlock, |
| 18 | #endif |
| 19 | }; |
| 20 | EXPORT_SYMBOL_GPL(pv_lock_ops); |
| 21 | |
| 22 | void __init paravirt_use_bytelocks(void) |
| 23 | { |
| 24 | #ifdef CONFIG_SMP |
| 25 | pv_lock_ops.spin_is_locked = __byte_spin_is_locked; |
| 26 | pv_lock_ops.spin_is_contended = __byte_spin_is_contended; |
| 27 | pv_lock_ops.spin_lock = __byte_spin_lock; |
| 28 | pv_lock_ops.spin_trylock = __byte_spin_trylock; |
| 29 | pv_lock_ops.spin_unlock = __byte_spin_unlock; |
| 30 | #endif |
| 31 | } |