Compare commits

...

10 commits

Author SHA1 Message Date
Xiang Xiao
6483c53aba
Merge 9750fa6154 into 43797ea6cc 2025-01-12 11:26:31 +08:00
Xiang Xiao
9750fa6154 libc: Add LIBC_ prefix to MEMCPY_VIK and MEMSET_OPTSPEED
align with other option naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-12 11:26:17 +08:00
yaojiaqi
43797ea6cc drivers/timers/watchdog: add watchdog timer notifier chain
Add support for watchdog timer notifer chain so that users
can customize the callback function when the watchdog timer
times out which enabled by Auto-monitor

Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
2025-01-12 11:15:42 +08:00
wangmingrong1
aa0aecbd80 mempool: addbacktrace should be before kasan_unpoison
If thread 1 is executing kasan_unpoison but a scheduling occurs and the block is trampled upon, the displayed backtracking may still be from the previously allocated backtracking

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-12 01:29:14 +08:00
rongyichang
39780fdae1 drivers/vhost-rng: fix compile error in vhost-rng.
vhost/vhost-rng.c:154:9: error: too few arguments to function 'virtio_create_virtqueues'
  154 |   ret = vhost_create_virtqueues(hdev, 0, 1, vqnames, callback);

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-12 00:06:12 +08:00
rongyichang
ee2f3df2ff drivers/vhost: fix compile error while get vhost status.
vhost/vhost.c: In function 'vhost_status_driver_ok':
vhost/vhost.c:86:20: error: too few arguments to function 'virtio_get_status'
   86 |   uint8_t status = vhost_get_status(hdev);

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-12 00:06:12 +08:00
Yanfeng Liu
ff488133c9 qemu-armv7a: allows ELF_EXECUTABLE
This allows using BINFMT_ELF_EXECUTABLE for qemu-armv7a target.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
Yanfeng Liu
48846954d8 arm/Toolchain.defs: skip -r for ELF_EXECUTABLE
This avoids using `-r` option when linking executable programs.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
Yanfeng Liu
657247bda8 libc/modlib: preprocess gnu-elf.ld
This generates gnu-elf.ld via preprocessing of gnu-elf.ld.in so
that to reduce board specific app linker scripts in kernel mode
when BINFMT_ELF_EXECUTABLE is enabled.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
Yanfeng Liu
be40c01ddd nuttx/addrenv.h: revise assembly guard
This allows the header file to be useful from non-C sources such as
assembly code or linker scripts.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
66 changed files with 347 additions and 142 deletions

View file

@ -546,7 +546,9 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
LDELFFLAGS += -r
ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
LDELFFLAGS += -r
endif
endif
LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)

View file

@ -15,6 +15,7 @@ config ARCH_CHIP_QEMU_CORTEXA7
bool "Qemu virtual Processor (cortex-a7)"
select ARCH_CORTEXA7
select ARCH_HAVE_ADDRENV
select ARCH_HAVE_ELF_EXECUTABLE
select ARCH_HAVE_LOWVECTORS
select ARCH_HAVE_MULTICPU
select ARCH_NEED_ADDRENV_MAPPING

View file

@ -66,9 +66,6 @@ CONFIG_IOB_NBUFFERS=128
CONFIG_IOB_THROTTLE=24
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y

View file

@ -68,9 +68,6 @@ CONFIG_IOB_NBUFFERS=128
CONFIG_IOB_THROTTLE=24
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y

View file

@ -66,9 +66,6 @@ CONFIG_IOB_NBUFFERS=128
CONFIG_IOB_THROTTLE=24
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y

View file

@ -80,9 +80,6 @@ CONFIG_LCD_ILI9340=y
CONFIG_LCD_ILI9340_IFACE0=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_IOB=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD_BYTE_WRITE=y

View file

@ -83,9 +83,6 @@ CONFIG_LCD_ILI9340=y
CONFIG_LCD_ILI9340_IFACE0=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_IOB=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD_BYTE_WRITE=y

View file

