/fs/fscache/

='wip-aedzl-final'>wip-aedzl-final The LITMUS^RT kernel.Bjoern Brandenburg
aboutsummaryrefslogblamecommitdiffstats
path: root/lib/spinlock_debug.c
blob: 479fd462eaa9c7630df676bdddd91d4dd1212a2c (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                             
                           
                      
                            
                              
                        
                         
 







                                                                
                                                       
















                                                                  
                                                       








                                                               

                                                       

                                         














                                                                    



                                                                            

                                        

























                                                                               
              

                                         

                  
                                             

                                                                
                                   



                                       

                                                                            

                                                                      
                                     


                                                    


































                                                           






                                                                  



                                                                                
                                                                            

                                             
              

                                         

                  
                                             

                                                                
                                   



                                       

                                                                             

                                                                      



                                     
      



                                                                      
                                         












































                                                                               
                                            

                                              
              

                                         

                  
                                             

                                                                 
                                   



                                       

                                                                              

                                                                      



                                     
      



                                      
                                          






















                                                           
/*
 * Copyright 2005, Red Hat, Inc., Ingo Molnar
 * Released under the General Public License (GPL).
 *
 * This file contains the spinlock/rwlock implementations for
 * DEBUG_SPINLOCK.
 */

#include <linux/spinlock.h>
#include <linux/nmi.h>
#include <linux/interrupt.h>
#include <linux/debug_locks.h>
#include <linux/delay.h>
#include <linux/module.h>

void __spin_lock_init(spinlock_t *lock, const char *name,
		      struct lock_class_key *key)
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	/*
	 * Make sure we are not reinitializing a held lock:
	 */
	debug_check_no_locks_freed((void *)lock, sizeof(*lock));
	lockdep_init_map(&lock->dep_map, name, key, 0);
#endif
	lock->raw_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
	lock->magic = SPINLOCK_MAGIC;
	lock->owner = SPINLOCK_OWNER_INIT;
	lock->owner_cpu = -1;
}

EXPORT_SYMBOL(__spin_lock_init);

void __rwlock_init(rwlock_t *lock, const char *name,
		   struct lock_class_key *key)
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	/*
	 * Make sure we are not reinitializing a held lock:
	 */
	debug_check_no_locks_freed((void *)lock, sizeof(*lock));