You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/09/08 18:20:21 UTC

[nuttx] branch master updated (b756a7c3a9 -> d93d377257)

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from b756a7c3a9 socketcan : support error frame filter
     new b1cc5b50b1 cmake:complete missing changes during cmake reforming for fs
     new 5b6488f09f cmake:complete missing changes during cmake reforming for mm
     new d93d377257 cmake:complete missing changes during cmake reforming for sched

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 fs/hostfs/CMakeLists.txt                    | 14 +-----
 fs/littlefs/CMakeLists.txt                  | 20 ++++++--
 fs/partition/CMakeLists.txt                 | 15 +++++-
 fs/procfs/CMakeLists.txt                    |  1 +
 fs/rpmsgfs/CMakeLists.txt                   |  8 +--
 fs/shm/CMakeLists.txt                       |  2 +-
 fs/vfs/CMakeLists.txt                       |  6 +++
 mm/iob/CMakeLists.txt                       | 63 ++++++++++++------------
 mm/kmm_heap/CMakeLists.txt                  | 32 ++++++------
 mm/map/CMakeLists.txt                       |  3 +-
 mm/mempool/CMakeLists.txt                   |  3 +-
 mm/mm_gran/CMakeLists.txt                   | 21 ++++----
 mm/mm_heap/CMakeLists.txt                   | 42 ++++++++--------
 mm/shm/CMakeLists.txt                       |  2 +-
 mm/tlsf/CMakeLists.txt                      | 75 +++++++++++++++++++++++++++++
 {fs/binfs => mm/ubsan}/CMakeLists.txt       |  6 +--
 mm/umm_heap/CMakeLists.txt                  | 34 ++++++-------
 {fs/cromfs => sched/addrenv}/CMakeLists.txt |  6 +--
 sched/clock/CMakeLists.txt                  | 20 +++-----
 sched/group/CMakeLists.txt                  | 12 ++++-
 sched/irq/CMakeLists.txt                    |  5 +-
 sched/misc/CMakeLists.txt                   |  9 +++-
 sched/module/CMakeLists.txt                 |  4 +-
 sched/pthread/CMakeLists.txt                | 51 +++++++++-----------
 sched/semaphore/CMakeLists.txt              | 29 +++++------
 sched/signal/CMakeLists.txt                 | 60 +++++++++++------------
 sched/task/CMakeLists.txt                   | 48 ++++++++----------
 sched/wqueue/CMakeLists.txt                 |  3 +-
 28 files changed, 327 insertions(+), 267 deletions(-)
 create mode 100644 mm/tlsf/CMakeLists.txt
 copy {fs/binfs => mm/ubsan}/CMakeLists.txt (91%)
 copy {fs/cromfs => sched/addrenv}/CMakeLists.txt (90%)


[nuttx] 03/03: cmake:complete missing changes during cmake reforming for sched

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d93d377257b61158f46d1e4b16e5b6cace63b34c
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Thu Sep 7 14:37:59 2023 +0800

    cmake:complete missing changes during cmake reforming for sched
    
    Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
 sched/{misc => addrenv}/CMakeLists.txt |  7 ++--
 sched/clock/CMakeLists.txt             | 20 +++++-------
 sched/group/CMakeLists.txt             | 12 ++++++-
 sched/irq/CMakeLists.txt               |  5 +--
 sched/misc/CMakeLists.txt              |  9 ++++-
 sched/module/CMakeLists.txt            |  4 +--
 sched/pthread/CMakeLists.txt           | 51 ++++++++++++++---------------
 sched/semaphore/CMakeLists.txt         | 29 +++++++---------
 sched/signal/CMakeLists.txt            | 60 ++++++++++++++++------------------
 sched/task/CMakeLists.txt              | 48 ++++++++++++---------------
 sched/wqueue/CMakeLists.txt            |  3 +-
 11 files changed, 120 insertions(+), 128 deletions(-)

diff --git a/sched/misc/CMakeLists.txt b/sched/addrenv/CMakeLists.txt
similarity index 89%
copy from sched/misc/CMakeLists.txt
copy to sched/addrenv/CMakeLists.txt
index 86120f08ac..190eaf23bd 100644
--- a/sched/misc/CMakeLists.txt
+++ b/sched/addrenv/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# sched/sched/CMakeLists.txt
+# sched/addrenv/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
@@ -17,4 +17,7 @@
 # the License.
 #
 # ##############################################################################