@ -64,8 +64,8 @@ CONFIG_LCD=y
CONFIG_LCD_ST7565=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD=y
CONFIG_NAME_MAX=255

View file

@ -67,9 +67,9 @@ CONFIG_LCD=y
CONFIG_LCD_ST7565=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD=y
CONFIG_NAME_MAX=255

View file

@ -35,8 +35,8 @@ CONFIG_LC823450_UART0=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_NAME_MAX=255
CONFIG_NETUTILS_CODECS=y
CONFIG_PATH_INITIAL="/mnt/romfs"

View file

@ -34,8 +34,8 @@ CONFIG_LC823450_SDIF_SDC=y
CONFIG_LC823450_UART0=y
CONFIG_LC823450_UART1=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MTD=y
CONFIG_NAME_MAX=255
CONFIG_NETUTILS_CODECS=y

View file

@ -47,8 +47,8 @@ CONFIG_LCD=y
CONFIG_LCD_ST7565=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NAME_MAX=255
CONFIG_NETUTILS_CODECS=y

View file

@ -77,8 +77,8 @@ CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD=y
CONFIG_NAME_MAX=255

View file

@ -52,8 +52,8 @@ CONFIG_LCD=y
CONFIG_LCD_ST7565=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NAME_MAX=255
CONFIG_NETUTILS_CODECS=y

View file

@ -34,8 +34,8 @@ CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_NAME_MAX=255
CONFIG_NETUTILS_CODECS=y
CONFIG_PATH_INITIAL="/mnt/romfs"

View file

@ -74,8 +74,8 @@ CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD=y
CONFIG_NAME_MAX=255

View file

@ -59,8 +59,8 @@ CONFIG_LCD=y
CONFIG_LCD_ST7565=y
CONFIG_LIBC_KBDCODEC=y
CONFIG_LIBC_MAX_EXITFUNS=32
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MODLIB_BUFFERSIZE=512
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_MTD=y

View file

@ -70,11 +70,11 @@ CONFIG_IOB_NCHAINS=32
CONFIG_IOB_THROTTLE=10
CONFIG_LIBC_LOCALTIME=y
CONFIG_LIBC_MAX_EXITFUNS=1
CONFIG_LIBC_MEMCPY_VIK=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_REGIONS=2
CONFIG_MQ_MAXMSGSIZE=224
CONFIG_MTD=y

View file

@ -71,10 +71,10 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -57,10 +57,10 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -58,10 +58,10 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -61,10 +61,10 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -61,10 +61,10 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -58,11 +58,11 @@ CONFIG_INIT_MOUNT_TARGET="/system/bin"
CONFIG_INIT_STACKSIZE=3072
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -65,11 +65,11 @@ CONFIG_K230_RPTUN_MASTER=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_HOSTNAME="master"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -59,11 +59,11 @@ CONFIG_INIT_MOUNT_TARGET="/system/bin"
CONFIG_INIT_STACKSIZE=3072
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -53,11 +53,11 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_HOSTNAME="remote"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -35,10 +35,10 @@ CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MPFS_COREPWM0=y

View file

@ -63,11 +63,11 @@ CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_LOCALE=y
CONFIG_LIBC_MAX_EXITFUNS=16
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_KMAP=y
CONFIG_MM_PGALLOC=y
CONFIG_MM_SHM=y

View file

@ -36,10 +36,10 @@ CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MPFS_ENABLE_DPFPU=y
CONFIG_MPFS_ETHMAC_1=y
CONFIG_MPFS_PHYADDR=9

View file

@ -32,10 +32,10 @@ CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MPFS_ENABLE_DPFPU=y
CONFIG_MPFS_UART1=y
CONFIG_NSH_ARCHINIT=y

View file

@ -35,8 +35,6 @@ CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MPFS_BOOTLOADER=y

View file

@ -36,10 +36,10 @@ CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MPFS_ENABLE_DPFPU=y
CONFIG_MPFS_UART1=y
CONFIG_NSH_ARCHINIT=y

View file

