cmake:complete missing changes during cmake reforming for mm
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
parent
b1cc5b50b1
commit
5b6488f09f
@ -20,11 +20,7 @@
|
|||||||
|
|
||||||
if(CONFIG_MM_IOB)
|
if(CONFIG_MM_IOB)
|
||||||
|
|
||||||
set(SRCS)
|
set(SRCS
|
||||||
|
|
||||||
list(
|
|
||||||
APPEND
|
|
||||||
SRCS
|
|
||||||
iob_add_queue.c
|
iob_add_queue.c
|
||||||
iob_alloc.c
|
iob_alloc.c
|
||||||
iob_alloc_qentry.c
|
iob_alloc_qentry.c
|
||||||
@ -61,6 +57,9 @@ if(CONFIG_MM_IOB)
|
|||||||
list(APPEND SRCS iob_dump.c)
|
list(APPEND SRCS iob_dump.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_IOB_SECTION)
|
||||||
|
target_compile_options(mm PRIVATE -DIOB_SECTION=CONFIG_IOB_SECTION)
|
||||||
|
endif()
|
||||||
target_sources(mm PRIVATE ${SRCS})
|
target_sources(mm PRIVATE ${SRCS})
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -22,11 +22,7 @@
|
|||||||
|
|
||||||
if(CONFIG_MM_KERNEL_HEAP)
|
if(CONFIG_MM_KERNEL_HEAP)
|
||||||
|
|
||||||
set(SRCS)
|
set(SRCS
|
||||||
|
|
||||||
list(
|
|
||||||
APPEND
|
|
||||||
SRCS
|
|
||||||
kmm_initialize.c
|
kmm_initialize.c
|
||||||
kmm_addregion.c
|
kmm_addregion.c
|
||||||
kmm_malloc_size.c
|
kmm_malloc_size.c
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
# the License.
|
# the License.
|
||||||
#
|
#
|
||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
set(SRCS)
|
set(SRCS mm_map.c)
|
||||||
list(APPEND SRCS mm_map.c)
|
|
||||||
|
|
||||||
if(CONFIG_ARCH_VMA_MAPPING)
|
if(CONFIG_ARCH_VMA_MAPPING)
|
||||||
list(APPEND SRCS vm_region.c)
|
list(APPEND SRCS vm_region.c)
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
# the License.
|
# the License.
|
||||||
#
|
#
|
||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
set(SRCS)
|
set(SRCS mempool.c mempool_multiple.c)
|
||||||
list(APPEND SRCS mempool.c mempool_multiple.c)
|
|
||||||
|
|
||||||
if(CONFIG_FS_PROCFS)
|
if(CONFIG_FS_PROCFS)
|
||||||
if(NOT CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL)
|
if(NOT CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL)
|
||||||
|
@ -21,11 +21,8 @@
|
|||||||
# An optional granule allocator
|
# An optional granule allocator
|
||||||
|
|
||||||
if(CONFIG_GRAN)
|
if(CONFIG_GRAN)
|
||||||
set(SRCS)
|
|
||||||
|
|
||||||
list(
|
set(SRCS
|
||||||
APPEND
|
|
||||||
SRCS
|
|
||||||
mm_graninit.c
|
mm_graninit.c
|
||||||
mm_granrelease.c
|
mm_granrelease.c
|
||||||
mm_granreserve.c
|
mm_granreserve.c
|
||||||
|
@ -22,11 +22,7 @@
|
|||||||
|
|
||||||
if(CONFIG_MM_DEFAULT_MANAGER)
|
if(CONFIG_MM_DEFAULT_MANAGER)
|
||||||
|
|
||||||
set(SRCS)
|
set(SRCS
|
||||||
|
|
||||||
list(
|
|
||||||
APPEND
|
|
||||||
SRCS
|
|
||||||
mm_initialize.c
|
mm_initialize.c
|
||||||
mm_lock.c
|
mm_lock.c
|
||||||
mm_addfreechunk.c
|
mm_addfreechunk.c
|
||||||
|
@ -21,5 +21,5 @@
|
|||||||
# Shared memory allocator
|
# Shared memory allocator
|
||||||
|
|
||||||
if(CONFIG_MM_SHM)
|
if(CONFIG_MM_SHM)
|
||||||
target_sources(mm PRIVATE shm_initialize.c shmat.c shmctl.c shmdt.c shmget.c)
|
target_sources(mm PRIVATE shmat.c shmctl.c shmdt.c shmget.c)
|
||||||
endif()
|
endif()
|
||||||
|
75
mm/tlsf/CMakeLists.txt
Normal file
75
mm/tlsf/CMakeLists.txt
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
# ##############################################################################
|
||||||
|
# mm/tlsf/CMakeLists.txt
|
||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||||
|
# license agreements. See the NOTICE file distributed with this work for
|
||||||
|
# additional information regarding copyright ownership. The ASF licenses this
|
||||||
|
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
# the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations under
|
||||||
|
# the License.
|
||||||
|
#
|
||||||
|
# ##############################################################################
|
||||||
|
|
||||||
|
if(CONFIG_MM_TLSF_MANAGER)
|
||||||
|
|
||||||
|
# ############################################################################
|
||||||
|
# Config and Fetch tlsf
|
||||||
|
# ########################################################################TLSF
|
||||||
|
|
||||||
|
set(TLSF_DIR ${CMAKE_CURRENT_LIST_DIR}/tlsf)
|
||||||
|
|
||||||
|
if(NOT EXISTS ${TLSF_DIR})
|
||||||
|
FetchContent_Declare(
|
||||||
|
tlsf_fetch
|
||||||
|
GIT_REPOSITORY https://github.com/mattconte/tlsf.git
|
||||||
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/tlsf BINARY_DIR
|
||||||
|
${CMAKE_BINARY_DIR}/mm/tlsf/tlsf
|
||||||
|
PATCH_COMMAND
|
||||||
|
patch -p1 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/0001-Add-TLSF_API-and-tlsf_printf.patch &&
|
||||||
|
patch -p1 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
|
||||||
|
&& patch -p1 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
|
||||||
|
&& patch -p1 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/0004-Add-tlsf_extend_pool-function.patch &&
|
||||||
|
patch -p1 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/0005-Fix-warnining-on-implicit-pointer-conversion.patch
|
||||||
|
DOWNLOAD_NO_PROGRESS true
|
||||||
|
TIMEOUT 30)
|
||||||
|
|
||||||
|
FetchContent_GetProperties(tlsf_fetch)
|
||||||
|
|
||||||
|
if(NOT tlsf_fetch_POPULATED)
|
||||||
|
FetchContent_Populate(tlsf_fetch)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ############################################################################
|
||||||
|
# Flags
|
||||||
|
# ############################################################################
|
||||||
|
|
||||||
|
set(CFLAGS -Dtlsf_printf=if\(0\)printf)
|
||||||
|
|
||||||
|
# ############################################################################
|
||||||
|
# Sources
|
||||||
|
# ############################################################################
|
||||||
|
|
||||||
|
set(CSRCS mm_tlsf.c ${TLSF_DIR}/tlsf.c)
|
||||||
|
|
||||||
|
# ############################################################################
|
||||||
|
# Library Configuration
|
||||||
|
# ############################################################################
|
||||||
|
|
||||||
|
target_sources(mm PRIVATE ${CSRCS})
|
||||||
|
target_compile_options(mm PRIVATE ${CFLAGS})
|
||||||
|
|
||||||
|
endif()
|
25
mm/ubsan/CMakeLists.txt
Normal file
25
mm/ubsan/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# ##############################################################################
|
||||||
|
# mm/ubsan/CMakeLists.txt
|
||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||||
|
# license agreements. See the NOTICE file distributed with this work for
|
||||||
|
# additional information regarding copyright ownership. The ASF licenses this
|
||||||
|
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
# the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations under
|
||||||
|
# the License.
|
||||||
|
#
|
||||||
|
# ##############################################################################
|
||||||
|
|
||||||
|
if(CONFIG_MM_UBSAN)
|
||||||
|
|
||||||
|
target_sources(mm PRIVATE ubsan.c)
|
||||||
|
|
||||||
|
endif()
|
@ -20,11 +20,7 @@
|
|||||||
|
|
||||||
# User heap allocator
|
# User heap allocator
|
||||||
|
|
||||||
set(SRCS)
|
set(SRCS
|
||||||
|
|
||||||
list(
|
|
||||||
APPEND
|
|
||||||
SRCS
|
|
||||||
umm_initialize.c
|
umm_initialize.c
|
||||||
umm_addregion.c
|
umm_addregion.c
|
||||||
umm_brkaddr.c
|
umm_brkaddr.c
|
||||||
@ -37,7 +33,9 @@ list(
|
|||||||
umm_realloc.c
|
umm_realloc.c
|
||||||
umm_zalloc.c
|
umm_zalloc.c
|
||||||
umm_heapmember.c
|
umm_heapmember.c
|
||||||
umm_globals.c)
|
umm_globals.c
|
||||||
|
umm_memdump.c
|
||||||
|
umm_malloc_size.c)
|
||||||
|
|
||||||
if(CONFIG_BUILD_KERNEL)
|
if(CONFIG_BUILD_KERNEL)
|
||||||
list(APPEND SRCS umm_sbrk.c)
|
list(APPEND SRCS umm_sbrk.c)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user