-target_sources(sched PRIVATE assert.c panic_notifier.c reboot_notifier.c)
+
+if(CONFIG_ARCH_ADDRENV)
+  target_sources(sched PRIVATE addrenv.c)
+endif()
diff --git a/sched/clock/CMakeLists.txt b/sched/clock/CMakeLists.txt
index 3e74d43a80..1547a6f410 100644
--- a/sched/clock/CMakeLists.txt
+++ b/sched/clock/CMakeLists.txt
@@ -18,7 +18,14 @@
 #
 # ##############################################################################
 
-set(SRCS)
+set(SRCS
+    clock.c
+    clock_initialize.c
+    clock_settime.c
+    clock_gettime.c
+    clock_abstime2ticks.c
+    clock_systime_ticks.c
+    clock_systime_timespec.c)
 
 if(CONFIG_CLOCK_TIMEKEEPING)
   list(APPEND SRCS clock_timekeeping.c)
@@ -28,15 +35,4 @@ if(CONFIG_CLOCK_ADJTIME)
   list(APPEND SRCS clock_adjtime.c)
 endif()
 
-list(
-  APPEND
-  SRCS
-  clock.c
-  clock_initialize.c
-  clock_settime.c
-  clock_gettime.c
-  clock_abstime2ticks.c
-  clock_systime_ticks.c
-  clock_systime_timespec.c)
-
 target_sources(sched PRIVATE ${SRCS})
diff --git a/sched/group/CMakeLists.txt b/sched/group/CMakeLists.txt
index e9958ad24b..dd3fced7f8 100644
--- a/sched/group/CMakeLists.txt
+++ b/sched/group/CMakeLists.txt
@@ -40,7 +40,17 @@ elseif(CONFIG_SCHED_WAITPID)
 endif()
 
 if(CONFIG_SCHED_USER_IDENTITY)
-  list(APPEND SRCS group_setuid.c group_setgid.c group_getuid.c group_getgid.c)
+  list(
+    APPEND
+    SRCS
+    group_setuid.c
+    group_setgid.c
+    group_getuid.c
+    group_getgid.c
+    group_seteuid.c
+    group_setegid.c
+    group_geteuid.c
+    group_getegid.c)
 endif()
 
 if(CONFIG_SIG_SIGSTOP_ACTION)
diff --git a/sched/irq/CMakeLists.txt b/sched/irq/CMakeLists.txt
index 00e362950e..a1d9f77b27 100644
--- a/sched/irq/CMakeLists.txt
+++ b/sched/irq/CMakeLists.txt
@@ -18,7 +18,7 @@
 #
 # ##############################################################################
 
-set(SRCS)
+set(SRCS irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c)
 
 if(CONFIG_SMP)
   list(APPEND SRCS irq_spinlock.c)
@@ -39,7 +39,4 @@ if(CONFIG_IRQCHAIN)
   list(APPEND SRCS irq_chain.c)
 endif()
 
-list(APPEND SRCS irq_initialize.c irq_attach.c irq_dispatch.c
-     irq_unexpectedisr.c)
-
 target_sources(sched PRIVATE ${SRCS})
diff --git a/sched/misc/CMakeLists.txt b/sched/misc/CMakeLists.txt
index 86120f08ac..66f7927905 100644
--- a/sched/misc/CMakeLists.txt
+++ b/sched/misc/CMakeLists.txt
@@ -17,4 +17,11 @@
 # the License.
 #
 # ##############################################################################
-target_sources(sched PRIVATE assert.c panic_notifier.c reboot_notifier.c)
+
+set(SRCS assert.c panic_notifier.c reboot_notifier.c)
+
+if(CONFIG_ARCH_DEADLOCKDUMP)
+  list(APPEND SRCS deadlock.c)
+endif()
+
+target_sources(sched PRIVATE ${SRCS})
diff --git a/sched/module/CMakeLists.txt b/sched/module/CMakeLists.txt
index afa2c8f24f..36b252b714 100644
--- a/sched/module/CMakeLists.txt
+++ b/sched/module/CMakeLists.txt
@@ -19,13 +19,11 @@
 # ##############################################################################
 
 if(CONFIG_MODULE)
-  set(SRCS)
+  set(SRCS mod_insmod.c mod_rmmod.c mod_modsym.c mod_modhandle.c)
 
   if(CONFIG_FS_PROCFS AND NOT CONFIG_FS_PROCFS_EXCLUDE_MODULE)
     list(APPEND SRCS mod_procfs.c)
   endif()
 
-  list(APPEND SRCS mod_insmod.c mod_rmmod.c mod_modsym.c mod_modhandle.c)
-
   target_sources(sched PRIVATE ${SRCS})
 endif()
diff --git a/sched/pthread/CMakeLists.txt b/sched/pthread/CMakeLists.txt
index 84b3517a81..3e6675145b 100644
--- a/sched/pthread/CMakeLists.txt
+++ b/sched/pthread/CMakeLists.txt
@@ -19,34 +19,31 @@
 # ##############################################################################
 
 if(NOT CONFIG_DISABLE_PTHREAD)
