# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the linux memory manager.
#
KASAN_SANITIZE_slab_common.o := n
KASAN_SANITIZE_slab.o := n
KASAN_SANITIZE_slub.o := n
# These files are disabled because they produce non-interesting and/or
# flaky coverage that is not a function of syscall inputs. E.g. slab is out of
# free pages, or a task is migrated between nodes.
KCOV_INSTRUMENT_slab_common.o := n
KCOV_INSTRUMENT_slob.o := n
KCOV_INSTRUMENT_slab.o := n
KCOV_INSTRUMENT_slub.o := n
KCOV_INSTRUMENT_page_alloc.o := n
KCOV_INSTRUMENT_debug-pagealloc.o := n
KCOV_INSTRUMENT_kmemleak.o := n
KCOV_INSTRUMENT_memcontrol.o := n
KCOV_INSTRUMENT_mmzone.o := n
KCOV_INSTRUMENT_vmstat.o := n
CFLAGS_init-mm.o += $(call cc-disable-warning, override-init)
CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides)
mmu-y := nommu.o
mmu-$([31mCONFIG_MMU[0m) := highmem.o memory.o mincore.o \
mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \
msync.o page_vma_mapped.o pagewalk.o \
pgtable-generic.o rmap.o vmalloc.o
ifdef [31mCONFIG_CROSS_MEMORY_ATTACH[0m
mmu-$([31mCONFIG_MMU[0m) += process_vm_access.o
endif
obj-y := filemap.o mempool.o oom_kill.o fadvise.o \
maccess.o page-writeback.o \
readahead.o swap.o truncate.o vmscan.o shmem.o \
util.o mmzone.o vmstat.o backing-dev.o \
mm_init.o mmu_context.o percpu.o slab_common.o \
compaction.o vmacache.o \
interval_tree.o list_lru.o workingset.o \
debug.o gup.o $(mmu-y)
# Give 'page_alloc' its own module-parameter namespace
page-alloc-y := page_alloc.o
page-alloc-$([31mCONFIG_SHUFFLE_PAGE_ALLOCATOR[0m) += shuffle.o
obj-y += page-alloc.o
obj-y += init-mm.o
obj-y += memblock.o
ifdef [31mCONFIG_MMU[0m
obj-$([31mCONFIG_ADVISE_SYSCALLS[0m) += madvise.o
endif
obj-$([31mCONFIG_SWAP[0m) += page_io.o swap_state.o swapfile.o swap_slots.o
obj-$([31mCONFIG_FRONTSWAP[0m) += frontswap.o
obj-$([31mCONFIG_ZSWAP[0m) += zswap.o
obj-$([31mCONFIG_HAS_DMA[0m) += dmapool.o
obj-$([31mCONFIG_HUGETLBFS[0m) += hugetlb.o
obj-$([31mCONFIG_NUMA[0m) += mempolicy.o
obj-$([31mCONFIG_SPARSEMEM[0m) += sparse.o
obj-$([31mCONFIG_SPARSEMEM_VMEMMAP[0m) += sparse-vmemmap.o
obj-$([31mCONFIG_SLOB[0m) += slob.o
obj-$([31mCONFIG_MMU_NOTIFIER[0m) += mmu_notifier.o
obj-$([31mCONFIG_KSM[0m) += ksm.o
obj-$([31mCONFIG_PAGE_POISONING[0m) += page_poison.o
obj-$([31mCONFIG_SLAB[0m) += slab.o
obj-$([31mCONFIG_SLUB[0m) += slub.o
obj-$([31mCONFIG_KASAN[0m) += kasan/
obj-$([31mCONFIG_FAILSLAB[0m) += failslab.o
obj-$([31mCONFIG_MEMORY_HOTPLUG[0m) += memory_hotplug.o
obj-$([31mCONFIG_MEMTEST[0m) += memtest.o
obj-$([31mCONFIG_MIGRATION[0m) += migrate.o
obj-$([31mCONFIG_TRANSPARENT_HUGEPAGE[0m) += huge_memory.o khugepaged.o
obj-$([31mCONFIG_PAGE_COUNTER[0m) += page_counter.o
obj-$([31mCONFIG_MEMCG[0m) += memcontrol.o vmpressure.o
obj-$([31mCONFIG_MEMCG_SWAP[0m) += swap_cgroup.o
obj-$([31mCONFIG_CGROUP_HUGETLB[0m) += hugetlb_cgroup.o
obj-$([31mCONFIG_GUP_BENCHMARK[0m) += gup_benchmark.o
obj-$([31mCONFIG_MEMORY_FAILURE[0m) += memory-failure.o
obj-$([31mCONFIG_HWPOISON_INJECT[0m) += hwpoison-inject.o
obj-$([31mCONFIG_DEBUG_KMEMLEAK[0m) += kmemleak.o
obj-$([31mCONFIG_DEBUG_KMEMLEAK_TEST[0m) += kmemleak-test.o
obj-$([31mCONFIG_DEBUG_RODATA_TEST[0m) += rodata_test.o
obj-$([31mCONFIG_PAGE_OWNER[0m) += page_owner.o
obj-$([31mCONFIG_CLEANCACHE[0m) += cleancache.o
obj-$([31mCONFIG_MEMORY_ISOLATION[0m) += page_isolation.o
obj-$([31mCONFIG_ZPOOL[0m) += zpool.o
obj-$([31mCONFIG_ZBUD[0m) += zbud.o
obj-$([31mCONFIG_ZSMALLOC[0m) += zsmalloc.o
obj-$([31mCONFIG_Z3FOLD[0m) += z3fold.o
obj-$([31mCONFIG_GENERIC_EARLY_IOREMAP[0m) += early_ioremap.o
obj-$([31mCONFIG_CMA[0m) += cma.o
obj-$([31mCONFIG_MEMORY_BALLOON[0m) += balloon_compaction.o
obj-$([31mCONFIG_PAGE_EXTENSION[0m) += page_ext.o
obj-$([31mCONFIG_CMA_DEBUGFS[0m) += cma_debug.o
obj-$([31mCONFIG_USERFAULTFD[0m) += userfaultfd.o
obj-$([31mCONFIG_IDLE_PAGE_TRACKING[0m) += page_idle.o
obj-$([31mCONFIG_FRAME_VECTOR[0m) += frame_vector.o
obj-$([31mCONFIG_DEBUG_PAGE_REF[0m) += debug_page_ref.o
obj-$([31mCONFIG_HARDENED_USERCOPY[0m) += usercopy.o
obj-$([31mCONFIG_PERCPU_STATS[0m) += percpu-stats.o
obj-$([31mCONFIG_ZONE_DEVICE[0m) += memremap.o
obj-$([31mCONFIG_HMM_MIRROR[0m) += hmm.o
obj-$([31mCONFIG_MEMFD_CREATE[0m) += memfd.o