@ -41,10 +41,10 @@ CONFIG_INTELHEX_BINARY=y
CONFIG_IOB_NBUFFERS=24
CONFIG_IOB_NCHAINS=24
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_IOB=y
CONFIG_MPFS_IHC_CLIENT=y
CONFIG_MPFS_IHC_LINUX_ON_HART4=0

View file

@ -41,10 +41,10 @@ CONFIG_INTELHEX_BINARY=y
CONFIG_IOB_NBUFFERS=24
CONFIG_IOB_NCHAINS=24
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_IOB=y
CONFIG_MPFS_IHC_CLIENT=y
CONFIG_MPFS_IHC_LINUX_ON_HART3=0

View file

@ -39,8 +39,6 @@ CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MPFS_BOOTLOADER=y

View file

@ -52,10 +52,10 @@ CONFIG_INTELHEX_BINARY=y
CONFIG_IOB_NBUFFERS=24
CONFIG_IOB_NCHAINS=24
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MM_IOB=y

View file

@ -31,10 +31,10 @@ CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_HOSTNAME="icicle"
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MPFS_ENABLE_DPFPU=y
CONFIG_MPFS_UART1=y
CONFIG_NSH_ARCHINIT=y

View file

@ -75,11 +75,11 @@ CONFIG_INIT_MOUNT_TARGET="/system"
CONFIG_INIT_STACKSIZE=3072
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -79,11 +79,11 @@ CONFIG_IOB_BUFSIZE=1534
CONFIG_IOB_THROTTLE=2
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y

View file

@ -80,13 +80,13 @@ CONFIG_IOB_NBUFFERS=64
CONFIG_IOB_THROTTLE=8
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMCPY_64BIT=y
CONFIG_LIBC_MEMCPY_VIK=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMCPY_64BIT=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y

View file

@ -64,11 +64,11 @@ CONFIG_INIT_MOUNT_TARGET="/system"
CONFIG_INIT_STACKSIZE=3072
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -64,11 +64,11 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -59,11 +59,11 @@ CONFIG_IOB_NBUFFERS=64
CONFIG_IOB_THROTTLE=8
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMCPY_VIK=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSCLIENT_ENTRIES=4

View file

@ -59,11 +59,11 @@ CONFIG_IOB_NBUFFERS=64
CONFIG_IOB_THROTTLE=8
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMCPY_VIK=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMCPY_VIK=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSCLIENT_ENTRIES=4

View file

@ -61,10 +61,10 @@ CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_PGALLOC=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y

View file

@ -36,7 +36,7 @@ CONFIG_INIT_MOUNT_TARGET="/system"
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_MAX_EXITFUNS=1
CONFIG_MEMSET_OPTSPEED=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILE_APPS=y

View file

@ -49,9 +49,9 @@ CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=8192
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MODLIB_ALIGN_LOG2=3
CONFIG_MODLIB_BUFFERSIZE=64
CONFIG_NSH_ARCHINIT=y

View file

@ -39,9 +39,9 @@ CONFIG_IDLETHREAD_STACKSIZE=4096
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=16384
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MODLIB_ALIGN_LOG2=3
CONFIG_MODLIB_BUFFERSIZE=64
CONFIG_NSH_ARCHINIT=y

View file

@ -40,9 +40,9 @@ CONFIG_IDLETHREAD_STACKSIZE=4096
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=16384
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_MEMSET_64BIT=y
CONFIG_LIBC_MEMSET_OPTSPEED=y
CONFIG_LIBM=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MODLIB_ALIGN_LOG2=3
CONFIG_MODLIB_BUFFERSIZE=64
CONFIG_NSH_ARCHINIT=y

View file

@ -439,6 +439,14 @@ menuconfig WATCHDOG_AUTOMONITOR
if WATCHDOG_AUTOMONITOR
config WATCHDOG_TIMEOUT_NOTIFIER
bool "Enable watchdog timeout notifier"
default n
---help---
The watchdog timeout notifier chain mechanism supports users registering
custom callback functions, which will be called when the watchdog timer
managed by Auto-monitor times out.
choice
prompt "Auto-monitor keepalive by"
default WATCHDOG_AUTOMONITOR_BY_WDOG