-  set(SRCS)
 
-  list(
-    APPEND
-    SRCS
-    pthread_create.c
-    pthread_exit.c
-    pthread_join.c
-    pthread_detach.c
-    pthread_getschedparam.c
-    pthread_setschedparam.c
-    pthread_mutexinit.c
-    pthread_mutexdestroy.c
-    pthread_mutextimedlock.c
-    pthread_mutextrylock.c
-    pthread_mutexunlock.c
-    pthread_condwait.c
-    pthread_condsignal.c
-    pthread_condbroadcast.c
-    pthread_condclockwait.c
-    pthread_sigmask.c
-    pthread_cancel.c
-    pthread_initialize.c
-    pthread_completejoin.c
-    pthread_findjoininfo.c
-    pthread_release.c
-    pthread_setschedprio.c
-    pthread_barrierwait.c)
+  set(SRCS
+      pthread_create.c
+      pthread_exit.c
+      pthread_join.c
+      pthread_detach.c
+      pthread_getschedparam.c
+      pthread_setschedparam.c
+      pthread_mutexinit.c
+      pthread_mutexdestroy.c
+      pthread_mutextimedlock.c
+      pthread_mutextrylock.c
+      pthread_mutexunlock.c
+      pthread_condwait.c
+      pthread_condsignal.c
+      pthread_condbroadcast.c
+      pthread_condclockwait.c
+      pthread_sigmask.c
+      pthread_cancel.c
+      pthread_initialize.c
+      pthread_completejoin.c
+      pthread_findjoininfo.c
+      pthread_release.c
+      pthread_setschedprio.c
+      pthread_barrierwait.c)
 
   if(NOT CONFIG_PTHREAD_MUTEX_UNSAFE)
     list(APPEND SRCS pthread_mutex.c pthread_mutexconsistent.c
diff --git a/sched/semaphore/CMakeLists.txt b/sched/semaphore/CMakeLists.txt
index 8c74e0978a..cea7d21ac2 100644
--- a/sched/semaphore/CMakeLists.txt
+++ b/sched/semaphore/CMakeLists.txt
@@ -19,6 +19,18 @@
 # ##############################################################################
 
 # Add semaphore-related files to the build
+set(CSRCS
+    sem_destroy.c
+    sem_wait.c
+    sem_trywait.c
+    sem_tickwait.c
+    sem_timedwait.c
+    sem_clockwait.c
+    sem_timeout.c
+    sem_post.c
+    sem_recover.c
+    sem_reset.c
+    sem_waitirq.c)
 
 if(CONFIG_PRIORITY_INHERITANCE)
   list(APPEND CSRCS sem_initialize.c sem_holder.c sem_setprotocol.c)
@@ -28,21 +40,4 @@ if(CONFIG_SPINLOCK)
   list(APPEND CSRCS spinlock.c)
 endif()
 
-# Include semaphore build support
-
-list(
-  APPEND
-  CSRCS
-  sem_destroy.c
-  sem_wait.c
-  sem_trywait.c
-  sem_tickwait.c
-  sem_timedwait.c
-  sem_clockwait.c
-  sem_timeout.c
-  sem_post.c
-  sem_recover.c
-  sem_reset.c
-  sem_waitirq.c)
-
 target_sources(sched PRIVATE ${CSRCS})
diff --git a/sched/signal/CMakeLists.txt b/sched/signal/CMakeLists.txt
index bdee756dcf..de8a0fc98b 100644
--- a/sched/signal/CMakeLists.txt
+++ b/sched/signal/CMakeLists.txt
@@ -18,41 +18,37 @@
 #
 # ##############################################################################
 
-set(SRCS)
+set(SRCS
+    sig_initialize.c
+    sig_action.c
+    sig_procmask.c
+    sig_pending.c
+    sig_suspend.c
+    sig_kill.c
+    sig_tgkill.c
+    sig_queue.c
+    sig_waitinfo.c
+    sig_timedwait.c
+    sig_findaction.c
+    sig_allocpendingsigaction.c
+    sig_releasependingsigaction.c
+    sig_unmaskpendingsignal.c
+    sig_removependingsignal.c
+    sig_releasependingsignal.c
+    sig_lowest.c
+    sig_notification.c
+    sig_cleanup.c
+    sig_dispatch.c
+    sig_deliver.c
+    sig_pause.c
+    sig_nanosleep.c
+    sig_usleep.c
+    sig_sleep.c
+    sig_ppoll.c
+    sig_pselect.c)
 
 if(CONFIG_SIG_DEFAULT)
   list(APPEND SRCS sig_default.c)
 endif()
 
-list(
-  APPEND
-  SRCS
-  sig_initialize.c
-  sig_action.c
-  sig_procmask.c
-  sig_pending.c
-  sig_suspend.c
-  sig_kill.c
-  sig_tgkill.c
-  sig_queue.c
-  sig_waitinfo.c
-  sig_timedwait.c
-  sig_findaction.c
-  sig_allocpendingsigaction.c
-  sig_releasependingsigaction.c
-  sig_unmaskpendingsignal.c
-  sig_removependingsignal.c
-  sig_releasependingsignal.c
-  sig_lowest.c
-  sig_notification.c
-  sig_cleanup.c
-  sig_dispatch.c
-  sig_deliver.c
-  sig_pause.c
-  sig_nanosleep.c
-  sig_usleep.c
-  sig_sleep.c
-  sig_ppoll.c
-  sig_pselect.c)
-
 target_sources(sched PRIVATE ${SRCS})
diff --git a/sched/task/CMakeLists.txt b/sched/task/CMakeLists.txt
index 5f3f54e3ee..061a8c90cc 100644
--- a/sched/task/CMakeLists.txt
+++ b/sched/task/CMakeLists.txt
@@ -18,39 +18,33 @@
 #
 # ##############################################################################
 
-set(SRCS)
-
-list(
-  APPEND
-  SRCS
-  task_create.c
-  task_init.c
-  task_setup.c
-  task_activate.c
-  task_start.c
-  task_delete.c
-  task_exit.c
-  task_exithook.c
-  task_getgroup.c
-  task_getpid.c
-  task_prctl.c
-  task_recover.c
-  task_restart.c
-  task_spawnparms.c
-  task_setcancelstate.c
-  task_cancelpt.c
-  task_terminate.c
-  task_gettid.c
-  exit.c)
+set(SRCS
+    task_create.c
+    task_init.c
+    task_setup.c
+    task_activate.c
+    task_start.c
+    task_delete.c
+    task_exit.c
+    task_exithook.c
+    task_getgroup.c
+    task_getpid.c
+    task_prctl.c
+    task_recover.c
+    task_restart.c
+    task_spawnparms.c
+    task_setcancelstate.c
+    task_cancelpt.c
+    task_terminate.c
+    task_gettid.c
+    exit.c)
 
 if(CONFIG_SCHED_HAVE_PARENT)
   list(APPEND SRCS task_getppid.c task_reparent.c)
 endif()
 
 if(CONFIG_ARCH_HAVE_FORK)
-  if(CONFIG_SCHED_WAITPID)
-    list(APPEND SRCS task_fork.c)
-  endif()
+  list(APPEND SRCS task_fork.c)
 endif()
 
 if(NOT CONFIG_BUILD_KERNEL)
diff --git a/sched/wqueue/CMakeLists.txt b/sched/wqueue/CMakeLists.txt
index 2ee1d9f186..58f6879ea6 100644
--- a/sched/wqueue/CMakeLists.txt
+++ b/sched/wqueue/CMakeLists.txt
@@ -21,9 +21,8 @@
 # Add work queue files
 
 if(CONFIG_SCHED_WORKQUEUE)
-  set(SRCS)
 
-  list(APPEND SRCS kwork_queue.c kwork_cancel.c kwork_thread.c)
+  set(SRCS kwork_queue.c kwork_cancel.c kwork_thread.c)
 
   # Add low priority work queue files
 


[nuttx] 02/03: cmake:complete missing changes during cmake reforming for mm

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 5b6488f09f772cc32a64be126a3f1782ff7f5f54
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Wed Sep 6 17:07:56 2023 +0800

    cmake:complete missing changes during cmake reforming for mm
    
    Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
 mm/iob/CMakeLists.txt            | 63 +++++++++++++++++----------------
 mm/kmm_heap/CMakeLists.txt       | 32 ++++++++---------
 mm/map/CMakeLists.txt            |  3 +-
 mm/mempool/CMakeLists.txt        |  3 +-
 mm/mm_gran/CMakeLists.txt        | 21 +++++------
 mm/mm_heap/CMakeLists.txt        | 42 ++++++++++------------
 mm/shm/CMakeLists.txt            |  2 +-
 mm/tlsf/CMakeLists.txt           | 75 ++++++++++++++++++++++++++++++++++++++++
 mm/{shm => ubsan}/CMakeLists.txt |  8 ++---
 mm/umm_heap/CMakeLists.txt       | 34 +++++++++---------
 10 files changed, 171 insertions(+), 112 deletions(-)

diff --git a/mm/iob/CMakeLists.txt b/mm/iob/CMakeLists.txt
index 87e05fc829..dbe9234dbd 100644
--- a/mm/iob/CMakeLists.txt
+++ b/mm/iob/CMakeLists.txt
@@ -20,38 +20,34 @@
 
 if(CONFIG_MM_IOB)
 
-  set(SRCS)
-
-  list(
-    APPEND
-    SRCS
-    iob_add_queue.c
-    iob_alloc.c
-    iob_alloc_qentry.c
-    iob_clone.c
-    iob_concat.c
-    iob_copyin.c
-    iob_copyout.c
-    iob_contig.c
-    iob_free.c
-    iob_free_chain.c
-    iob_free_qentry.c
-    iob_free_queue.c
-    iob_initialize.c
-    iob_pack.c
-    iob_peek_queue.c
-    iob_remove_queue.c
-    iob_statistics.c
-    iob_trimhead.c
-    iob_trimhead_queue.c
-    iob_trimtail.c
-    iob_navail.c
-    iob_free_queue_qentry.c
-    iob_tailroom.c
-    iob_get_queue_size.c
-    iob_reserve.c
-    iob_update_pktlen.c
-    iob_count.c)
+  set(SRCS
+      iob_add_queue.c
+      iob_alloc.c
+      iob_alloc_qentry.c
+      iob_clone.c
+      iob_concat.c
+      iob_copyin.c
+      iob_copyout.c
+      iob_contig.c
+      iob_free.c
+      iob_free_chain.c
+      iob_free_qentry.c
+      iob_free_queue.c
+      iob_initialize.c
+      iob_pack.c
+      iob_peek_queue.c
+      iob_remove_queue.c
+      iob_statistics.c
+      iob_trimhead.c
+      iob_trimhead_queue.c
+      iob_trimtail.c
+      iob_navail.c
+      iob_free_queue_qentry.c
+      iob_tailroom.c
+      iob_get_queue_size.c
+      iob_reserve.c
+      iob_update_pktlen.c
+      iob_count.c)
 
   if(CONFIG_IOB_NOTIFIER)
     list(APPEND SRCS iob_notifier.c)
@@ -61,6 +57,9 @@ if(CONFIG_MM_IOB)
     list(APPEND SRCS iob_dump.c)
   endif()
 
+  if(CONFIG_IOB_SECTION)
+    target_compile_options(mm PRIVATE -DIOB_SECTION=CONFIG_IOB_SECTION)
+  endif()
   target_sources(mm PRIVATE ${SRCS})
 
 endif()
diff --git a/mm/kmm_heap/CMakeLists.txt b/mm/kmm_heap/CMakeLists.txt
index a571c806bc..075476d4e0 100644
--- a/mm/kmm_heap/CMakeLists.txt
+++ b/mm/kmm_heap/CMakeLists.txt
@@ -22,24 +22,20 @@
 
 if(CONFIG_MM_KERNEL_HEAP)
 
-  set(SRCS)
-
-  list(
-    APPEND
-    SRCS
-    kmm_initialize.c
-    kmm_addregion.c
-    kmm_malloc_size.c
-    kmm_brkaddr.c
-    kmm_calloc.c
-    kmm_extend.c
-    kmm_free.c
-    kmm_mallinfo.c
-    kmm_malloc.c
-    kmm_memalign.c
-    kmm_realloc.c
-    kmm_zalloc.c
-    kmm_heapmember.c)
+  set(SRCS
+      kmm_initialize.c
+      kmm_addregion.c
+      kmm_malloc_size.c
+      kmm_brkaddr.c
+      kmm_calloc.c
+      kmm_extend.c
+      kmm_free.c
+      kmm_mallinfo.c
+      kmm_malloc.c
+      kmm_memalign.c
+      kmm_realloc.c
+      kmm_zalloc.c
+      kmm_heapmember.c)
 
   if(CONFIG_DEBUG_MM)
     list(APPEND SRCS kmm_checkcorruption.c)
diff --git a/mm/map/CMakeLists.txt b/mm/map/CMakeLists.txt
index 80bf022b8d..5c5ba7726c 100644
--- a/mm/map/CMakeLists.txt
+++ b/mm/map/CMakeLists.txt
@@ -17,8 +17,7 @@
 # the License.
 #
 # ##############################################################################
-set(SRCS)
-list(APPEND SRCS mm_map.c)
+set(SRCS mm_map.c)
 
 if(CONFIG_ARCH_VMA_MAPPING)
   list(APPEND SRCS vm_region.c)
diff --git a/mm/mempool/CMakeLists.txt b/mm/mempool/CMakeLists.txt
index 49d108b5c2..8c2dcb53dc 100644
--- a/mm/mempool/CMakeLists.txt
+++ b/mm/mempool/CMakeLists.txt
@@ -17,8 +17,7 @@
 # the License.
 #
 # ##############################################################################
-set(SRCS)
-list(APPEND SRCS mempool.c mempool_multiple.c)
+set(SRCS mempool.c mempool_multiple.c)
 
 if(CONFIG_FS_PROCFS)
   if(NOT CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL)
diff --git a/mm/mm_gran/CMakeLists.txt b/mm/mm_gran/CMakeLists.txt
index 6f6cfcad7b..50e8dbbd8c 100644
--- a/mm/mm_gran/CMakeLists.txt
+++ b/mm/mm_gran/CMakeLists.txt
@@ -21,19 +21,16 @@
 # An optional granule allocator
 
 if(CONFIG_GRAN)
-  set(SRCS)
 
-  list(
-    APPEND
-    SRCS
-    mm_graninit.c
-    mm_granrelease.c
-    mm_granreserve.c
-    mm_granalloc.c
-    mm_granmark.c
-    mm_granfree.c
-    mm_graninfo.c
-    mm_grancritical.c)
+  set(SRCS
+      mm_graninit.c
+      mm_granrelease.c
+      mm_granreserve.c
+      mm_granalloc.c
+      mm_granmark.c
+      mm_granfree.c
+      mm_graninfo.c
+      mm_grancritical.c)
 
   # A page allocator based on the granule allocator
 
diff --git a/mm/mm_heap/CMakeLists.txt b/mm/mm_heap/CMakeLists.txt
index 6402c590b2..ddb935866a 100644
--- a/mm/mm_heap/CMakeLists.txt
+++ b/mm/mm_heap/CMakeLists.txt
@@ -22,29 +22,25 @@
 
 if(CONFIG_MM_DEFAULT_MANAGER)
 
-  set(SRCS)
-
-  list(
-    APPEND
-    SRCS
-    mm_initialize.c
-    mm_lock.c
-    mm_addfreechunk.c
-    mm_size2ndx.c
-    mm_malloc_size.c
-    mm_shrinkchunk.c
-    mm_brkaddr.c
-    mm_calloc.c
-    mm_extend.c
-    mm_free.c
-    mm_mallinfo.c
-    mm_malloc.c
-    mm_foreach.c
-    mm_memalign.c
-    mm_realloc.c
-    mm_zalloc.c
-    mm_heapmember.c
-    mm_memdump.c)
+  set(SRCS
+      mm_initialize.c
+      mm_lock.c
+      mm_addfreechunk.c
+      mm_size2ndx.c
+      mm_malloc_size.c
+      mm_shrinkchunk.c
+      mm_brkaddr.c
+      mm_calloc.c
+      mm_extend.c
+      mm_free.c
+      mm_mallinfo.c
+      mm_malloc.c
+      mm_foreach.c
+      mm_memalign.c
+      mm_realloc.c
+      mm_zalloc.c
+      mm_heapmember.c
+      mm_memdump.c)
 
   if(CONFIG_DEBUG_MM)
     list(APPEND SRCS mm_checkcorruption.c)
diff --git a/mm/shm/CMakeLists.txt b/mm/shm/CMakeLists.txt
index 98ee100283..fd8d24d1ec 100644
--- a/mm/shm/CMakeLists.txt
+++ b/mm/shm/CMakeLists.txt
@@ -21,5 +21,5 @@
 # Shared memory allocator
 
 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()
diff --git a/mm/tlsf/CMakeLists.txt b/mm/tlsf/CMakeLists.txt
new file mode 100644
index 0000000000..3b3e3bb200
--- /dev/null
+++ b/mm/tlsf/CMakeLists.txt
@@ -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()
diff --git a/mm/shm/CMakeLists.txt b/mm/ubsan/CMakeLists.txt
similarity index 86%
copy from mm/shm/CMakeLists.txt
copy to mm/ubsan/CMakeLists.txt
index 98ee100283..f7fbd8304d 100644
--- a/mm/shm/CMakeLists.txt
+++ b/mm/ubsan/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# mm/shm/CMakeLists.txt
+# 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
@@ -18,8 +18,8 @@
 #
 # ##############################################################################
 
-# Shared memory allocator
+if(CONFIG_MM_UBSAN)
+
+  target_sources(mm PRIVATE ubsan.c)
 
-if(CONFIG_MM_SHM)
-  target_sources(mm PRIVATE shm_initialize.c shmat.c shmctl.c shmdt.c shmget.c)
 endif()
diff --git a/mm/umm_heap/CMakeLists.txt b/mm/umm_heap/CMakeLists.txt
index 0df7edd7d2..78f906e780 100644
--- a/mm/umm_heap/CMakeLists.txt
+++ b/mm/umm_heap/CMakeLists.txt
@@ -20,24 +20,22 @@
 
 # User heap allocator
 
-set(SRCS)
-
-list(
-  APPEND
-  SRCS
-  umm_initialize.c
-  umm_addregion.c
-  umm_brkaddr.c
-  umm_calloc.c
-  umm_extend.c
-  umm_free.c
-  umm_mallinfo.c
-  umm_malloc.c
-  umm_memalign.c
-  umm_realloc.c
-  umm_zalloc.c
-  umm_heapmember.c
-  umm_globals.c)
+set(SRCS
+    umm_initialize.c
+    umm_addregion.c
+    umm_brkaddr.c
+    umm_calloc.c
+    umm_extend.c
+    umm_free.c
+    umm_mallinfo.c
+    umm_malloc.c
+    umm_memalign.c
+    umm_realloc.c
+    umm_zalloc.c
+    umm_heapmember.c
+    umm_globals.c
+    umm_memdump.c
+    umm_malloc_size.c)
 
 if(CONFIG_BUILD_KERNEL)
   list(APPEND SRCS umm_sbrk.c)


[nuttx] 01/03: cmake:complete missing changes during cmake reforming for fs

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b1cc5b50b1329506db237c8a49597b7aedf62169
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Wed Sep 6 15:53:55 2023 +0800

    cmake:complete missing changes during cmake reforming for fs
    
    Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
 fs/hostfs/CMakeLists.txt    | 14 +-------------
 fs/littlefs/CMakeLists.txt  | 20 +++++++++++++++-----
 fs/partition/CMakeLists.txt | 15 +++++++++++++--
 fs/procfs/CMakeLists.txt    |  1 +
 fs/rpmsgfs/CMakeLists.txt   |  8 ++------
 fs/shm/CMakeLists.txt       |  2 +-
 fs/vfs/CMakeLists.txt       |  6 ++++++
 7 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/fs/hostfs/CMakeLists.txt b/fs/hostfs/CMakeLists.txt
index d989ede733..dcbc26aaee 100644
--- a/fs/hostfs/CMakeLists.txt
+++ b/fs/hostfs/CMakeLists.txt
@@ -18,18 +18,6 @@
 #
 # ##############################################################################
 
-set(SRCS)
-
 if(CONFIG_FS_HOSTFS)
-  list(APPEND SRCS hostfs.c)
-endif()
-
-if(CONFIG_FS_HOSTFS_RPMSG)
-  list(APPEND SRCS hostfs_rpmsg.c)
+  target_sources(fs PRIVATE hostfs.c)
 endif()
-
-if(CONFIG_FS_HOSTFS_RPMSG_SERVER)
-  list(APPEND SRCS hostfs_rpmsg_server.c)
-endif()
-
-target_sources(fs PRIVATE ${SRCS})
diff --git a/fs/littlefs/CMakeLists.txt b/fs/littlefs/CMakeLists.txt
index b7e08784eb..b137ee5cc2 100644
--- a/fs/littlefs/CMakeLists.txt
+++ b/fs/littlefs/CMakeLists.txt
@@ -26,18 +26,28 @@ if(CONFIG_FS_LITTLEFS)
       littlefs
       URL https://github.com/ARMmbed/littlefs/archive/v${LITTLEFS_VERSION}.tar.gz
           SOURCE_DIR
-          ${CMAKE_CURRENT_LIST_DIR}/littlefs)
+          ${CMAKE_CURRENT_LIST_DIR}/littlefs
+          BINARY_DIR
+          ${CMAKE_BINARY_DIR}/fs/littlefs/littlefs
+      PATCH_COMMAND patch -p2 -d ${CMAKE_CURRENT_LIST_DIR} <
+                    ${CMAKE_CURRENT_LIST_DIR}/lfs_util.patch)
     FetchContent_MakeAvailable(littlefs)
   endif()
 
   target_compile_definitions(
     fs
-    PRIVATE -DLFS_TRACE=finfo -DLFS_DEBUG=finfo -DLFS_WARN=fwarn
-            -DLFS_ERROR=ferr -DLFS_ASSERT=DEBUGASSERT
-            -DLFS_CONFIG=${CMAKE_CURRENT_LIST_DIR}/lfs_vfs.h)
+    PRIVATE -DLFS_TRACE=finfo
+            -DLFS_DEBUG=finfo
+            -DLFS_WARN=fwarn
+            -DLFS_ERROR=ferr
+            -DLFS_ASSERT=DEBUGASSERT
+            -DLFS_CONFIG=${CMAKE_CURRENT_LIST_DIR}/lfs_vfs.h
+            -DLFS_NAME_MAX=${CONFIG_FS_LITTLEFS_NAME_MAX}
+            -DLFS_FILE_MAX=${CONFIG_FS_LITTLEFS_FILE_MAX}
+            -DLFS_ATTR_MAX=${CONFIG_FS_LITTLEFS_ATTR_MAX})
 
   target_sources(fs PRIVATE lfs_vfs.c ${CMAKE_CURRENT_LIST_DIR}/littlefs/lfs.c
                             ${CMAKE_CURRENT_LIST_DIR}/littlefs/lfs_util.c)
 
