Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Any varying coverage in these files is non-deterministic
  3. # and is generally not a function of system call inputs.
  4. KCOV_INSTRUMENT := n
  5. UBSAN_SANITIZE_lockdep.o := n
  6. ccflags-y += -I$(srctree)/
  7. ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/
  8. obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o
  9. ifdef CONFIG_FUNCTION_TRACER
  10. CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE)
  11. CFLAGS_REMOVE_lockdep_proc.o = $(CC_FLAGS_FTRACE)
  12. CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS_FTRACE)
  13. CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE)
  14. endif
  15. ifeq ($(CONFIG_PROVE_LOCKING),y)
  16. ccflags-y += -DMTK_LOCK_DEBUG_NEW_DEPENDENCY
  17. endif
  18. ifeq ($(CONFIG_DEBUG_LOCK_ALLOC),y)
  19. ifneq (y, $(filter y, $(CONFIG_KASAN) $(CONFIG_UBSAN)))
  20. ccflags-y += -DMTK_LOCK_MONITOR
  21. endif
  22. endif
  23. ifeq ($(CONFIG_LOCKDEP),y)
  24. ccflags-y += -DMTK_ENHANCE_LOCKDEP_PROC
  25. endif
  26. ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
  27. ifeq ($(CONFIG_MACH_MT6771),y)
  28. ccflags-y += -DMTK_DEBUG_SPINLOCK_V2
  29. else
  30. ccflags-y += -DMTK_DEBUG_SPINLOCK_V1
  31. endif
  32. endif
  33. obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
  34. obj-$(CONFIG_LOCKDEP) += lockdep.o
  35. ifeq ($(CONFIG_PROC_FS),y)
  36. obj-$(CONFIG_LOCKDEP) += lockdep_proc.o lockdep_test.o
  37. endif
  38. obj-$(CONFIG_SMP) += spinlock.o
  39. obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o
  40. obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
  41. obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o
  42. obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
  43. obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
  44. obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
  45. obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
  46. obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
  47. obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem-xadd.o
  48. obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o
  49. obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o
  50. obj-$(CONFIG_WW_MUTEX_SELFTEST) += test-ww_mutex.o