View file

@ -71,6 +71,20 @@
# endif
#endif
#if defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_ONESHOT)
# define WATCHDOG_NOTIFIER_ACTION WATCHDOG_KEEPALIVE_BY_ONESHOT
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_TIMER)
# define WATCHDOG_NOTIFIER_ACTION WATCHDOG_KEEPALIVE_BY_TIMER
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_WDOG)
# define WATCHDOG_NOTIFIER_ACTION WATCHDOG_KEEPALIVE_BY_WDOG
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_WORKER)
# define WATCHDOG_NOTIFIER_ACTION WATCHDOG_KEEPALIVE_BY_WORKER
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_CAPTURE)
# define WATCHDOG_NOTIFIER_ACTION WATCHDOG_KEEPALIVE_BY_CAPTURE
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_IDLE)
# define WATCHDOG_NOTIFIER_ACTION WATCHDOG_KEEPALIVE_BY_IDLE
#endif
/****************************************************************************
* Private Type Definitions
****************************************************************************/
@ -135,6 +149,10 @@ static const struct file_operations g_wdogops =
wdog_ioctl, /* ioctl */
};
#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
static ATOMIC_NOTIFIER_HEAD(g_watchdog_notifier_list);
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -699,6 +717,55 @@ static int wdog_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* Public Functions
****************************************************************************/
#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
/****************************************************************************
* Name: watchdog_notifier_chain_register
*
* Description:
* Add notifier to the watchdog notifier chain
*
* Input Parameters:
* nb - New entry in notifier chain
*
****************************************************************************/
void watchdog_notifier_chain_register(FAR struct notifier_block *nb)
{
atomic_notifier_chain_register(&g_watchdog_notifier_list, nb);
}
/****************************************************************************
* Name: watchdog_notifier_chain_unregister
*
* Description:
* Remove notifier from the watchdog notifier chain
*
* Input Parameters:
* nb - Entry to remove from notifier chain
*
****************************************************************************/
void watchdog_notifier_chain_unregister(FAR struct notifier_block *nb)
{
atomic_notifier_chain_unregister(&g_watchdog_notifier_list, nb);
}
/****************************************************************************
* Name: watchdog_automonitor_timeout
*
* Description:
* This function can be called in the watchdog timeout interrupt handler.
* If so, callbacks on the watchdog timer notify chain are called when the
* watchdog timer times out.
*
****************************************************************************/
void watchdog_automonitor_timeout(void)
{
atomic_notifier_call_chain(&g_watchdog_notifier_list, action, data);
}
#endif /* CONFIG_WATCHDOG_TIMEOUT_NOTIFIER */
/****************************************************************************
* Name: watchdog_register
*

View file

@ -30,6 +30,7 @@
#include <stdlib.h>
#include <nuttx/kmalloc.h>
#include <nuttx/spinlock.h>
#include <nuttx/vhost/vhost.h>
#include <nuttx/wqueue.h>
@ -151,7 +152,7 @@ static int vhost_rng_probe(FAR struct vhost_device *hdev)
vqnames[0] = "virtio_rng";
callback[0] = vhost_rng_handler;
ret = vhost_create_virtqueues(hdev, 0, 1, vqnames, callback);
ret = vhost_create_virtqueues(hdev, 0, 1, vqnames, callback, NULL);
if (ret < 0)
{
vhosterr("virtio_device_create_virtqueue failed, ret=%d\n", ret);

View file

@ -83,8 +83,15 @@ static struct vhost_bus_s g_vhost_bus =
static bool vhost_status_driver_ok(FAR struct vhost_device *hdev)
{
uint8_t status = vhost_get_status(hdev);
bool driver_ok = false;
uint8_t status;
int ret;
ret = vhost_get_status(hdev, &status);
if (ret)
{
return driver_ok;
}
/* Busy wait until the remote is ready */

View file

