/* SPDX-License-Identifier: GPL-2.0 */ /* * Runtime locking correctness validator * * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <[email protected]> * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra * * see Documentation/locking/lockdep-design.rst for more details. */ #ifndef __LINUX_LOCKDEP_TYPES_H #define __LINUX_LOCKDEP_TYPES_H #include <linux/types.h> #define MAX_LOCKDEP_SUBCLASSES … enum lockdep_wait_type { … }; enum lockdep_lock_type { … }; #ifdef CONFIG_LOCKDEP /* * We'd rather not expose kernel/lockdep_states.h this wide, but we do need * the total number of states... :-( * * XXX_LOCK_USAGE_STATES is the number of lines in lockdep_states.h, for each * of those we generates 4 states, Additionally we report on USED and USED_READ. */ #define XXX_LOCK_USAGE_STATES … #define LOCK_TRACE_STATES … /* * NR_LOCKDEP_CACHING_CLASSES ... Number of classes * cached in the instance of lockdep_map * * Currently main class (subclass == 0) and single depth subclass * are cached in lockdep_map. This optimization is mainly targeting * on rq->lock. double_rq_lock() acquires this highly competitive with * single depth. */ #define NR_LOCKDEP_CACHING_CLASSES … /* * A lockdep key is associated with each lock object. For static locks we use * the lock address itself as the key. Dynamically allocated lock objects can * have a statically or dynamically allocated key. Dynamically allocated lock * keys must be registered before being used and must be unregistered before * the key memory is freed. */ struct lockdep_subclass_key { … } __attribute__ ((packed)); /* hash_entry is used to keep track of dynamically allocated keys. */ struct lock_class_key { … }; extern struct lock_class_key __lockdep_no_validate__; extern struct lock_class_key __lockdep_no_track__; struct lock_trace; #define LOCKSTAT_POINTS … struct lockdep_map; lock_cmp_fn; lock_print_fn; /* * The lock-class itself. The order of the structure members matters. * reinit_class() zeroes the key member and all subsequent members. */ struct lock_class { … } __no_randomize_layout; #ifdef CONFIG_LOCK_STAT struct lock_time { … }; enum bounce_type { … }; struct lock_class_stats { … }; struct lock_class_stats lock_stats(struct lock_class *class); void clear_lock_stats(struct lock_class *class); #endif /* * Map the lock object (the lock instance) to the lock-class object. * This is embedded into specific lock instances: */ struct lockdep_map { … }; struct pin_cookie { … }; #define MAX_LOCKDEP_KEYS_BITS … #define MAX_LOCKDEP_KEYS … #define INITIAL_CHAIN_KEY … struct held_lock { … }; #else /* !CONFIG_LOCKDEP */ /* * The class key takes no space if lockdep is disabled: */ struct lock_class_key { }; /* * The lockdep_map takes no space if lockdep is disabled: */ struct lockdep_map { }; struct pin_cookie { }; #endif /* !LOCKDEP */ #endif /* __LINUX_LOCKDEP_TYPES_H */