summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Jianting Man <[email protected]>2021-07-30 10:43:19 -0500
committerGitHub <[email protected]>2021-07-30 10:43:19 -0500
commit2589d245325d95f0291e27886f93644d1f762f53 (patch)
tree432e10f647be74abf9d6d58e131b0496bfae3fa3
parent19c5088bb8b6cfdc9e3cecc63b6f9c116a799c49 (diff)
parent56d3abe30148a07dd41d78e8aa190f9baa164266 (diff)
Merge branch 'master' into tz
-rw-r--r--bsp/imxrt/docs/AN13232 - RT-Thread Board Port and Application Development.pdfbin0 -> 677327 bytes
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/.config240
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/board/Kconfig26
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/board/SConscript4
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c105
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/board/ports/drv_sdcard.c70
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/rtconfig.h29
-rw-r--r--components/dfs/include/dfs_select.h2
-rw-r--r--components/drivers/include/ipc/workqueue.h5
-rw-r--r--components/drivers/src/workqueue.c6
-rw-r--r--components/libc/aio/posix_aio.c6
-rw-r--r--components/libc/aio/posix_aio.h4
-rw-r--r--components/libc/compilers/common/none-gcc/sys/errno.h4
-rw-r--r--components/libc/compilers/common/none-gcc/sys/stat.h5
-rw-r--r--components/libc/compilers/common/none-gcc/sys/types.h4
-rw-r--r--components/libc/compilers/common/none-gcc/sys/unistd.h4
-rw-r--r--components/libc/compilers/common/sys/select.h49
-rw-r--r--components/libc/compilers/common/sys/signal.h (renamed from include/libc/libc_signal.h)126
-rw-r--r--components/libc/pthreads/mqueue.c1
-rw-r--r--components/libc/signal/posix_signal.c5
-rw-r--r--components/libc/signal/posix_signal.h1
-rw-r--r--components/net/at/at_socket/at_socket.c17
-rw-r--r--components/net/at/src/at_client.c20
-rw-r--r--components/net/sal_socket/include/socket/netdb.h2
-rw-r--r--examples/kernel/event_simple.c2
-rw-r--r--examples/kernel/mbox_send_wait.c2
-rw-r--r--examples/kernel/mbox_simple.c2
-rw-r--r--examples/kernel/messageq_simple.c2
-rwxr-xr-xexamples/kernel/mutex_priority.c2
-rw-r--r--examples/kernel/mutex_simple.c2
-rw-r--r--examples/kernel/semaphore_buffer_worker.c2
-rw-r--r--examples/kernel/semaphore_dynamic.c2
-rw-r--r--examples/kernel/semaphore_producer_consumer.c6
-rw-r--r--examples/kernel/semaphore_static.c2
-rw-r--r--examples/kernel/tc_comm.c2
-rw-r--r--examples/kernel/timer_timeout.c2
-rw-r--r--examples/pm/wakeup_app.c2
-rw-r--r--include/libc/libc_fdset.h60
-rw-r--r--include/rtdef.h2
-rw-r--r--include/rtlibc.h3
40 files changed, 538 insertions, 292 deletions
diff --git a/bsp/imxrt/docs/AN13232 - RT-Thread Board Port and Application Development.pdf b/bsp/imxrt/docs/AN13232 - RT-Thread Board Port and Application Development.pdf
new file mode 100644
index 0000000000..24ef3b70f8
--- /dev/null
+++ b/bsp/imxrt/docs/AN13232 - RT-Thread Board Port and Application Development.pdf
Binary files differ
diff --git a/bsp/stm32/stm32f407-atk-explorer/.config b/bsp/stm32/stm32f407-atk-explorer/.config
index c0f04a426b..bae0b7cdfd 100644
--- a/bsp/stm32/stm32f407-atk-explorer/.config
+++ b/bsp/stm32/stm32f407-atk-explorer/.config
@@ -21,6 +21,12 @@ CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
CONFIG_IDLE_THREAD_STACK_SIZE=1024
# CONFIG_RT_USING_TIMER_SOFT is not set
+
+#
+# kservice optimization
+#
+# CONFIG_RT_KSERVICE_USING_STDLIB is not set
+# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
@@ -52,6 +58,7 @@ CONFIG_RT_USING_MEMPOOL=y
# CONFIG_RT_USING_NOHEAP is not set
CONFIG_RT_USING_SMALL_MEM=y
# CONFIG_RT_USING_SLAB is not set
+# CONFIG_RT_USING_USERHEAP is not set
# CONFIG_RT_USING_MEMTRACE is not set
CONFIG_RT_USING_HEAP=y
@@ -64,7 +71,8 @@ CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=128
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
-CONFIG_RT_VER_NUM=0x40002
+# CONFIG_RT_PRINTF_LONGLONG is not set
+CONFIG_RT_VER_NUM=0x40004
CONFIG_ARCH_ARM=y
CONFIG_RT_USING_CPU_FFS=y
CONFIG_ARCH_ARM_CORTEX_M=y
@@ -115,18 +123,21 @@ CONFIG_RT_USING_DEVICE_IPC=y
CONFIG_RT_PIPE_BUFSZ=512
# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
CONFIG_RT_USING_SERIAL=y
+CONFIG_RT_USING_SERIAL_V1=y
+# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=64
# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_USING_HWTIMER is not set
# CONFIG_RT_USING_CPUTIME is not set
# CONFIG_RT_USING_I2C is not set
+# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_ADC is not set
+# CONFIG_RT_USING_DAC is not set
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
-# CONFIG_RT_USING_MTD is not set
# CONFIG_RT_USING_PM is not set
# CONFIG_RT_USING_RTC is not set
# CONFIG_RT_USING_SDIO is not set
@@ -134,15 +145,10 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
-
-#
-# Using Hardware Crypto drivers
-#
+# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_HWCRYPTO is not set
-
-#
-# Using WiFi
-#
+# CONFIG_RT_USING_PULSE_ENCODER is not set
+# CONFIG_RT_USING_INPUT_CAPTURE is not set
# CONFIG_RT_USING_WIFI is not set
#
@@ -156,6 +162,8 @@ CONFIG_RT_USING_PIN=y
#
# CONFIG_RT_USING_LIBC is not set
# CONFIG_RT_USING_PTHREADS is not set
+CONFIG_RT_LIBC_USING_TIME=y
+CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
#
# Network
@@ -177,11 +185,6 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_LWIP is not set
#
-# Modbus master and slave stack
-#
-# CONFIG_RT_USING_MODBUS is not set
-
-#
# AT commands
#
# CONFIG_RT_USING_AT is not set
@@ -197,23 +200,35 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
+# CONFIG_RT_USING_RT_LINK is not set
# CONFIG_RT_USING_LWP is not set
#
+# RT-Thread Utestcases
+#
+# CONFIG_RT_USING_UTESTCASES is not set
+
+#
# RT-Thread online packages
#
#
# IoT - internet of things
#
+# CONFIG_PKG_USING_LORAWAN_DRIVER is not set
# CONFIG_PKG_USING_PAHOMQTT is not set
+# CONFIG_PKG_USING_UMQTT is not set
# CONFIG_PKG_USING_WEBCLIENT is not set
# CONFIG_PKG_USING_WEBNET is not set
# CONFIG_PKG_USING_MONGOOSE is not set
+# CONFIG_PKG_USING_MYMQTT is not set
+# CONFIG_PKG_USING_KAWAII_MQTT is not set
+# CONFIG_PKG_USING_BC28_MQTT is not set
# CONFIG_PKG_USING_WEBTERMINAL is not set
# CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_JSMN is not set
# CONFIG_PKG_USING_LIBMODBUS is not set
+# CONFIG_PKG_USING_FREEMODBUS is not set
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set
@@ -235,6 +250,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set
+# CONFIG_PKG_USING_CMUX is not set
+# CONFIG_PKG_USING_PPP_DEVICE is not set
# CONFIG_PKG_USING_AT_DEVICE is not set
# CONFIG_PKG_USING_ATSRV_SOCKET is not set
# CONFIG_PKG_USING_WIZNET is not set
@@ -246,12 +263,38 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_GAGENT_CLOUD is not set
# CONFIG_PKG_USING_ALI_IOTKIT is not set
# CONFIG_PKG_USING_AZURE is not set
-# CONFIG_PKG_USING_TENCENT_IOTKIT is not set
+# CONFIG_PKG_USING_TENCENT_IOT_EXPLORER is not set
+# CONFIG_PKG_USING_JIOT-C-SDK is not set
+# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set
+# CONFIG_PKG_USING_JOYLINK is not set
# CONFIG_PKG_USING_NIMBLE is not set
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
# CONFIG_PKG_USING_IPMSG is not set
# CONFIG_PKG_USING_LSSDP is not set
# CONFIG_PKG_USING_AIRKISS_OPEN is not set
+# CONFIG_PKG_USING_LIBRWS is not set
+# CONFIG_PKG_USING_TCPSERVER is not set
+# CONFIG_PKG_USING_PROTOBUF_C is not set
+# CONFIG_PKG_USING_DLT645 is not set
+# CONFIG_PKG_USING_QXWZ is not set
+# CONFIG_PKG_USING_SMTP_CLIENT is not set
+# CONFIG_PKG_USING_ABUP_FOTA is not set
+# CONFIG_PKG_USING_LIBCURL2RTT is not set
+# CONFIG_PKG_USING_CAPNP is not set
+# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
+# CONFIG_PKG_USING_AGILE_TELNET is not set
+# CONFIG_PKG_USING_NMEALIB is not set
+# CONFIG_PKG_USING_AGILE_JSMN is not set
+# CONFIG_PKG_USING_PDULIB is not set
+# CONFIG_PKG_USING_BTSTACK is not set
+# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set
+# CONFIG_PKG_USING_WAYZ_IOTKIT is not set
+# CONFIG_PKG_USING_MAVLINK is not set
+# CONFIG_PKG_USING_RAPIDJSON is not set
+# CONFIG_PKG_USING_BSAL is not set
+# CONFIG_PKG_USING_AGILE_MODBUS is not set
+# CONFIG_PKG_USING_AGILE_FTP is not set
+# CONFIG_PKG_USING_EMBEDDEDPROTO is not set
#
# security packages
@@ -259,6 +302,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_MBEDTLS is not set
# CONFIG_PKG_USING_libsodium is not set
# CONFIG_PKG_USING_TINYCRYPT is not set
+# CONFIG_PKG_USING_TFM is not set
+# CONFIG_PKG_USING_YD_CRYPTO is not set
#
# language packages
@@ -273,6 +318,13 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_OPENMV is not set
# CONFIG_PKG_USING_MUPDF is not set
# CONFIG_PKG_USING_STEMWIN is not set
+# CONFIG_PKG_USING_WAVPLAYER is not set
+# CONFIG_PKG_USING_TJPGD is not set
+# CONFIG_PKG_USING_PDFGEN is not set
+# CONFIG_PKG_USING_HELIX is not set
+# CONFIG_PKG_USING_AZUREGUIX is not set
+# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
+# CONFIG_PKG_USING_NUEMWIN is not set
#
# tools packages
@@ -284,7 +336,36 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_RDB is not set
# CONFIG_PKG_USING_QRCODE is not set
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
+# CONFIG_PKG_USING_ULOG_FILE is not set
+# CONFIG_PKG_USING_LOGMGR is not set
# CONFIG_PKG_USING_ADBD is not set
+# CONFIG_PKG_USING_COREMARK is not set
+# CONFIG_PKG_USING_DHRYSTONE is not set
+# CONFIG_PKG_USING_MEMORYPERF is not set
+# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
+# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
+# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
+# CONFIG_PKG_USING_BS8116A is not set
+# CONFIG_PKG_USING_GPS_RMC is not set
+# CONFIG_PKG_USING_URLENCODE is not set
+# CONFIG_PKG_USING_UMCN is not set
+# CONFIG_PKG_USING_LWRB2RTT is not set
+# CONFIG_PKG_USING_CPU_USAGE is not set
+# CONFIG_PKG_USING_GBK2UTF8 is not set
+# CONFIG_PKG_USING_VCONSOLE is not set
+# CONFIG_PKG_USING_KDB is not set
+# CONFIG_PKG_USING_WAMR is not set
+# CONFIG_PKG_USING_MICRO_XRCE_DDS_CLIENT is not set
+# CONFIG_PKG_USING_LWLOG is not set
+# CONFIG_PKG_USING_ANV_TRACE is not set
+# CONFIG_PKG_USING_ANV_MEMLEAK is not set
+# CONFIG_PKG_USING_ANV_TESTSUIT is not set
+# CONFIG_PKG_USING_ANV_BENCH is not set
+# CONFIG_PKG_USING_DEVMEM is not set
+# CONFIG_PKG_USING_REGEX is not set
+# CONFIG_PKG_USING_MEM_SANDBOX is not set
+# CONFIG_PKG_USING_SOLAR_TERMS is not set
+# CONFIG_PKG_USING_GAN_ZHI is not set
#
# system packages
@@ -293,16 +374,47 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_PERSIMMON is not set
# CONFIG_PKG_USING_CAIRO is not set
# CONFIG_PKG_USING_PIXMAN is not set
-# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_FAL is not set
+# CONFIG_PKG_USING_FLASHDB is not set
# CONFIG_PKG_USING_SQLITE is not set
# CONFIG_PKG_USING_RTI is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
# CONFIG_PKG_USING_CMSIS is not set
# CONFIG_PKG_USING_DFS_YAFFS is not set
# CONFIG_PKG_USING_LITTLEFS is not set
+# CONFIG_PKG_USING_DFS_JFFS2 is not set
+# CONFIG_PKG_USING_DFS_UFFS is not set
+# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_THREAD_POOL is not set
+# CONFIG_PKG_USING_ROBOTS is not set
+# CONFIG_PKG_USING_EV is not set
+# CONFIG_PKG_USING_SYSWATCH is not set
+# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set
+# CONFIG_PKG_USING_PLCCORE is not set
+# CONFIG_PKG_USING_RAMDISK is not set
+# CONFIG_PKG_USING_MININI is not set
+# CONFIG_PKG_USING_QBOOT is not set
+
+#
+# Micrium: Micrium software products porting for RT-Thread
+#
+# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set
+# CONFIG_PKG_USING_UCOSII_WRAPPER is not set
+# CONFIG_PKG_USING_UC_CRC is not set
+# CONFIG_PKG_USING_UC_CLK is not set
+# CONFIG_PKG_USING_UC_COMMON is not set
+# CONFIG_PKG_USING_UC_MODBUS is not set
+# CONFIG_PKG_USING_PPOOL is not set
+# CONFIG_PKG_USING_OPENAMP is not set
+# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
+# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
+# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
+# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
+# CONFIG_PKG_USING_QFPLIB_M3 is not set
+# CONFIG_PKG_USING_LPM is not set
+# CONFIG_PKG_USING_TLSF is not set
+# CONFIG_PKG_USING_EVENT_RECORDER is not set
#
# peripheral libraries and drivers
@@ -310,7 +422,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set
-# CONFIG_PKG_USING_AP3216C is not set
+# CONFIG_PKG_USING_SHT3X is not set
+# CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
@@ -319,15 +432,70 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_SX12XX is not set
# CONFIG_PKG_USING_SIGNAL_LED is not set
# CONFIG_PKG_USING_LEDBLINK is not set
+# CONFIG_PKG_USING_LITTLED is not set
+# CONFIG_PKG_USING_LKDGUI is not set
+# CONFIG_PKG_USING_NRF5X_SDK is not set
+# CONFIG_PKG_USING_NRFX is not set
# CONFIG_PKG_USING_WM_LIBRARIES is not set
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
# CONFIG_PKG_USING_INFRARED is not set
# CONFIG_PKG_USING_ROSSERIAL is not set
+# CONFIG_PKG_USING_AGILE_BUTTON is not set
+# CONFIG_PKG_USING_AGILE_LED is not set
# CONFIG_PKG_USING_AT24CXX is not set
# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
# CONFIG_PKG_USING_AD7746 is not set
# CONFIG_PKG_USING_PCA9685 is not set
# CONFIG_PKG_USING_I2C_TOOLS is not set
+# CONFIG_PKG_USING_NRF24L01 is not set
+# CONFIG_PKG_USING_TOUCH_DRIVERS is not set
+# CONFIG_PKG_USING_MAX17048 is not set
+# CONFIG_PKG_USING_RPLIDAR is not set
+# CONFIG_PKG_USING_AS608 is not set
+# CONFIG_PKG_USING_RC522 is not set
+# CONFIG_PKG_USING_WS2812B is not set
+# CONFIG_PKG_USING_EMBARC_BSP is not set
+# CONFIG_PKG_USING_EXTERN_RTC_DRIVERS is not set
+# CONFIG_PKG_USING_MULTI_RTIMER is not set
+# CONFIG_PKG_USING_MAX7219 is not set
+# CONFIG_PKG_USING_BEEP is not set
+# CONFIG_PKG_USING_EASYBLINK is not set
+# CONFIG_PKG_USING_PMS_SERIES is not set
+# CONFIG_PKG_USING_CAN_YMODEM is not set
+# CONFIG_PKG_USING_LORA_RADIO_DRIVER is not set
+# CONFIG_PKG_USING_QLED is not set
+# CONFIG_PKG_USING_PAJ7620 is not set
+# CONFIG_PKG_USING_AGILE_CONSOLE is not set
+# CONFIG_PKG_USING_LD3320 is not set
+# CONFIG_PKG_USING_WK2124 is not set
+# CONFIG_PKG_USING_LY68L6400 is not set
+# CONFIG_PKG_USING_DM9051 is not set
+# CONFIG_PKG_USING_SSD1306 is not set
+# CONFIG_PKG_USING_QKEY is not set
+# CONFIG_PKG_USING_RS485 is not set
+# CONFIG_PKG_USING_NES is not set
+# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
+# CONFIG_PKG_USING_VDEVICE is not set
+# CONFIG_PKG_USING_SGM706 is not set
+# CONFIG_PKG_USING_STM32WB55_SDK is not set
+# CONFIG_PKG_USING_RDA58XX is not set
+# CONFIG_PKG_USING_LIBNFC is not set
+# CONFIG_PKG_USING_MFOC is not set
+# CONFIG_PKG_USING_TMC51XX is not set
+# CONFIG_PKG_USING_TCA9534 is not set
+
+#
+# AI packages
+#
+# CONFIG_PKG_USING_LIBANN is not set
+# CONFIG_PKG_USING_NNOM is not set
+# CONFIG_PKG_USING_ONNX_BACKEND is not set
+# CONFIG_PKG_USING_ONNX_PARSER is not set
+# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
+# CONFIG_PKG_USING_ELAPACK is not set
+# CONFIG_PKG_USING_ULAPACK is not set
+# CONFIG_PKG_USING_QUEST is not set
+# CONFIG_PKG_USING_NAXOS is not set
#
# miscellaneous packages
@@ -337,13 +505,18 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set
# CONFIG_PKG_USING_QUICKLZ is not set
+# CONFIG_PKG_USING_LZMA is not set
# CONFIG_PKG_USING_MULTIBUTTON is not set
+# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
# CONFIG_PKG_USING_CANFESTIVAL is not set
# CONFIG_PKG_USING_ZLIB is not set
+# CONFIG_PKG_USING_MINIZIP is not set
# CONFIG_PKG_USING_DSTR is not set
# CONFIG_PKG_USING_TINYFRAME is not set
# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
# CONFIG_PKG_USING_DIGITALCTRL is not set
+# CONFIG_PKG_USING_UPACKER is not set
+# CONFIG_PKG_USING_UPARAM is not set
#
# samples: kernel and components samples
@@ -354,7 +527,25 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
# CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set
-# CONFIG_PKG_USING_NNOM is not set
+# CONFIG_PKG_USING_KI is not set
+# CONFIG_PKG_USING_ARMv7M_DWT is not set
+# CONFIG_PKG_USING_VT100 is not set
+# CONFIG_PKG_USING_UKAL is not set
+# CONFIG_PKG_USING_CRCLIB is not set
+
+#
+# entertainment: terminal games and other interesting software packages
+#
+# CONFIG_PKG_USING_THREES is not set
+# CONFIG_PKG_USING_2048 is not set
+# CONFIG_PKG_USING_SNAKE is not set
+# CONFIG_PKG_USING_TETRIS is not set
+# CONFIG_PKG_USING_DONUT is not set
+# CONFIG_PKG_USING_ACLOCK is not set
+# CONFIG_PKG_USING_LWGPS is not set
+# CONFIG_PKG_USING_STATE_MACHINE is not set
+# CONFIG_PKG_USING_MCURSES is not set
+# CONFIG_PKG_USING_COWSAY is not set
CONFIG_SOC_FAMILY_STM32=y
CONFIG_SOC_SERIES_STM32F4=y
@@ -369,11 +560,12 @@ CONFIG_SOC_STM32F407ZG=y
CONFIG_BSP_USING_USB_TO_USART=y
# CONFIG_BSP_USING_COM2 is not set
# CONFIG_BSP_USING_COM3 is not set
+# CONFIG_BSP_USING_SRAM is not set
# CONFIG_BSP_USING_SPI_FLASH is not set
# CONFIG_BSP_USING_EEPROM is not set
# CONFIG_BSP_USING_ETH is not set
# CONFIG_BSP_USING_MPU6050 is not set
-# CONFIG_BSP_USING_SDCARD is not set
+# CONFIG_BSP_USING_FS is not set
#
# On-chip Peripheral Drivers
@@ -394,9 +586,17 @@ CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_USING_SPI is not set
# CONFIG_BSP_USING_ADC is not set
# CONFIG_BSP_USING_I2C1 is not set
+# CONFIG_BSP_USING_DAC is not set
# CONFIG_BSP_USING_ONCHIP_RTC is not set
# CONFIG_BSP_USING_WDT is not set
# CONFIG_BSP_USING_SDIO is not set
+# CONFIG_BSP_USING_USBD is not set
+# CONFIG_BSP_USING_USBH is not set
+# CONFIG_BSP_USING_PULSE_ENCODER is not set
+# CONFIG_BSP_USING_EXT_FMC_IO is not set
+# CONFIG_BSP_USING_FMC is not set
+# CONFIG_BSP_USING_RNG is not set
+# CONFIG_BSP_USING_UDID is not set
#
# Board extended module Drivers
diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig
index 4ee966382f..66a34d22bb 100644
--- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig
+++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig
@@ -71,18 +71,26 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_I2C1
select PKG_USING_MPU6XXX
- config BSP_USING_SDCARD
- bool "Enable SDCARD (sdio)"
- select BSP_USING_SDIO
+ menuconfig BSP_USING_FS
+ bool "Enable filesystem"
select RT_USING_DFS
- select RT_USING_DFS_ELMFAT
+ select RT_USING_DFS_ROMFS
default n
- config SDIO_MAX_FREQ
- int "sdio max freq"
- range 0 24000000
- depends on BSP_USING_SDCARD
- default 1000000
+ if BSP_USING_FS
+ config BSP_USING_SDCARD
+ bool "Enable SDCARD (FATFS)"
+ select BSP_USING_SDIO
+ select RT_USING_DFS
+ select RT_USING_DFS_ELMFAT
+ default n
+
+ config SDIO_MAX_FREQ
+ int "sdio max freq"
+ range 0 24000000
+ depends on BSP_USING_SDCARD
+ default 1000000
+ endif
endmenu
diff --git a/bsp/stm32/stm32f407-atk-explorer/board/SConscript b/bsp/stm32/stm32f407-atk-explorer/board/SConscript
index e97905718f..64b8ab3f41 100644
--- a/bsp/stm32/stm32f407-atk-explorer/board/SConscript
+++ b/bsp/stm32/stm32f407-atk-explorer/board/SConscript
@@ -18,8 +18,8 @@ if GetDepend(['BSP_USING_ETH']):
if GetDepend(['BSP_USING_SPI_FLASH']):
src += Glob('ports/spi_flash_init.c')
-if GetDepend(['BSP_USING_SDCARD']):
- src += Glob('ports/drv_sdcard.c')
+if GetDepend(['BSP_USING_FS']):
+ src += Glob('ports/drv_filesystem.c')
if GetDepend(['BSP_USING_SRAM']):
src += Glob('ports/drv_sram.c')
diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c
new file mode 100644
index 0000000000..a8b36da2e1
--- /dev/null
+++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2018-12-13 balanceTWK add sdcard port file
+ * 2021-05-10 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
+ * 2021-07-28 Meco Man implement romfs as the root filesystem
+ */
+
+#include <rtthread.h>
+
+#ifdef BSP_USING_FS
+#include <dfs_romfs.h>
+#include <dfs_fs.h>
+#include <dfs_posix.h>
+
+#if DFS_FILESYSTEMS_MAX < 4
+#error "Please define DFS_FILESYSTEMS_MAX more than 4"
+#endif
+#if DFS_FILESYSTEM_TYPES_MAX < 4
+#error "Please define DFS_FILESYSTEM_TYPES_MAX more than 4"
+#endif
+
+#define DBG_TAG "app.filesystem"
+#define DBG_LVL DBG_INFO
+#include <rtdbg.h>
+
+#ifdef BSP_USING_SDCARD
+static void sd_mount(void *parameter)
+{
+ while (1)
+ {
+ rt_thread_mdelay(500);
+ if(rt_device_find("sd0") != RT_NULL)
+ {
+ if (dfs_mount("sd0", "/sdcard", "elm", 0, 0) == RT_EOK)
+ {
+ LOG_I("sd card mount to '/sdcard'");
+ break;
+ }
+ else
+ {
+ LOG_W("sd card mount to '/sdcard' failed!");
+ }
+ }
+ }
+}
+
+static int onboard_sdcard_mount(void)
+{
+ rt_thread_t tid;
+
+ if (dfs_mount("sd0", "/sdcard", "elm", 0, 0) == RT_EOK)
+ {
+ LOG_I("sd card mount to '/sdcard'");
+ }
+ else
+ {
+ tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
+ 1024, RT_THREAD_PRIORITY_MAX - 2, 20);
+ if (tid != RT_NULL)
+ {
+ rt_thread_startup(tid);
+ }
+ else
+ {
+ LOG_E("create sd_mount thread err!");
+ }
+ }
+
+ return RT_EOK;
+}
+#endif
+
+static const struct romfs_dirent _romfs_root[] =
+{
+#ifdef BSP_USING_SDCARD
+ {ROMFS_DIRENT_DIR, "sdcard", RT_NULL, 0},
+#endif
+// {ROMFS_DIRENT_DIR, "flash", RT_NULL, 0},
+};
+
+const struct romfs_dirent romfs_root =
+{
+ ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_romfs_root, sizeof(_romfs_root) / sizeof(_romfs_root[0])
+};
+
+static int filesystem_mount(void)
+{
+ if (dfs_mount(RT_NULL, "/", "rom", 0, &(romfs_root)) != 0)
+ {
+ LOG_E("rom mount to '/' failed!");
+ }
+#ifdef BSP_USING_SDCARD
+ onboard_sdcard_mount();
+#endif
+
+ return RT_EOK;
+}
+INIT_APP_EXPORT(filesystem_mount);
+
+#endif /* BSP_USING_FS */
diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_sdcard.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_sdcard.c
deleted file mode 100644
index 4ad71158f4..0000000000
--- a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_sdcard.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2018-12-13 balanceTWK add sdcard port file
- * 2021-05-10 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
- */
-
-#include <rtthread.h>
-
-#ifdef BSP_USING_SDCARD
-
-#include <dfs_elm.h>
-#include <dfs_fs.h>
-#include <dfs_posix.h>
-
-#define DBG_TAG "app.card"
-#define DBG_LVL DBG_INFO
-#include <rtdbg.h>
-
-static void sd_mount(void *parameter)
-{
- while (1)
- {
- rt_thread_mdelay(500);
- if(rt_device_find("sd0") != RT_NULL)
- {
- if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
- {
- LOG_I("sd card mount to '/'");
- break;
- }
- else
- {
- LOG_W("sd card mount to '/' failed!");
- }
- }
- }
-}
-
-static int onboard_sdcard_mount(void)
-{
- rt_thread_t tid;
-
- if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
- {
- LOG_I("sd card mount to '/'");
- }
- else
- {
- tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
- 1024, RT_THREAD_PRIORITY_MAX - 2, 20);
- if (tid != RT_NULL)
- {
- rt_thread_startup(tid);
- }
- else
- {
- LOG_E("create sd_mount thread err!");
- }
- }
-
- return RT_EOK;
-}
-INIT_APP_EXPORT(onboard_sdcard_mount);
-
-#endif /* BSP_USING_SDCARD */
diff --git a/bsp/stm32/stm32f407-atk-explorer/rtconfig.h b/bsp/stm32/stm32f407-atk-explorer/rtconfig.h
index 35192cf5cb..abac617fcc 100644
--- a/bsp/stm32/stm32f407-atk-explorer/rtconfig.h
+++ b/bsp/stm32/stm32f407-atk-explorer/rtconfig.h
@@ -16,6 +16,9 @@
#define RT_USING_IDLE_HOOK
#define RT_IDLE_HOOK_LIST_SIZE 4
#define IDLE_THREAD_STACK_SIZE 1024
+
+/* kservice optimization */
+
#define RT_DEBUG
#define RT_DEBUG_COLOR
@@ -39,7 +42,7 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart1"
-#define RT_VER_NUM 0x40002
+#define RT_VER_NUM 0x40004
#define ARCH_ARM
#define RT_USING_CPU_FFS
#define ARCH_ARM_CORTEX_M
@@ -79,21 +82,18 @@
#define RT_USING_DEVICE_IPC
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
+#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_PIN
-/* Using Hardware Crypto drivers */
-
-
-/* Using WiFi */
-
-
/* Using USB */
/* POSIX layer and C standard library */
+#define RT_LIBC_USING_TIME
+#define RT_LIBC_DEFAULT_TIMEZONE 8
/* Network */
@@ -106,9 +106,6 @@
/* light weight TCP/IP stack */
-/* Modbus master and slave stack */
-
-
/* AT commands */
@@ -118,6 +115,9 @@
/* Utilities */
+/* RT-Thread Utestcases */
+
+
/* RT-Thread online packages */
/* IoT - internet of things */
@@ -149,14 +149,23 @@
/* system packages */
+/* Micrium: Micrium software products porting for RT-Thread */
+
+
/* peripheral libraries and drivers */
+/* AI packages */
+
+
/* miscellaneous packages */
/* samples: kernel and components samples */
+
+/* entertainment: terminal games and other interesting software packages */
+
#define SOC_FAMILY_STM32
#define SOC_SERIES_STM32F4
diff --git a/components/dfs/include/dfs_select.h b/components/dfs/include/dfs_select.h
index 458691df20..e0572c5059 100644
--- a/components/dfs/include/dfs_select.h
+++ b/components/dfs/include/dfs_select.h
@@ -10,7 +10,7 @@
#ifndef DFS_SELECT_H__
#define DFS_SELECT_H__
-#include <libc/libc_fdset.h>
+#include <sys/select.h>
#ifdef __cplusplus
extern "C" {
diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h
index 03d38b2f4d..a156145641 100644
--- a/components/drivers/include/ipc/workqueue.h
+++ b/components/drivers/include/ipc/workqueue.h
@@ -69,7 +69,7 @@ rt_err_t rt_workqueue_critical_work(struct rt_workqueue *queue, struct rt_work *
#ifdef RT_USING_SYSTEM_WORKQUEUE
rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t time);
rt_err_t rt_work_cancel(struct rt_work *work);
-#endif
+#endif /* RT_USING_SYSTEM_WORKQUEUE */
rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data),
void *work_data)
@@ -85,7 +85,6 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo
void rt_delayed_work_init(struct rt_delayed_work *work, void (*work_func)(struct rt_work *work,
void *work_data), void *work_data);
-int rt_work_sys_workqueue_init(void);
-#endif
+#endif /* RT_USING_HEAP */
#endif
diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c
index f195dad927..065c505015 100644
--- a/components/drivers/src/workqueue.c
+++ b/components/drivers/src/workqueue.c
@@ -358,7 +358,7 @@ rt_err_t rt_work_cancel(struct rt_work *work)
return rt_workqueue_cancel_work(sys_workq, work);
}
-int rt_work_sys_workqueue_init(void)
+static int rt_work_sys_workqueue_init(void)
{
if (sys_workq != RT_NULL)
return RT_EOK;
@@ -370,5 +370,5 @@ int rt_work_sys_workqueue_init(void)
return RT_EOK;
}
INIT_PREV_EXPORT(rt_work_sys_workqueue_init);
-#endif
-#endif
+#endif /* RT_USING_SYSTEM_WORKQUEUE */
+#endif /* RT_USING_HEAP */
diff --git a/components/libc/aio/posix_aio.c b/components/libc/aio/posix_aio.c
index 66f15e4c57..66cced8687 100644
--- a/components/libc/aio/posix_aio.c
+++ b/components/libc/aio/posix_aio.c
@@ -9,14 +9,8 @@
*/
#include <stdint.h>
-#include <stdio.h>
-
#include <rthw.h>
-#include <rtdevice.h>
-#include <rtthread.h>
-
#include <dfs_posix.h>
-
#include "posix_aio.h"
struct rt_workqueue* aio_queue = NULL;
diff --git a/components/libc/aio/posix_aio.h b/components/libc/aio/posix_aio.h
index de11738515..4e25e1d15b 100644
--- a/components/libc/aio/posix_aio.h
+++ b/components/libc/aio/posix_aio.h
@@ -11,6 +11,10 @@
#ifndef POSIX_AIO_H__
#define POSIX_AIO_H__
+#include <stdio.h>
+#include <sys/signal.h>
+#include <rtdevice.h>
+
struct aiocb
{
int aio_fildes; /* File descriptor. */
diff --git a/components/libc/compilers/common/none-gcc/sys/errno.h b/components/libc/compilers/common/none-gcc/sys/errno.h
index ad3614024d..ff1abca387 100644
--- a/components/libc/compilers/common/none-gcc/sys/errno.h
+++ b/components/libc/compilers/common/none-gcc/sys/errno.h
@@ -7,8 +7,8 @@
* Date Author Notes
* 2021-05-22 Meco Man The first version.
*/
-#ifndef _SYS_ERRNO_H
-#define _SYS_ERRNO_H
+#ifndef __SYS_ERRNO_H__
+#define __SYS_ERRNO_H__
#if defined(__ARMCC_VERSION)
/*
diff --git a/components/libc/compilers/common/none-gcc/sys/stat.h b/components/libc/compilers/common/none-gcc/sys/stat.h
index c4b42083c4..c8f65df435 100644
--- a/components/libc/compilers/common/none-gcc/sys/stat.h
+++ b/components/libc/compilers/common/none-gcc/sys/stat.h
@@ -6,3 +6,8 @@
* Change Logs:
* Date Author Notes
*/
+
+ #ifndef __SYS_STAT_H__
+ #define __SYS_STAT_H__
+
+ #endif
diff --git a/components/libc/compilers/common/none-gcc/sys/types.h b/components/libc/compilers/common/none-gcc/sys/types.h
index 7222326a2a..e9f44f7762 100644
--- a/components/libc/compilers/common/none-gcc/sys/types.h
+++ b/components/libc/compilers/common/none-gcc/sys/types.h
@@ -8,8 +8,8 @@
* 2020-09-05 Meco Man fix bugs
* 2020-12-16 Meco Man add useconds_t
*/
-#ifndef __TYPES_H__
-#define __TYPES_H__
+#ifndef __SYS_TYPES_H__
+#define __SYS_TYPES_H__
#include <stdint.h>
diff --git a/components/libc/compilers/common/none-gcc/sys/unistd.h b/components/libc/compilers/common/none-gcc/sys/unistd.h
index 2f01f660b3..ea2d674b0f 100644
--- a/components/libc/compilers/common/none-gcc/sys/unistd.h
+++ b/components/libc/compilers/common/none-gcc/sys/unistd.h
@@ -7,8 +7,8 @@
* Date Author Notes
* 2020-12-16 Meco Man add usleep
*/
-#ifndef _SYS_UNISTD_H
-#define _SYS_UNISTD_H
+#ifndef __SYS_UNISTD_H__
+#define __SYS_UNISTD_H__
#include <rtconfig.h>
#include "types.h"
diff --git a/components/libc/compilers/common/sys/select.h b/components/libc/compilers/common/sys/select.h
new file mode 100644
index 0000000000..db42b6ebcc
--- /dev/null
+++ b/components/libc/compilers/common/sys/select.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2021-07-21 Meco Man The first version
+ */
+
+#ifndef __SYS_SELECT_H__
+#define __SYS_SELECT_H__
+
+#include <rtconfig.h>
+#include <sys/types.h>
+
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 32
+#endif
+
+#ifdef SAL_USING_POSIX
+#ifdef FD_SETSIZE
+#undef FD_SETSIZE
+#endif
+#define FD_SETSIZE DFS_FD_MAX
+#endif /* SAL_USING_POSIX */
+
+#define NBBY 8 /* number of bits in a byte */
+
+typedef long fd_mask;
+
+#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
+#ifndef howmany
+#define howmany(x,y) (((x)+((y)-1))/(y))
+#endif
+
+#ifndef _SYS_TYPES_FD_SET /* MIPS */
+typedef struct _types_fd_set {
+ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
+} _types_fd_set;
+#define fd_set _types_fd_set
+
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
+#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
+#endif /* _SYS_TYPES_FD_SET */
+
+#endif /* __SYS_SELECT_H__ */
diff --git a/include/libc/libc_signal.h b/components/libc/compilers/common/sys/signal.h
index 1fb8194643..9787958a37 100644
--- a/include/libc/libc_signal.h
+++ b/components/libc/compilers/common/sys/signal.h
@@ -6,33 +6,27 @@
* Change Logs:
* Date Author Notes
* 2017-09-12 Bernard The first version
+ * 2021-07-21 Meco Man move to libc/common
*/
-#ifndef LIBC_SIGNAL_H__
-#define LIBC_SIGNAL_H__
+#ifndef __SYS_SIGNAL_H__
+#define __SYS_SIGNAL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
-#ifdef HAVE_CCONFIG_H
-#include <cconfig.h>
-#endif
-#ifndef HAVE_SIGVAL
/* Signal Generation and Delivery, P1003.1b-1993, p. 63
NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and
sigev_notify_attributes to the sigevent structure. */
-
union sigval
{
int sival_int; /* Integer signal value */
void *sival_ptr; /* Pointer signal value */
};
-#endif
-#ifndef HAVE_SIGEVENT
struct sigevent
{
int sigev_notify; /* Notification type */
@@ -42,9 +36,7 @@ struct sigevent
/* Notification function */
void *sigev_notify_attributes; /* Notification Attributes, really pthread_attr_t */
};
-#endif
-#ifndef HAVE_SIGINFO
struct siginfo
{
uint16_t si_signo;
@@ -53,26 +45,37 @@ struct siginfo
union sigval si_value;
};
typedef struct siginfo siginfo_t;
-#endif
#define SI_USER 0x01 /* Signal sent by kill(). */
#define SI_QUEUE 0x02 /* Signal sent by sigqueue(). */
-#define SI_TIMER 0x03 /* Signal generated by expiration of a
- timer set by timer_settime(). */
-#define SI_ASYNCIO 0x04 /* Signal generated by completion of an
- asynchronous I/O request. */
-#define SI_MESGQ 0x05 /* Signal generated by arrival of a
- message on an empty message queue. */
+#define SI_TIMER 0x03 /* Signal generated by expiration of a timer set by timer_settime(). */
+#define SI_ASYNCIO 0x04 /* Signal generated by completion of an asynchronous I/O request. */
+#define SI_MESGQ 0x05 /* Signal generated by arrival of a message on an empty message queue. */
-#if !defined(RT_USING_NEWLIB)
typedef void (*_sig_func_ptr)(int);
typedef unsigned long sigset_t;
-#endif
-#include <signal.h>
+struct sigaction
+{
+ _sig_func_ptr sa_handler;
+ sigset_t sa_mask;
+ int sa_flags;
+};
-#ifdef __ARMCC_VERSION
+#define SIG_SETMASK 0 /* set mask with sigprocmask() */
+#define SIG_BLOCK 1 /* set of signals to block */
+#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
+#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
+#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
+#define sigemptyset(what) (*(what) = 0, 0)
+#define sigfillset(what) (*(what) = ~(0), 0)
+#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
+
+int sigprocmask (int how, const sigset_t *set, sigset_t *oset);
+int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
+
+#ifdef __ARMCC_VERSION
#define SIGHUP 1
/* #define SIGINT 2 */
#define SIGQUIT 3
@@ -103,28 +106,9 @@ typedef unsigned long sigset_t;
#define SIGRTMAX 31
#define NSIG 32
-#define SIG_SETMASK 0 /* set mask with sigprocmask() */
-#define SIG_BLOCK 1 /* set of signals to block */
-#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
-
-struct sigaction
-{
- _sig_func_ptr sa_handler;
- sigset_t sa_mask;
- int sa_flags;
-};
-
-#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
-#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
-#define sigemptyset(what) (*(what) = 0, 0)
-#define sigfillset(what) (*(what) = ~(0), 0)
-#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
-
-int sigprocmask (int how, const sigset_t *set, sigset_t *oset);
-int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
+#include <signal.h>
#elif defined(__IAR_SYSTEMS_ICC__)
-
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
@@ -155,25 +139,51 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
#define SIGRTMAX 31
#define NSIG 32
-#define SIG_SETMASK 0 /* set mask with sigprocmask() */
-#define SIG_BLOCK 1 /* set of signals to block */
-#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
+#include <signal.h>
-struct sigaction
-{
- _sig_func_ptr sa_handler;
- sigset_t sa_mask;
- int sa_flags;
-};
+#elif defined(__GNUC__)
+#define SIGHUP 1 /* hangup */
+#define SIGINT 2 /* interrupt */
+#define SIGQUIT 3 /* quit */
+#define SIGILL 4 /* illegal instruction (not reset when caught) */
+#define SIGTRAP 5 /* trace trap (not reset when caught) */
+#define SIGIOT 6 /* IOT instruction */
+#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
+#define SIGEMT 7 /* EMT instruction */
+#define SIGFPE 8 /* floating point exception */
+#define SIGKILL 9 /* kill (cannot be caught or ignored) */
+#define SIGBUS 10 /* bus error */
+#define SIGSEGV 11 /* segmentation violation */
+#define SIGSYS 12 /* bad argument to system call */
+#define SIGPIPE 13 /* write on a pipe with no one to read it */
+#define SIGALRM 14 /* alarm clock */
+#define SIGTERM 15 /* software termination signal from kill */
+#define SIGURG 16 /* urgent condition on IO channel */
+#define SIGSTOP 17 /* sendable stop signal not from tty */
+#define SIGTSTP 18 /* stop signal from tty */
+#define SIGCONT 19 /* continue a stopped process */
+#define SIGCHLD 20 /* to parent on child stop or exit */
+#define SIGCLD 20 /* System V name for SIGCHLD */
+#define SIGTTIN 21 /* to readers pgrp upon background tty read */
+#define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
+#define SIGIO 23 /* input/output possible signal */
+#define SIGPOLL SIGIO /* System V name for SIGIO */
+#define SIGXCPU 24 /* exceeded CPU time limit */
+#define SIGXFSZ 25 /* exceeded file size limit */
+#define SIGVTALRM 26 /* virtual time alarm */
+#define SIGPROF 27 /* profiling time alarm */
+#define SIGWINCH 28 /* window changed */
+#define SIGLOST 29 /* resource lost (eg, record-lock lost) */
+#define SIGUSR1 30 /* user defined signal 1 */
+#define SIGUSR2 31 /* user defined signal 2 */
+#define NSIG 32 /* signal 0 implied */
-#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
-#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
-#define sigemptyset(what) (*(what) = 0, 0)
-#define sigfillset(what) (*(what) = ~(0), 0)
-#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
+#ifndef _SIGNAL_H_
+/* Some applications take advantage of the fact that <sys/signal.h>
+ * and <signal.h> are equivalent in glibc. Allow for that here. */
+#include <signal.h>
+#endif
-int sigprocmask (int how, const sigset_t *set, sigset_t *oset);
-int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
#endif
#ifdef __cplusplus
diff --git a/components/libc/pthreads/mqueue.c b/components/libc/pthreads/mqueue.c
index ce2ff43e23..6840164a68 100644
--- a/components/libc/pthreads/mqueue.c
+++ b/components/libc/pthreads/mqueue.c
@@ -8,6 +8,7 @@
*/
#include <string.h>
+#include <sys/signal.h>
#include "mqueue.h"
#include "pthread_internal.h"
diff --git a/components/libc/signal/posix_signal.c b/components/libc/signal/posix_signal.c
index d664feb24d..ac8d2b1eef 100644
--- a/components/libc/signal/posix_signal.c
+++ b/components/libc/signal/posix_signal.c
@@ -7,6 +7,7 @@
* Date Author Notes
* 2017/10/1 Bernard The first version
*/
+
#include <rthw.h>
#include <rtthread.h>
@@ -14,6 +15,7 @@
#include <sys/errno.h>
#include "posix_signal.h"
+
#define sig_valid(sig_no) (sig_no >= 0 && sig_no < RT_SIG_MAX)
void (*signal(int sig, void (*func)(int))) (int)
@@ -79,13 +81,10 @@ int sigtimedwait(const sigset_t *set, siginfo_t *info,
int ret = 0;
int tick = RT_WAITING_FOREVER;
-#ifdef RT_USING_PTHREADS
if (timeout)
{
- extern int clock_time_to_tick(const struct timespec *time);
tick = rt_timespec_to_tick(timeout);
}
-#endif
ret = rt_signal_wait(set, info, tick);
if (ret == 0) return 0;
diff --git a/components/libc/signal/posix_signal.h b/components/libc/signal/posix_signal.h
index fa8ad38fa6..f04b54c5f8 100644
--- a/components/libc/signal/posix_signal.h
+++ b/components/libc/signal/posix_signal.h
@@ -15,7 +15,6 @@
extern "C" {
#endif
-#include <rtthread.h>
#include <sys/signal.h>
enum rt_signal_value{
diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c
index 973be0acf4..8215dd4417 100644
--- a/components/net/at/at_socket/at_socket.c
+++ b/components/net/at/at_socket/at_socket.c
@@ -13,6 +13,7 @@
#include <string.h>
#include <ctype.h>
#include <sys/time.h>
+#include <sys/errno.h>
#include <at_socket.h>
#include <at_device.h>
@@ -78,7 +79,7 @@ struct at_socket *at_get_socket(int socket)
}
/* get a block to the AT socket receive list*/
-static size_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
+static rt_err_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
{
at_recv_pkt_t pkt = RT_NULL;
@@ -86,7 +87,7 @@ static size_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
if (pkt == RT_NULL)
{
LOG_E("No memory for receive packet table!");
- return 0;
+ return -RT_ENOMEM;
}
pkt->bfsz_totle = length;
@@ -95,7 +96,7 @@ static size_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
rt_slist_append(rlist, &pkt->list);
- return length;
+ return RT_EOK;
}
/* delete and free all receive buffer list */
@@ -651,14 +652,20 @@ static void at_recv_notice_cb(struct at_socket *sock, at_socket_evt_t event, con
RT_ASSERT(event == AT_SOCKET_EVT_RECV);
/* check the socket object status */
- if (sock->magic != AT_SOCKET_MAGIC)
+ if (sock->magic != AT_SOCKET_MAGIC || sock->state == AT_SOCKET_CLOSED)
{
+ rt_free((void *)buff);
return;
}
/* put receive buffer to receiver packet list */
rt_mutex_take(sock->recv_lock, RT_WAITING_FOREVER);
- at_recvpkt_put(&(sock->recvpkt_list), buff, bfsz);
+ if (at_recvpkt_put(&(sock->recvpkt_list), buff, bfsz) != RT_EOK)
+ {
+ rt_free((void *)buff);
+ rt_mutex_release(sock->recv_lock);
+ return;
+ }
rt_mutex_release(sock->recv_lock);
rt_sem_release(sock->recv_notice);
diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c
index 7904c24d92..948020f4cf 100644
--- a/components/net/at/src/at_client.c
+++ b/components/net/at/src/at_client.c
@@ -9,6 +9,7 @@
* 2018-04-12 chenyong add client implement
* 2018-08-17 chenyong multiple client support
* 2021-03-17 Meco Man fix a buf of leaking memory
+ * 2021-07-14 Sszl fix a buf of leaking memory
*/
#include <at.h>
@@ -571,30 +572,19 @@ int at_obj_set_urc_table(at_client_t client, const struct at_urc *urc_table, rt_
}
else
{
- struct at_urc_table *old_urc_table = RT_NULL;
- size_t old_table_size = client->urc_table_size * sizeof(struct at_urc_table);
-
- old_urc_table = (struct at_urc_table *) rt_malloc(old_table_size);
- if (old_urc_table == RT_NULL)
- {
- return -RT_ENOMEM;
- }
- rt_memcpy(old_urc_table, client->urc_table, old_table_size);
+ struct at_urc_table *new_urc_table = RT_NULL;
/* realloc urc table space */
- client->urc_table = (struct at_urc_table *) rt_realloc(client->urc_table,
- old_table_size + sizeof(struct at_urc_table));
- if (client->urc_table == RT_NULL)
+ new_urc_table = (struct at_urc_table *) rt_realloc(client->urc_table,client->urc_table_size * sizeof(struct at_urc_table) + sizeof(struct at_urc_table));
+ if (new_urc_table == RT_NULL)
{
- rt_free(old_urc_table);
return -RT_ENOMEM;
}
- rt_memcpy(client->urc_table, old_urc_table, old_table_size);
+ client->urc_table = new_urc_table;
client->urc_table[client->urc_table_size].urc = urc_table;
client->urc_table[client->urc_table_size].urc_size = table_sz;
client->urc_table_size++;
- rt_free(old_urc_table);
}
return RT_EOK;
diff --git a/components/net/sal_socket/include/socket/netdb.h b/components/net/sal_socket/include/socket/netdb.h
index 4783405022..9d54953681 100644
--- a/components/net/sal_socket/include/socket/netdb.h
+++ b/components/net/sal_socket/include/socket/netdb.h
@@ -6,7 +6,7 @@
* Change Logs:
* Date Author Notes
* 2015-02-17 Bernard First version
- * 2108-05-24 ChenYong Add socket abstraction layer
+ * 2018-05-24 ChenYong Add socket abstraction layer
*/
#ifndef NETDB_H__
diff --git a/examples/kernel/event_simple.c b/examples/kernel/event_simple.c
index d2a2948fc7..8b2f966d3d 100644
--- a/examples/kernel/event_simple.c
+++ b/examples/kernel/event_simple.c
@@ -83,7 +83,7 @@ static void thread3_entry(void *param)
int event_simple_init()
{
/* 初始化事件对象 */
- rt_event_init(&event, "event", RT_IPC_FLAG_FIFO);
+ rt_event_init(&event, "event", RT_IPC_FLAG_PRIO);
/* 创建线程1 */
tid1 = rt_thread_create("t1",
diff --git a/examples/kernel/mbox_send_wait.c b/examples/kernel/mbox_send_wait.c
index 67f358ecea..919ceca31d 100644
--- a/examples/kernel/mbox_send_wait.c
+++ b/examples/kernel/mbox_send_wait.c
@@ -82,7 +82,7 @@ int mbox_send_wait_init()
"mbt", /* 名称是mbt */
&mb_pool[0], /* 邮箱用到的内存池是mb_pool */
sizeof(mb_pool)/4, /* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */
- RT_IPC_FLAG_FIFO); /* 采用FIFO方式进行线程等待 */
+ RT_IPC_FLAG_PRIO); /* 采用PRIO方式进行线程等待 */
/* 创建线程1 */
tid1 = rt_thread_create("t1",
diff --git a/examples/kernel/mbox_simple.c b/examples/kernel/mbox_simple.c
index 3f39bc0016..373c5f2817 100644
--- a/examples/kernel/mbox_simple.c
+++ b/examples/kernel/mbox_simple.c
@@ -80,7 +80,7 @@ int mbox_simple_init()
"mbt", /* 名称是mbt */
&mb_pool[0], /* 邮箱用到的内存池是mb_pool */
sizeof(mb_pool)/4, /* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */
- RT_IPC_FLAG_FIFO); /* 采用FIFO方式进行线程等待 */
+ RT_IPC_FLAG_PRIO); /* 采用PRIO方式进行线程等待 */
/* 创建线程1 */
tid1 = rt_thread_create("t1",
diff --git a/examples/kernel/messageq_simple.c b/examples/kernel/messageq_simple.c
index 62504bebb7..90bed7dd82 100644
--- a/examples/kernel/messageq_simple.c
+++ b/examples/kernel/messageq_simple.c
@@ -98,7 +98,7 @@ int messageq_simple_init()
&msg_pool[0], /* 内存池指向msg_pool */
128 - sizeof(void*), /* 每个消息的大小是 128 - void* */
sizeof(msg_pool), /* 内存池的大小是msg_pool的大小 */
- RT_IPC_FLAG_FIFO); /* 如果有多个线程等待,按照先来先得到的方法分配消息 */
+ RT_IPC_FLAG_PRIO); /* 如果有多个线程等待,按照优先级由高到低的方法分配消息 */
/* 创建线程1 */
tid1 = rt_thread_create("t1",
diff --git a/examples/kernel/mutex_priority.c b/examples/kernel/mutex_priority.c
index c1db934157..a7702eed6f 100755
--- a/examples/kernel/mutex_priority.c
+++ b/examples/kernel/mutex_priority.c
@@ -281,7 +281,7 @@ static void thread29_entry(void* parameter)
static int mutex_simple_init()
{
/* 创建互斥锁 */
- mutex = rt_mutex_create("mutex", RT_IPC_FLAG_FIFO);
+ mutex = rt_mutex_create("mutex", RT_IPC_FLAG_PRIO);
if (mutex == RT_NULL)
{
tc_stat(TC_STAT_END | TC_STAT_FAILED);
diff --git a/examples/kernel/mutex_simple.c b/examples/kernel/mutex_simple.c
index 4f6c5d7d28..ee875cca7d 100644
--- a/examples/kernel/mutex_simple.c
+++ b/examples/kernel/mutex_simple.c
@@ -87,7 +87,7 @@ static void thread3_entry(void* parameter)
int mutex_simple_init()
{
/* 创建互斥锁 */
- mutex = rt_mutex_create("mutex", RT_IPC_FLAG_FIFO);
+ mutex = rt_mutex_create("mutex", RT_IPC_FLAG_PRIO);
if (mutex == RT_NULL)
{
tc_stat(TC_STAT_END | TC_STAT_FAILED);
diff --git a/examples/kernel/semaphore_buffer_worker.c b/examples/kernel/semaphore_buffer_worker.c
index 5e4723b417..bd5a488460 100644
--- a/examples/kernel/semaphore_buffer_worker.c
+++ b/examples/kernel/semaphore_buffer_worker.c
@@ -209,7 +209,7 @@ int semaphore_buffer_worker_init()
rb_init(&working_rb, working_buffer, BUFFER_SIZE);
/* 创建信号量 */
- sem = rt_sem_create("sem", 1, RT_IPC_FLAG_FIFO);
+ sem = rt_sem_create("sem", 1, RT_IPC_FLAG_PRIO);
if (sem == RT_NULL)
{
tc_stat(TC_STAT_END | TC_STAT_FAILED);
diff --git a/examples/kernel/semaphore_dynamic.c b/examples/kernel/semaphore_dynamic.c
index 564d73c496..dacdf10c37 100644
--- a/examples/kernel/semaphore_dynamic.c
+++ b/examples/kernel/semaphore_dynamic.c
@@ -78,7 +78,7 @@ static void thread_entry(void* parameter)
int semaphore_dynamic_init()
{
/* 创建一个信号量,初始值是0 */
- sem = rt_sem_create("sem", 0, RT_IPC_FLAG_FIFO);
+ sem = rt_sem_create("sem", 0, RT_IPC_FLAG_PRIO);
if (sem == RT_NULL)
{
tc_stat(TC_STAT_END | TC_STAT_FAILED);
diff --git a/examples/kernel/semaphore_producer_consumer.c b/examples/kernel/semaphore_producer_consumer.c
index b6f996ff57..4d9eb24e44 100644
--- a/examples/kernel/semaphore_producer_consumer.c
+++ b/examples/kernel/semaphore_producer_consumer.c
@@ -98,9 +98,9 @@ void consumer_thread_entry(void* parameter)
int semaphore_producer_consumer_init()
{
/* 初始化3个信号量 */
- rt_sem_init(&sem_lock , "lock", 1, RT_IPC_FLAG_FIFO);
- rt_sem_init(&sem_empty, "empty", MAXSEM, RT_IPC_FLAG_FIFO);
- rt_sem_init(&sem_full , "full", 0, RT_IPC_FLAG_FIFO);
+ rt_sem_init(&sem_lock , "lock", 1, RT_IPC_FLAG_PRIO);
+ rt_sem_init(&sem_empty, "empty", MAXSEM, RT_IPC_FLAG_PRIO);
+ rt_sem_init(&sem_full , "full", 0, RT_IPC_FLAG_PRIO);
/* 创建线程1 */
producer_tid = rt_thread_create("producer",
diff --git a/examples/kernel/semaphore_static.c b/examples/kernel/semaphore_static.c
index 641b0bc7c9..16b043db9c 100644
--- a/examples/kernel/semaphore_static.c
+++ b/examples/kernel/semaphore_static.c
@@ -81,7 +81,7 @@ int semaphore_static_init(void)
rt_err_t result;
/* 初始化信号量,初始值是0 */
- result = rt_sem_init(&sem, "sem", 0, RT_IPC_FLAG_FIFO);
+ result = rt_sem_init(&sem, "sem", 0, RT_IPC_FLAG_PRIO);
if (result != RT_EOK)
{
tc_stat(TC_STAT_END | TC_STAT_FAILED);
diff --git a/examples/kernel/tc_comm.c b/examples/kernel/tc_comm.c
index 7153412aa0..b98c97d9b3 100644
--- a/examples/kernel/tc_comm.c
+++ b/examples/kernel/tc_comm.c
@@ -35,7 +35,7 @@ void tc_thread_entry(void* parameter)
struct finsh_syscall* index;
/* create tc semaphore */
- rt_sem_init(&_tc_sem, "tc", 0, RT_IPC_FLAG_FIFO);
+ rt_sem_init(&_tc_sem, "tc", 0, RT_IPC_FLAG_PRIO);
do {
for (index = _syscall_table_begin; index < _syscall_table_end; FINSH_NEXT_SYSCALL(index))
diff --git a/examples/kernel/timer_timeout.c b/examples/kernel/timer_timeout.c
index 40bbbf2831..f72b45be3c 100644
--- a/examples/kernel/timer_timeout.c
+++ b/examples/kernel/timer_timeout.c
@@ -73,7 +73,7 @@ int timer_timeout_init()
&msg_pool[0], /* 内存池指向msg_pool */
128 - sizeof(void*), /* 每个消息的大小是 128 - void* */
sizeof(msg_pool), /* 内存池的大小是msg_pool的大小 */
- RT_IPC_FLAG_FIFO); /* 如果有多个线程等待,按照先来先得到的方法分配消息 */
+ RT_IPC_FLAG_PRIO); /* 如果有多个线程等待,按照优先级由高到低的方法分配消息 */
/* 创建线程 */
tid = rt_thread_create("t",
diff --git a/examples/pm/wakeup_app.c b/examples/pm/wakeup_app.c
index d287bf74ec..230d30ac4e 100644
--- a/examples/pm/wakeup_app.c
+++ b/examples/pm/wakeup_app.c
@@ -61,7 +61,7 @@ static int wakeup_app(void)
{
rt_thread_t tid;
- wakeup_event = rt_event_create("wakup", RT_IPC_FLAG_FIFO);
+ wakeup_event = rt_event_create("wakup", RT_IPC_FLAG_PRIO);
RT_ASSERT(wakeup_event != RT_NULL);
tid = rt_thread_create("wakeup_app", wakeup_app_entry, RT_NULL,
diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h
deleted file mode 100644
index c542e6855c..0000000000
--- a/include/libc/libc_fdset.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2017-10-30 Bernard The first version
- */
-
-#ifndef LIBC_FDSET_H__
-#define LIBC_FDSET_H__
-
-#include <rtconfig.h>
-
-#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
-#include <sys/types.h>
-#if defined(HAVE_SYS_SELECT_H)
-#include <sys/select.h>
-#endif
-
-#else
-
-#ifdef SAL_USING_POSIX
-
-#ifdef FD_SETSIZE
-#undef FD_SETSIZE
-#endif
-
-#define FD_SETSIZE DFS_FD_MAX
-#endif
-
-# ifndef FD_SETSIZE
-# define FD_SETSIZE 32
-# endif
-
-# define NBBY 8 /* number of bits in a byte */
-
-typedef long fd_mask;
-# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
-# ifndef howmany
-# define howmany(x,y) (((x)+((y)-1))/(y))
-# endif
-
-/* We use a macro for fd_set so that including Sockets.h afterwards
- can work. */
-typedef struct _types_fd_set {
- fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
-} _types_fd_set;
-
-#define fd_set _types_fd_set
-
-# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
-# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
-# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
-# define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
-
-#endif
-
-#endif
diff --git a/include/rtdef.h b/include/rtdef.h
index 394bbca5d2..62d0a53685 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -510,7 +510,7 @@ typedef struct rt_timer *rt_timer_t;
* @addtogroup Signal
*/
#ifdef RT_USING_SIGNALS
-#include <libc/libc_signal.h>
+#include <sys/signal.h>
typedef unsigned long rt_sigset_t;
typedef void (*rt_sighandler_t)(int signo);
typedef siginfo_t rt_siginfo_t;
diff --git a/include/rtlibc.h b/include/rtlibc.h
index ac44a97831..4b145b1b1b 100644
--- a/include/rtlibc.h
+++ b/include/rtlibc.h
@@ -13,11 +13,8 @@
/* definitions for libc if toolchain has no these definitions */
#include "libc/libc_stat.h"
-
#include "libc/libc_fcntl.h"
#include "libc/libc_dirent.h"
-#include "libc/libc_signal.h"
-#include "libc/libc_fdset.h"
#ifndef RT_USING_LIBC
#if defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__)