@ -29,6 +29,8 @@
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
#ifdef CONFIG_BUILD_KERNEL
# include <signal.h>
#endif
@ -40,6 +42,8 @@
#include <arch/arch.h>
#endif /* __ASSEMBLY__ */
#ifdef CONFIG_ARCH_ADDRENV
/****************************************************************************
@ -241,6 +245,9 @@
(CONFIG_ARCH_PGPOOL_VBASE + CONFIG_ARCH_PGPOOL_SIZE)
#endif
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Type Definitions
****************************************************************************/
@ -251,8 +258,6 @@ struct tcb_s; /* Forward reference to TCB */
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
struct addrenv_s
{
struct arch_addrenv_s addrenv; /* The address environment page directory */

View file

@ -31,6 +31,7 @@
#include <nuttx/compiler.h>
#include <nuttx/irq.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/notifier.h>
#ifdef CONFIG_WATCHDOG
@ -88,6 +89,35 @@
#define WDFLAGS_CAPTURE (1 << 2) /* 1=Call the user function when the
* watchdog timer expires */
/* Keepalive Actions ********************************************************/
/* According to the keepalive action specified by the Auto-monitor, callback
* functions registered on the watchdog notifier chain may take corresponding
* actions.
*
* These are detected and handled by the "upper half" watchdog timer driver.
*
* WATCHDOG_KEEPALIVE_BY_ONESHOT - The watchdog timer is keepalive by
* oneshot timer.
* WATCHDOG_KEEPALIVE_BY_TIMER - The watchdog timer is keepalive by
* timer.
* WATCHDOG_KEEPALIVE_BY_WDOG - The watchdog timer is keepalive by
* wdog.
* WATCHDOG_KEEPALIVE_BY_WORKER - The watchdog timer is keepalive by
* worker queue.
* WATCHDOG_KEEPALIVE_BY_CAPTURE - The watchdog timer is keepalive by
* capture.
* WATCHDOG_KEEPALIVE_BY_IDLE - The watchdog timer is keepalive by
* idle task.
*/
#define WATCHDOG_KEEPALIVE_BY_ONESHOT 0
#define WATCHDOG_KEEPALIVE_BY_TIMER 1
#define WATCHDOG_KEEPALIVE_BY_WDOG 2
#define WATCHDOG_KEEPALIVE_BY_WORKER 3
#define WATCHDOG_KEEPALIVE_BY_CAPTURE 4
#define WATCHDOG_KEEPALIVE_BY_IDLE 5
/****************************************************************************
* Public Types
****************************************************************************/
@ -197,6 +227,47 @@ extern "C"
#define EXTERN extern
#endif
#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
/****************************************************************************
* Name: watchdog_notifier_chain_register
*
* Description:
* Add notifier to the watchdog notifier chain
*
* Input Parameters:
* nb - New entry in notifier chain
*
****************************************************************************/
void watchdog_notifier_chain_register(FAR struct notifier_block *nb);
/****************************************************************************
* Name: watchdog_notifier_chain_unregister
*
* Description:
* Remove notifier from the watchdog notifier chain
*
* Input Parameters:
* nb - Entry to remove from notifier chain
*
****************************************************************************/
void watchdog_notifier_chain_unregister(FAR struct notifier_block *nb);
/****************************************************************************
* Name: watchdog_automonitor_timeout
*
* Description:
* This function can be called in the watchdog timeout interrupt handler.
* If so, callbacks on the watchdog timer notify chain are called when the
* watchdog timer times out.
*
****************************************************************************/
void watchdog_automonitor_timeout(void);
#endif /* CONFIG_WATCHDOG_TIMEOUT_NOTIFIER */
/****************************************************************************
* Name: watchdog_register
*

View file

@ -1,2 +1,3 @@
/exec_symtab.c
/modlib_symtab.c
modlib/gnu-elf.ld

View file

@ -183,6 +183,10 @@ context:: bin kbin
ifeq ($(CONFIG_LIBC_ZONEINFO_ROMFS),y)
$(Q) $(MAKE) -C zoneinfo context BIN=$(BIN)
endif
ifeq ($(CONFIG_LIBC_MODLIB),y)
$(Q) $(MAKE) -C modlib context
endif
# Dependencies
@ -210,6 +214,7 @@ depend:: .depend
clean::
$(Q) $(MAKE) -C zoneinfo clean BIN=$(BIN)
$(Q) $(MAKE) -C modlib clean
$(call DELFILE, $(BIN))
$(call DELFILE, $(KBIN))
$(call CLEAN)
@ -218,6 +223,7 @@ clean::
distclean:: clean
$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
$(Q) $(MAKE) -C modlib distclean
$(call DELFILE, exec_symtab.c)
$(call DELFILE, .depend)
$(call DELDIR, bin)

40
libs/libc/modlib/Makefile Normal file
View file

@ -0,0 +1,40 @@
############################################################################
# libs/libc/modlib/Makefile
#
# 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.
#
############################################################################
include $(TOPDIR)/Make.defs
# Generate gnu-elf.ld from gnu-elf.ld.in
gnu-elf.ld: gnu-elf.ld.in
$(call PREPROCESS, $<, $@)
# Create initial context
context: gnu-elf.ld
.PHONY: context clean distclean
clean:
$(call CLEAN)
distclean: clean
$(call DELFILE, gnu-elf.ld)

View file

@ -1,5 +1,5 @@
/****************************************************************************
* libs/libc/modlib/gnu-elf.ld
* libs/libc/modlib/gnu-elf.ld.in
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -18,9 +18,23 @@
*
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_BINFMT_ELF_EXECUTABLE)
# define __ASSEMBLY__
# include <nuttx/addrenv.h>
# define TEXT CONFIG_ARCH_TEXT_VBASE
# define DATA CONFIG_ARCH_DATA_VBASE + ARCH_DATA_RESERVE_SIZE
#else
# define TEXT 0x0
# define DATA
#endif
SECTIONS
{
.text 0x00000000 :
.text TEXT :
{
_stext = . ;
*(.text)
@ -58,7 +72,7 @@ SECTIONS
_erodata = . ;
}
.data :
.data DATA :
{
_sdata = . ;
*(.data)

View file

@ -64,7 +64,7 @@ set(SRCS
lib_strlcpy.c
lib_strnlen.c)
if(CONFIG_MEMCPY_VIK)
if(CONFIG_LIBC_MEMCPY_VIK)
list(APPEND SRCS lib_vikmemcpy.c)
elseif(CONFIG_LIBC_NEWLIB_OPTSPEED)
list(APPEND SRCS lib_bsdmemcpy.c)

View file

@ -55,7 +55,7 @@ config LIBC_NEWLIB_OPTSPEED
---help---
Use optimized string function implementation based on newlib.
config MEMCPY_VIK
config LIBC_MEMCPY_VIK
bool "Vik memcpy()"
default n
depends on !LIBC_NEWLIB_OPTSPEED && !LIBC_ARCH_MEMCPY
@ -64,31 +64,31 @@ config MEMCPY_VIK
Select this option for improved performance at the expense of increased
size. See licensing information in the top-level LICENSE file.
if MEMCPY_VIK
if LIBC_MEMCPY_VIK
config MEMCPY_PRE_INC_PTRS
config LIBC_MEMCPY_PRE_INC_PTRS
bool "Pre-increment pointers"
default n
---help---
Use pre-increment of pointers. Default is post increment of pointers.
config MEMCPY_INDEXED_COPY
config LIBC_MEMCPY_INDEXED_COPY
bool "Array indexing"
default y
---help---
Copying data using array indexing. Using this option, disables the
MEMCPY_PRE_INC_PTRS option.
LIBC_MEMCPY_PRE_INC_PTRS option.
config MEMCPY_64BIT
config LIBC_MEMCPY_64BIT
bool "64-bit memcpy()"
default n
---help---
Compiles memcpy() for architectures that support 64-bit operations
efficiently.
endif # MEMCPY_VIK
endif # LIBC_MEMCPY_VIK
config MEMSET_OPTSPEED
config LIBC_MEMSET_OPTSPEED
bool "Optimize memset() for speed"
default n
depends on !LIBC_NEWLIB_OPTSPEED && !LIBC_ARCH_MEMSET
@ -96,10 +96,10 @@ config MEMSET_OPTSPEED
Select this option to use a version of memcpy() optimized for speed.
Default: memcpy() is optimized for size.
config MEMSET_64BIT
config LIBC_MEMSET_64BIT
bool "64-bit memset()"
default n
depends on MEMSET_OPTSPEED
depends on LIBC_MEMSET_OPTSPEED
---help---
Compiles memset() for architectures that support 64-bit operations
efficiently.

View file

@ -38,7 +38,7 @@ CSRCS += lib_memmove.c lib_memset.c
CSRCS += lib_strlcat.c
CSRCS += lib_strlcpy.c lib_strnlen.c
ifeq ($(CONFIG_MEMCPY_VIK),y)
ifeq ($(CONFIG_LIBC_MEMCPY_VIK),y)
CSRCS += lib_vikmemcpy.c
else ifeq ($(CONFIG_LIBC_NEWLIB_OPTSPEED),y)
CSRCS += lib_bsdmemcpy.c

View file

@ -38,12 +38,12 @@
* Pre-processor Definitions
****************************************************************************/
/* Can't support CONFIG_MEMSET_64BIT if the platform does not have 64-bit
* integer types.
/* Can't support CONFIG_LIBC_MEMSET_64BIT if the platform does not
* have 64-bit integer types.
*/
#ifndef CONFIG_HAVE_LONG_LONG
# undef CONFIG_MEMSET_64BIT
# undef CONFIG_LIBC_MEMSET_64BIT
#endif
/****************************************************************************
@ -55,7 +55,7 @@
no_builtin("memset")
FAR void *memset(FAR void *s, int c, size_t n)
{
#ifdef CONFIG_MEMSET_OPTSPEED
#ifdef CONFIG_LIBC_MEMSET_OPTSPEED
/* This version is optimized for speed (you could do better
* still by exploiting processor caching or memory burst
* knowledge.)
@ -64,7 +64,7 @@ FAR void *memset(FAR void *s, int c, size_t n)
uintptr_t addr = (uintptr_t)s;
uint16_t val16 = ((uint16_t)c << 8) | (uint16_t)c;
uint32_t val32 = ((uint32_t)val16 << 16) | (uint32_t)val16;
#ifdef CONFIG_MEMSET_64BIT
#ifdef CONFIG_LIBC_MEMSET_64BIT
uint64_t val64 = ((uint64_t)val32 << 32) | (uint64_t)val32;
#endif
@ -96,7 +96,7 @@ FAR void *memset(FAR void *s, int c, size_t n)
n -= 2;
}
#ifndef CONFIG_MEMSET_64BIT
#ifndef CONFIG_LIBC_MEMSET_64BIT
/* Loop while there are at least 16-bytes left to be written */
while (n >= 16)
@ -161,7 +161,7 @@ FAR void *memset(FAR void *s, int c, size_t n)
#endif
}
#ifdef CONFIG_MEMSET_64BIT
#ifdef CONFIG_LIBC_MEMSET_64BIT
/* We may get here with n in the range 0..7. If n >= 4, then we should
* have 64-bit alignment.
*/

