diff --git a/arch/arm/src/phy62xx/uart.c b/arch/arm/src/phy62xx/uart.c index 7526a16eaf84c..1765bd13ec614 100644 --- a/arch/arm/src/phy62xx/uart.c +++ b/arch/arm/src/phy62xx/uart.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #define UART_TX_BUFFER_SIZE 64 #define UART_RX_BUFFER_SIZE 64 diff --git a/arch/risc-v/src/common/espressif/esp_rmt.c b/arch/risc-v/src/common/espressif/esp_rmt.c index 0e94dbd950790..d1af3861aa127 100644 --- a/arch/risc-v/src/common/espressif/esp_rmt.c +++ b/arch/risc-v/src/common/espressif/esp_rmt.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "esp_gpio.h" #include "esp_irq.h" diff --git a/arch/xtensa/src/common/espressif/esp_rmt.c b/arch/xtensa/src/common/espressif/esp_rmt.c index 5a19327813dc3..2a627199671f4 100644 --- a/arch/xtensa/src/common/espressif/esp_rmt.c +++ b/arch/xtensa/src/common/espressif/esp_rmt.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "xtensa.h" #ifdef CONFIG_ARCH_CHIP_ESP32 diff --git a/arch/xtensa/src/esp32/esp32_i2s.c b/arch/xtensa/src/esp32/esp32_i2s.c index 24f74bbaf9251..e3e7d6a5b631c 100644 --- a/arch/xtensa/src/esp32/esp32_i2s.c +++ b/arch/xtensa/src/esp32/esp32_i2s.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/xtensa/src/esp32s2/esp32s2_i2s.c b/arch/xtensa/src/esp32s2/esp32s2_i2s.c index 5ccfbef171cae..923384bb45feb 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_i2s.c +++ b/arch/xtensa/src/esp32s2/esp32s2_i2s.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/xtensa/src/esp32s3/esp32s3_i2s.c b/arch/xtensa/src/esp32s3/esp32s3_i2s.c index 1daa40477a4ad..6434bb22cc208 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_i2s.c +++ b/arch/xtensa/src/esp32s3/esp32s3_i2s.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include diff --git a/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c b/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c index 0ee41b2bbeab8..96e545dfac0b6 100644 --- a/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c +++ b/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c @@ -58,7 +58,7 @@ #include #include #include -#include +#include #if defined(CONFIG_UART_BTH4) #include #endif diff --git a/drivers/input/keyboard_upper.c b/drivers/input/keyboard_upper.c index cfaf3ed2266ff..1e42c09227e30 100644 --- a/drivers/input/keyboard_upper.c +++ b/drivers/input/keyboard_upper.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include /**************************************************************************** diff --git a/drivers/input/mouse_upper.c b/drivers/input/mouse_upper.c index fb0d9f0872d4b..22caee8702b75 100644 --- a/drivers/input/mouse_upper.c +++ b/drivers/input/mouse_upper.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include /**************************************************************************** * Private Types diff --git a/drivers/input/touchscreen_upper.c b/drivers/input/touchscreen_upper.c index bce5711059dcf..11ebc3c104f87 100644 --- a/drivers/input/touchscreen_upper.c +++ b/drivers/input/touchscreen_upper.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include /**************************************************************************** * Private Types diff --git a/drivers/ipcc/ipcc_register.c b/drivers/ipcc/ipcc_register.c index 46644f4b91ad3..3f7abfb4bf8e3 100644 --- a/drivers/ipcc/ipcc_register.c +++ b/drivers/ipcc/ipcc_register.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/pipes/pipe_common.h b/drivers/pipes/pipe_common.h index 48f4279d7986a..dc150998f8c16 100644 --- a/drivers/pipes/pipe_common.h +++ b/drivers/pipes/pipe_common.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/rc/lirc_dev.c b/drivers/rc/lirc_dev.c index b763e6737cee8..1aae588932571 100644 --- a/drivers/rc/lirc_dev.c +++ b/drivers/rc/lirc_dev.c @@ -34,7 +34,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/drivers/rmt/rmtchar.c b/drivers/rmt/rmtchar.c index bc0dad8591ca8..77b12ff3a9145 100644 --- a/drivers/rmt/rmtchar.c +++ b/drivers/rmt/rmtchar.c @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/sensors/gnss_uorb.c b/drivers/sensors/gnss_uorb.c index 92212647b0949..0077a15c675e3 100644 --- a/drivers/sensors/gnss_uorb.c +++ b/drivers/sensors/gnss_uorb.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c index 9465e52727922..b7177c7cbe7c8 100644 --- a/drivers/sensors/sensor.c +++ b/drivers/sensors/sensor.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/serial/uart_bth4.c b/drivers/serial/uart_bth4.c index c5da4443f1004..88301a68d8bf0 100644 --- a/drivers/serial/uart_bth4.c +++ b/drivers/serial/uart_bth4.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/serial/uart_bth5.c b/drivers/serial/uart_bth5.c index 3ca56254d0ca0..21a528b8c238d 100644 --- a/drivers/serial/uart_bth5.c +++ b/drivers/serial/uart_bth5.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/video/fb.c b/drivers/video/fb.c index 0bef1d3cb2a58..d17c36eafefe6 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-processor definitions diff --git a/include/nuttx/mm/circbuf.h b/include/nuttx/circbuf.h similarity index 99% rename from include/nuttx/mm/circbuf.h rename to include/nuttx/circbuf.h index 5334bd0ef523d..3295c175cf98e 100644 --- a/include/nuttx/mm/circbuf.h +++ b/include/nuttx/circbuf.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/nuttx/mm/circbuf.h + * include/nuttx/circbuf.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_MM_CIRCBUF_H -#define __INCLUDE_NUTTX_MM_CIRCBUF_H +#ifndef __INCLUDE_NUTTX_CIRCBUF_H +#define __INCLUDE_NUTTX_CIRCBUF_H /* Note about locking: There is no locking required while only one reader * and one writer is using the circular buffer. diff --git a/include/nuttx/input/touchscreen.h b/include/nuttx/input/touchscreen.h index b5efd54e3006c..a06043b96cf45 100644 --- a/include/nuttx/input/touchscreen.h +++ b/include/nuttx/input/touchscreen.h @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/nuttx/ipcc.h b/include/nuttx/ipcc.h index 4b7c1c0804bed..68cf724497e38 100644 --- a/include/nuttx/ipcc.h +++ b/include/nuttx/ipcc.h @@ -28,7 +28,7 @@ ****************************************************************************/ #include -#include +#include #include #include diff --git a/libs/libc/misc/CMakeLists.txt b/libs/libc/misc/CMakeLists.txt index 8dc028c0e6e7a..ed29e81df3d67 100644 --- a/libs/libc/misc/CMakeLists.txt +++ b/libs/libc/misc/CMakeLists.txt @@ -27,6 +27,7 @@ list( APPEND SRCS lib_bitmap.c + lib_circbuf.c lib_mknod.c lib_umask.c lib_utsname.c diff --git a/libs/libc/misc/Make.defs b/libs/libc/misc/Make.defs index 2369fec786ca6..398fa21fb268a 100644 --- a/libs/libc/misc/Make.defs +++ b/libs/libc/misc/Make.defs @@ -22,8 +22,8 @@ # Add the internal C files to the build -CSRCS += lib_bitmap.c lib_mknod.c lib_umask.c lib_utsname.c lib_getrandom.c -CSRCS += lib_xorshift128.c lib_tea_encrypt.c lib_tea_decrypt.c +CSRCS += lib_bitmap.c lib_circbuf.c lib_mknod.c lib_umask.c lib_utsname.c +CSRCS += lib_getrandom.c lib_xorshift128.c lib_tea_encrypt.c lib_tea_decrypt.c CSRCS += lib_cxx_initialize.c lib_impure.c lib_memfd.c lib_mutex.c CSRCS += lib_fchmodat.c lib_fstatat.c lib_getfullpath.c lib_openat.c CSRCS += lib_mkdirat.c lib_utimensat.c lib_mallopt.c lib_memoryregion.c diff --git a/mm/circbuf/circbuf.c b/libs/libc/misc/lib_circbuf.c similarity index 98% rename from mm/circbuf/circbuf.c rename to libs/libc/misc/lib_circbuf.c index be42998b403d8..3006060003cba 100644 --- a/mm/circbuf/circbuf.c +++ b/libs/libc/misc/lib_circbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * mm/circbuf/circbuf.c + * libs/libc/misc/lib_circbuf.c * * SPDX-License-Identifier: Apache-2.0 * @@ -35,8 +35,8 @@ #include -#include -#include +#include +#include /**************************************************************************** * Private Types @@ -74,7 +74,7 @@ int circbuf_init(FAR struct circbuf_s *circ, FAR void *base, size_t bytes) if (!base && bytes) { - base = kmm_malloc(bytes); + base = lib_malloc(bytes); if (!base) { return -ENOMEM; @@ -118,7 +118,7 @@ int circbuf_resize(FAR struct circbuf_s *circ, size_t bytes) if (bytes) { - tmp = kmm_malloc(bytes); + tmp = lib_malloc(bytes); if (!tmp) { return -ENOMEM; @@ -134,7 +134,7 @@ int circbuf_resize(FAR struct circbuf_s *circ, size_t bytes) circbuf_read(circ, tmp, len); } - kmm_free(circ->base); + lib_free(circ->base); circ->base = tmp; circ->size = bytes; @@ -176,7 +176,7 @@ void circbuf_uninit(FAR struct circbuf_s *circ) if (!circ->external) { - kmm_free(circ->base); + lib_free(circ->base); } memset(circ, 0, sizeof(*circ)); diff --git a/mm/Makefile b/mm/Makefile index 7ea82e21e9971..4b03bf6a96d94 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -30,7 +30,6 @@ include kmm_heap/Make.defs include mm_gran/Make.defs include shm/Make.defs include iob/Make.defs -include circbuf/Make.defs include mempool/Make.defs include kasan/Make.defs include ubsan/Make.defs diff --git a/mm/circbuf/CMakeLists.txt b/mm/circbuf/CMakeLists.txt deleted file mode 100644 index 46ff9e3e30db4..0000000000000 --- a/mm/circbuf/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# ############################################################################## -# mm/circbuf/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# 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. -# -# ############################################################################## -target_sources(mm PRIVATE circbuf.c) diff --git a/mm/circbuf/Make.defs b/mm/circbuf/Make.defs deleted file mode 100644 index 5812225dc89c8..0000000000000 --- a/mm/circbuf/Make.defs +++ /dev/null @@ -1,30 +0,0 @@ -############################################################################ -# mm/circbuf/Make.defs -# -# SPDX-License-Identifier: Apache-2.0 -# -# 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. -# -############################################################################ - -# Circular buffer management - -CSRCS += circbuf.c - -# Add the circular buffer directory to the build - -DEPPATH += --dep-path circbuf -VPATH += :circbuf diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c index ac589ff241916..d3302c47a1f00 100644 --- a/net/rpmsg/rpmsg_sockif.c +++ b/net/rpmsg/rpmsg_sockif.c @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include