WARN_ON_ONCE(debug_locks && !this_cpu_read(hardirq_context));   \
 } while (0)
 
+#define lockdep_assert_preemption_enabled()                            \
+do {                                                                   \
+       WARN_ON_ONCE(IS_ENABLED(CONFIG_PREEMPT_COUNT)   &&              \
+                    debug_locks                        &&              \
+                    (preempt_count() != 0              ||              \
+                     !this_cpu_read(hardirqs_enabled)));               \
+} while (0)
+
+#define lockdep_assert_preemption_disabled()                           \
+do {                                                                   \
+       WARN_ON_ONCE(IS_ENABLED(CONFIG_PREEMPT_COUNT)   &&              \
+                    debug_locks                        &&              \
+                    (preempt_count() == 0              &&              \
+                     this_cpu_read(hardirqs_enabled)));                \
+} while (0)
+
 #else
 # define might_lock(lock) do { } while (0)
 # define might_lock_read(lock) do { } while (0)
 # define lockdep_assert_irqs_enabled() do { } while (0)
 # define lockdep_assert_irqs_disabled() do { } while (0)
 # define lockdep_assert_in_irq() do { } while (0)
+
+# define lockdep_assert_preemption_enabled() do { } while (0)
+# define lockdep_assert_preemption_disabled() do { } while (0)
 #endif
 
 #ifdef CONFIG_PROVE_RAW_LOCK_NESTING