View file

@ -45,25 +45,25 @@
* Pre-processor Definitions
****************************************************************************/
/* Can't support CONFIG_MEMCPY_64BIT if the platform does not have 64-bit
* integer types.
/* Can't support CONFIG_LIBC_MEMCPY_64BIT if the platform does not have
* 64-bit integer types.
*/
#ifndef CONFIG_HAVE_LONG_LONG
# undef CONFIG_MEMCPY_64BIT
# undef CONFIG_LIBC_MEMCPY_64BIT
#endif
/* Remove definitions when CONFIG_MEMCPY_INDEXED_COPY is defined */
/* Remove definitions when CONFIG_LIBC_MEMCPY_INDEXED_COPY is defined */
#if defined (CONFIG_MEMCPY_INDEXED_COPY)
# if defined (CONFIG_MEMCPY_PRE_INC_PTRS)
# undef CONFIG_MEMCPY_PRE_INC_PTRS
# endif /* CONFIG_MEMCPY_PRE_INC_PTRS */
#endif /* CONFIG_MEMCPY_INDEXED_COPY */
#ifdef CONFIG_LIBC_MEMCPY_INDEXED_COPY
# ifdef CONFIG_LIBC_MEMCPY_PRE_INC_PTRS
# undef CONFIG_LIBC_MEMCPY_PRE_INC_PTRS
# endif /* CONFIG_LIBC_MEMCPY_PRE_INC_PTRS */
#endif /* CONFIG_LIBC_MEMCPY_INDEXED_COPY */
/* Definitions for pre and post increment of pointers */
#if defined (CONFIG_MEMCPY_PRE_INC_PTRS)
#ifdef CONFIG_LIBC_MEMCPY_PRE_INC_PTRS
# define START_VAL(x) (x)--
# define INC_VAL(x) *++(x)
@ -72,7 +72,7 @@
# define PRE_LOOP_ADJUST - (TYPE_WIDTH - 1)
# define PRE_SWITCH_ADJUST + 1
#else /* CONFIG_MEMCPY_PRE_INC_PTRS */
#else /* CONFIG_LIBC_MEMCPY_PRE_INC_PTRS */
# define START_VAL(x)
# define INC_VAL(x) *(x)++
@ -81,7 +81,7 @@
# define PRE_LOOP_ADJUST
# define PRE_SWITCH_ADJUST
#endif /* CONFIG_MEMCPY_PRE_INC_PTRS */
#endif /* CONFIG_LIBC_MEMCPY_PRE_INC_PTRS */
/* Definitions for endian-ness */
@ -139,21 +139,21 @@
* configuration.
****************************************************************************/
#if defined (CONFIG_MEMCPY_INDEXED_COPY)
#ifdef CONFIG_LIBC_MEMCPY_INDEXED_COPY
# define CP(idx) CP_INDEX(idx)
# define CP_SH(idx, shl, shr) CP_INDEX_SH(idx, shl, shr)
# define INC_INDEX(p, o) ((p) += (o))
#else /* CONFIG_MEMCPY_INDEXED_COPY */
#else /* CONFIG_LIBC_MEMCPY_INDEXED_COPY */
# define CP(idx) CP_INCR()
# define CP_SH(idx, shl, shr) CP_INCR_SH(shl, shr)
# define INC_INDEX(p, o)
#endif /* CONFIG_MEMCPY_INDEXED_COPY */
#endif /* CONFIG_LIBC_MEMCPY_INDEXED_COPY */
#define COPY_REMAINING(count) \
{ \
@ -256,7 +256,7 @@
* Type Definitions
****************************************************************************/
#ifdef CONFIG_MEMCPY_64BIT
#ifdef CONFIG_LIBC_MEMCPY_64BIT
typedef uint64_t uintn;
# define TYPE_WIDTH 8L
#else

View file

@ -397,16 +397,17 @@ retry:
pool->nalloc++;
spin_unlock_irqrestore(&pool->lock, flags);
blk = kasan_unpoison(blk, pool->blocksize);
#ifdef CONFIG_MM_FILL_ALLOCATIONS
memset(blk, MM_ALLOC_MAGIC, pool->blocksize);
#endif
#if CONFIG_MM_BACKTRACE >= 0
mempool_add_backtrace(pool, (FAR struct mempool_backtrace_s *)
((FAR char *)blk + pool->blocksize));
#endif
blk = kasan_unpoison(blk, pool->blocksize);
#ifdef CONFIG_MM_FILL_ALLOCATIONS
memset(blk, MM_ALLOC_MAGIC, pool->blocksize);
#endif
return blk;
}