-  target_include_directories(fs PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+  target_include_directories(fs PRIVATE ${CMAKE_CURRENT_LIST_DIR})
 endif()
diff --git a/fs/partition/CMakeLists.txt b/fs/partition/CMakeLists.txt
index 9b8015e1ea..0003e831fd 100644
--- a/fs/partition/CMakeLists.txt
+++ b/fs/partition/CMakeLists.txt
@@ -21,13 +21,24 @@
 # Don't build anything if mountpoint doesn't support
 
 if(NOT CONFIG_DISABLE_MOUNTPOINT)
-  set(SRCS)
 
-  list(APPEND SRCS fs_partition.c)
+  set(SRCS fs_partition.c)
 
   if(CONFIG_PTABLE_PARTITION)
     list(APPEND SRCS fs_ptable.c)
   endif()
 
+  if(CONFIG_MBR_PARTITION)
+    list(APPEND SRCS fs_mbr.c)
+  endif()
+
+  if(CONFIG_GPT_PARTITION)
+    list(APPEND SRCS fs_gpt.c)
+  endif()
+
+  if(CONFIG_GPT_PARTITION)
+    list(APPEND SRCS fs_txtable.c)
+  endif()
+
   target_sources(fs PRIVATE ${SRCS})
 endif()
diff --git a/fs/procfs/CMakeLists.txt b/fs/procfs/CMakeLists.txt
index 05964f60a1..9af781a6be 100644
--- a/fs/procfs/CMakeLists.txt
+++ b/fs/procfs/CMakeLists.txt
@@ -25,6 +25,7 @@ if(CONFIG_FS_PROCFS)
       fs_procfscpuinfo.c
       fs_procfscpuload.c
       fs_procfscritmon.c
+      fs_procfsfdt.c
       fs_procfsiobinfo.c
       fs_procfsmeminfo.c
       fs_procfsproc.c
diff --git a/fs/rpmsgfs/CMakeLists.txt b/fs/rpmsgfs/CMakeLists.txt
index e36a6c7003..927e612349 100644
--- a/fs/rpmsgfs/CMakeLists.txt
+++ b/fs/rpmsgfs/CMakeLists.txt
@@ -18,14 +18,10 @@
 #
 # ##############################################################################
 
-set(SRCS)
-
 if(CONFIG_FS_RPMSGFS)
-  list(APPEND SRCS rpmsgfs.c rpmsgfs_client.c)
+  target_sources(fs PRIVATE rpmsgfs.c rpmsgfs_client.c)
 endif()
 
 if(CONFIG_FS_RPMSGFS_SERVER)
-  list(APPEND SRCS rpmsgfs_server.c)
+  target_sources(fs PRIVATE rpmsgfs_server.c)
 endif()
-
-target_sources(fs PRIVATE ${SRCS})
diff --git a/fs/shm/CMakeLists.txt b/fs/shm/CMakeLists.txt
index 6f46371380..d76fb17e3b 100644
--- a/fs/shm/CMakeLists.txt
+++ b/fs/shm/CMakeLists.txt
@@ -21,5 +21,5 @@
 # Include POSIX message queue support
 
 if(CONFIG_FS_SHM)
-  target_sources(fs PRIVATE shm_open.c shm_close.c)
+  target_sources(fs PRIVATE shm_open.c shm_unlink.c shmfs.c shmfs_alloc.c)
 endif()
diff --git a/fs/vfs/CMakeLists.txt b/fs/vfs/CMakeLists.txt
index 6e4bb967ed..0b07ec3b68 100644
--- a/fs/vfs/CMakeLists.txt
+++ b/fs/vfs/CMakeLists.txt
@@ -54,6 +54,12 @@ if(NOT "${CONFIG_PSEUDOFS_SOFTLINKS}" STREQUAL "0")
   list(APPEND SRCS fs_link.c fs_symlink.c fs_readlink.c)
 endif()
 
+# Pseudofile support
+
+if(CONFIG_PSEUDOFS_FILE)
+  list(APPEND SRCS fs_pseudofile.c)
+endif()
+
 # Stream support
 
 if(CONFIG_FILE_STREAM)