Commit Graph

47879 Commits

Author SHA1 Message Date
ligd a7dea8ddf6 rpmsg_socket: shouldn't call create_device again after create_ept
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-18 02:11:16 +08:00
ligd d6cad21a17 rpmsg_socket: rpmsg_send_nocpy() should lock with rpmsg_destroy_ept
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-18 02:11:16 +08:00
ligd c0735f06f6 rpmsg_socket: release tx buffer when send_oncopy failed
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-18 02:11:16 +08:00
anjiahao bc30b294aa mm:add heap args to mm_malloc_size
use malloc_size inside of where used mm_malloc_size

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-17 21:57:37 +08:00
chao an 3d7629a02c fs/mmap: fix compile warning if set the optimize level to O3
| $ gcc -c "-O3" -Wall -isystem include -D__NuttX__ -D__KERNEL__ -I fs -I sched fs/mmap/fs_mmap.c -o fs_mmap.o
| include/sys/mman.h: In function ‘mmap’:
| fs/mmap/fs_mmap.c:259:13: warning: ‘mapped’ may be used uninitialized in this function [-Wmaybe-uninitialized]
|   259 |   FAR void *mapped;
|       |             ^~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-17 21:56:37 +08:00
ligd c0aaaa94e1 assert: used %p to logout the pointer
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 09:46:40 -03:00
ligd 19f87e88b9 assert: fix build break.
misc/assert.c: In function 'show_tasks':
Error: misc/assert.c:411:10: error: format '%p' expects argument of type 'void *', but argument 3 has type 'uintptr_t' {aka 'long unsigned int'} [-Werror=format=]
  411 |   _alert("  ----   ---"
      |          ^~~~~~~~~~~~~~
......
  424 |          , up_get_intstackbase()
      |            ~~~~~~~~~~~~~~~~~~~~~
      |            |
      |            uintptr_t {aka long unsigned int}

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 09:46:40 -03:00
dongjiuzhu1 8101978765 arch/sim: fix compile break when using mallinfo_task with custom mm manager
/usr/bin/ld: nuttx.rel: in function `mallinfo_task':
nuttx/mm/umm_heap/umm_mallinfo.c:67: undefined reference to `mm_mallinfo_task'

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-17 16:48:30 +08:00
Xiang Xiao 154bb93c45 mm: Terminate the backtrace array with one NULL pointer
since one entry is enough to identify the end of back trace

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-17 16:48:30 +08:00
anjiahao 29404ef54e procmeminfo:support memdump can show specific task for tlsf
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-17 16:48:30 +08:00
dongjiuzhu1 c386a1a2d9 mm/mempool: support backtrace function for mempool
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-17 16:48:30 +08:00
anjiahao af3978c1fa adjust the contents of memdump and meminfo
memdump:just dump info
meminfo:statistics mem information

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-17 16:48:30 +08:00
YAMAMOTO Takashi 2e0de13813 Documentation: Restore some esp32-devkitc openocd doc
Restore some openocd information which I occassionally need.

This is a partial revert of:
```
commit 58a5e0744b
Author: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
Date:   Mon Jul 26 21:43:42 2021 +0200

    Documentation/esp32: Remove the rest of the OpenOCD text.
    This information there is outdated and some of its content should be in
    the board documentation and not the chip.

    Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
```
2023-01-17 16:48:01 +08:00
Xiang Xiao 0a95c7721b vfs/poll: Remove POLLFILE and POLLSOCK NuttX specific extension
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-17 14:02:59 +08:00
luojun1234 ff3733b5b5 Support fragmentation and reassembly
Signed-off-by: luojun1 <luojun1@xiaomi.com>
2023-01-17 14:01:37 +08:00
Xiang Xiao b1899ffbfd fs: Support O_NOFOLLOW flag
https://pubs.opengroup.org/onlinepubs/9699919799.2013edition/functions/open.html:
O_NOFOLLOW
If path names a symbolic link, fail and set errno to [ELOOP].

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-17 12:02:48 +08:00
luoyong1 a32124879d arch/arm/src/armv7-a/r: fix kconfig error of l2 cache latency
fix the error of the config name and set latency config param bool to int

Signed-off-by: luoyong1 <luoyong1@xiaomi.com>
2023-01-17 12:45:42 +09:00
Xuxingliang 9166eeddf6 fs/mmap: update mapped var before exit
Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
2023-01-17 11:12:26 +08:00
Xuxingliang dce315005a fs/mmap: rammap should return buffer start address
Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
2023-01-17 11:12:26 +08:00
ligd c821088734 pthread: fix pthread exit error when set DETACHED
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 11:09:36 +08:00
ligd 940de60892 assert: add stackbase dump
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 11:04:12 +08:00
ligd 4de9317373 assert: add uname info to assert message
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 11:04:12 +08:00
ligd 8bd0d441ae minidumpserver: replace stackdump to stack_dump
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 11:01:11 +08:00
ligd 5b22eba0bd rptun ping: fix warning when open CONFIG_SYSTEM_TIME64
rptun/rptun_ping.c: In function 'rptun_ping':
rptun/rptun_ping.c:171:20: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'time_t' {aka 'long long int'} [-Werror=format=]
  171 |   syslog(LOG_INFO, "avg: s %" PRIu32 ", ns %ld\n", ts.tv_sec, ts.tv_nsec);
      |                    ^~~~~~~~~~                      ~~~~~~~~~
      |                                                      |
      |

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 10:59:59 +08:00
ligd 354abd4e8e uinput: fix uinput compile failed, if no define CONFIG_UINPUT_TOUCH
input/uinput.c:81:28: error: field 'lower' has incomplete type
   81 |   struct touch_lowerhalf_s lower;
      |                            ^~~~~
CC:  pipes/pipe.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 10:55:52 +08:00
Gustavo Henrique Nihei a3e253b4a3 mm: Enable a dedicated kernel heap on BUILD_FLAT via MM_KERNEL_HEAP
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-01-17 10:30:00 +08:00
crafcat7 047f7f8d3a vfs/fs_truncate.c:Add socket judgment to return correct errno. 2023-01-17 10:29:41 +08:00
Xiang Xiao a70a9f5ae6 net: Move s_flags to last to avoid the padding added by compiler
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 23:29:26 -03:00
Xiang Xiao 62c5afe655 Fix warning in file included from chip/sam_clockconfig.c:34:
chip/sam_clockconfig.c: In function 'sam_usbclockconfig':
Error: /github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:51: error: 'regval' is used uninitialized [-Werror=uninitialized]
  135 | #define putreg32(v,a)  (*(volatile uint32_t *)(a) = (v))
      |                                                   ^
chip/sam_clockconfig.c:422:12: note: 'regval' was declared here
  422 |   uint32_t regval;
      |            ^~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 18:59:44 -03:00
crafcat7 2ec117b3ca fs/fs_fsync:Fix the expected error of socket,fifo and pipe returning error in fsync case 2023-01-17 01:56:40 +08:00
ligd 23d1d4c42a power: avoid sem_wait called in IRQ handler
error backrace:
_assert  --- assert again
sem_wait
pm_unregister
wdog_notifier
panic_notifier_call_chain
_assert
dataabort

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:25:27 +08:00
ligd 38c6f20d17 pm: add pm_domain_lock/unlock support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:25:27 +08:00
ligd d2ef505684 pm: add lock for pm_auto_updatestate_cb()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:25:27 +08:00
anjiahao 43d2c595b1 crypto:support crypto can handle streaming data
in user space
Use the flag (COP_FLAG_UPDATE)structure member to mark
whether it is just input data.
like this:
can do manys times,just input data
....

  cryp.ses = session.ses;
  cryp.op = COP_ENCRYPT;
  cryp.src = (caddr_t) s;
  cryp.len = len;
  cryp.flags = COP_FLAG_UPDATE;
  cryp.dst = 0;
  cryp.mac = (caddr_t) out;
  cryp.iv = 0;
  if (ioctl(cryptodev_fd, CIOCCRYPT, &cryp) == -1)
    {
      warn("CIOCCRYPT");
      goto err;
    }

can do manys times like frist...

then,the last time

Don't use any flay structure member to mark
this is last time,need get final result
....
  cryp.ses = session.ses;
  cryp.op = COP_ENCRYPT;
  cryp.src = (caddr_t) s;
  cryp.len = len;
  cryp.flags = 0;
  cryp.dst = 0;
  cryp.mac = (caddr_t) out;
  cryp.iv = 0;
  if (ioctl(cryptodev_fd, CIOCCRYPT, &cryp) == -1)
    {
      warn("CIOCCRYPT");
      goto err;
    }
....
that will get last result.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-17 01:19:38 +08:00
ligd fedad91b0d sim/mem: don't let siwtch out when operated the host mem
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:18:03 +08:00
ligd c08cc01c9d sim/oneshot: don't need sleep_until when open CONFIG_SIM_WALLTIME_SIGNAL
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:18:03 +08:00
Xiang Xiao f64da13e9b libxx: Add CXX_STANDARD to select -std=c++??
and default to "c++17"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 15:41:57 +02:00
TimJTi 6b4da4ad6e Ensure SFR CKTRIM register correctly set, SAMA5D2/D3 only 2023-01-16 21:40:00 +08:00
Dong Heng 118222ba46 xtensa/esp32: Partition device supports encryption mode 2023-01-16 09:55:44 -03:00
anjiahao cb404167a7 mm/tlsf:add mempool to optimize small block perfomance
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-16 20:32:17 +08:00
anjiahao bdcb1f6a25 fix:mmsize_t need support 64bit
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-16 20:32:17 +08:00
dongjiuzhu1 c82f44c4f3 mm/mm_heap: add mempool to optimize small block performance
There are many small memory block in NuttX system, eg: struct tcb_s,
struct inode, etc, and several disadvantages about them:
1.Their frequent allocate and free cause the system memory fragmentation.
2.Since each memory block has an overhead, the utilization of small memory
blocks is relatively low, which will cause memory waste.

So we can use mempool to alloc smallo block, to improve alloc speed
and utilization, to reduce fragmentation.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-16 20:32:17 +08:00
dongjiuzhu1 7cd325f3be mm/mm_heap: remove kasan in MM_ADD_BACKTRACE
do simple copy to instead of memset and memcpy operation because
they have been instrumented, if you access the posion area,
the system will crash.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-16 20:32:17 +08:00
chao an 415a09115d boards/sim/windows: enable custom options
1. boards/sim: enable child status
2. boards/sim/windows: enable custom options
3. sim/windows: enable hostfs

Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-16 20:30:39 +08:00
anjiahao 86609246e3 crypto:add read & write function aviod check flag failed
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-16 19:26:19 +08:00
zhangyuan21 806a2a8b8d arch/armv7-ar: flush dcache when addr is not aligned with cache line
When invalidate address is not aligned with cache line,
must align address and flush the cache line.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-16 16:14:32 +08:00
zhangyuan21 4bb155db64 arch/arm: add barrier instruction for cache ops
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-16 16:14:32 +08:00
Xiang Xiao f783f5c384 arch/arm: Fix typo error in cp15_cacheops.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 16:14:32 +08:00
Xiang Xiao 1ea9db4ebe Fix error: implicit declaration of function 'cp15_invalidate_icache'; did you mean 'cp15_invalidate_dcache'?
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 16:14:32 +08:00
chenrun1 c61195bcc9 arch/armv7-a & armv7-r:Add invalidate icache behavior
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-01-16 16:14:32 +08:00