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 | |
Ingo Molnar | 087052b | 2008-10-17 16:09:57 +0200 | [diff] [blame] | 10 | static inline void |
Thomas Gleixner | 445c895 | 2009-12-02 19:49:50 +0100 | [diff] [blame] | 11 | default_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) |
Jeremy Fitzhardinge | 63d3a75 | 2008-08-19 13:19:36 -0700 | [diff] [blame] | 12 | { |
Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 13 | arch_spin_lock(lock); |
Jeremy Fitzhardinge | 63d3a75 | 2008-08-19 13:19:36 -0700 | [diff] [blame] | 14 | } |
| 15 | |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 16 | struct pv_lock_ops pv_lock_ops = { |
| 17 | #ifdef CONFIG_SMP |
| 18 | .spin_is_locked = __ticket_spin_is_locked, |
| 19 | .spin_is_contended = __ticket_spin_is_contended, |
| 20 | |
| 21 | .spin_lock = __ticket_spin_lock, |
Jeremy Fitzhardinge | 63d3a75 | 2008-08-19 13:19:36 -0700 | [diff] [blame] | 22 | .spin_lock_flags = default_spin_lock_flags, |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 23 | .spin_trylock = __ticket_spin_trylock, |
| 24 | .spin_unlock = __ticket_spin_unlock, |
| 25 | #endif |
| 26 | }; |
Jeremy Fitzhardinge | 25258ef | 2008-08-20 11:31:07 -0700 | [diff] [blame] | 27 | EXPORT_SYMBOL(pv_lock_ops); |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 28 | |