Commit graph

17697 commits

Author SHA1 Message Date
Xiang Xiao
0961be771a mm: Simplify the semaphore handling
1.Move all special process to mm_takesemaphore
2.Remove the support of recurive lock
3.Remove mm_trysemaphore function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie216a6294ab67c5d427f31b089beb15c532f08fe
2021-07-10 05:02:33 -07:00
Xiang Xiao
38dd53c6ba arch/armv7-a: Remove the special SMP SGI process
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaf7fe77a3ab7cbf145d907dafb0b7ca54cc4a012
2021-07-09 11:34:39 +08:00
Jiuzhu Dong
1ecbc99b21 sim/smp: fix smp can't start, caused by signal too busy
N/A

Change-Id: Ia9cad04759a869f9bed871fa0acd002115eefb0a
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-08 15:16:35 +08:00
Xiang Xiao
0fe1c85ba4 mm: Remove mm_heap_impl_s struct
it's more simple to make mm_heap_s opaque outside of mm

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5c8e435f6baba6d22b10c5f7e8d9191104fb5af2
2021-07-07 02:14:53 -07:00
ligd
560a86ff57 sim: fix loop add delaylist when mm_free in IDLE thread
Change-Id: I1827c663275f47c9dc30d63e17e3d016b0000166
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-06 11:16:05 +08:00
Xiang Xiao
9ad74b2c3a arch/sim: Fixup_heap.c:154:3: error: 'heap_impl' undeclared
and up_heap.c:58:33: error: field 'mm_procfs' has incomplete type

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I4e871e397758c5b0a54803b6cfd1e0c697bef5d8
2021-07-04 10:36:20 -07:00
Xiang Xiao
69cb1d7086 mm: Move the real implementation of mm_sbrk to sbrk
and remove mm_sbrk and kmm_sbrk since it's wrong to expose
sbrk to other heaps except the default userspace heap.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I78fdf34c271585ec8fdb81eacedda9fc9f2431fb
2021-07-04 00:53:07 -07:00
Xiang Xiao
268d66173d mm: Move procfs_register_meminfo into common place
to avoid the code duplication and ensure the consistent behaviour

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3fa9ba13d3f8abf882907782708f52c788d0c813
2021-07-04 15:33:19 +08:00
mage1
f6a4c17838 sim: fix sim runtime err under sanitize check mode.
since gcc sanitize can not stub proper code in nuttx kernel code.

Change-Id: I0910bddee71538c202c6a0a8faab76bcc65f5cd2
2021-07-02 10:49:13 +08:00
ligd
dcea2afd7e mm: fix memory corruption when loop create/exit thread in SMP mode
Root casue:
when do thread exit, need add free stack operation to mm_delaylist,
but in SMP mode, CPU0 thread1 exit, at this time, CPU1 call malloc
and free mm_delaylist.

Fix:
Divide mm_delaylist for per CPU in SMP mode.

Change-Id: Ibf7d04614ea2f99fb5b506356b7346a0d94f0590
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-01 18:26:20 +08:00
Xiang Xiao
82047fe3c4 mm: Add kmm_malloc_size and mm_malloc_size
make malloc_size implementation align with malloc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8d7781925f06e58a880437a16569dccbfd2ea035
2021-07-01 18:08:54 +08:00
Xiang Xiao
4b7c156321 arch/sim: Implement mm_mallinfo for the custom heap
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idf07081869a4659490109aacf8d7905bdb485835
2021-06-28 21:26:09 +08:00
Xiang Xiao
a9f917e44d arch/sim: Implement malloc_size for the custom heap
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-28 21:26:09 +08:00
Xiang Xiao
62ac1e1b6d arch/sim: Remove host_malloc and host_calloc
use host_realloc instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I41e5a722532830b9ec26dd7b32bfab9f30b443c2
2021-06-28 21:26:09 +08:00
Xiang Xiao
4e3c1ed8af mm: Support malloc_size function
and rename malloc_usable_size to malloc_size

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8d83e9148d70e752142af26d7dd9a291123fdd14
2021-06-28 21:26:09 +08:00
Xiang Xiao
d37d8e00a5 mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE
since the old design reuse BIOC_FLUSH for
MTD device which make some confusion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-28 18:06:52 +08:00
Virus.V
4624cb25d6 riscv/bl602:replace syslog to debugging log macros 2021-06-28 18:06:52 +08:00
Xiang Xiao
800754a9be Replace mktime with timegm in rtc and fs driver
since kernel component should use UTC instead local time

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf939e1ab0af8e577105f539d2553bc67b3b3d10
2021-06-24 20:53:53 +08:00
Xiang Xiao
b3bcc02a04 sched: Identify the stack need to free by TCB_FLAG_FREE_STACK
instead calling kmm_heapmember or umm_heapmember because:
1.The stack supplied by caller may allocate from heap too
2.It's hard to implement these two function in ASan case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I196377822b7c4643ab4f29b7c1dc41dcd7c4dab1
2021-06-18 20:59:03 +08:00
ligd
200a1d51d3 arm: fix enable interrupt too earlier caused system crash
reason:
	msr	cpsr, r2   /* Set the CPSR */

    // interrupt hanppend, context switch

	pop	{r0-r2, pc}

resolve:
    use SPSR instead, and recover with ldmia ^

Change-Id: Id7cee6452997ec19919eeecf6e7616164b3a0ab3
Signed-off-by: ligd <liguiding1@xiaomi.com>
(cherry picked from commit 6fa6c1676932d7babb7ff22ef556a17bb18f1c0d)
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-06-17 14:39:22 +08:00
chao.an
27aad31338 sim: add posix_memalign() to nuttx-names.in
hide the symbol definition from up_hostmemory.c:
147:  error = posix_memalign(&p, alignment, size);

Change-Id: I0bbc509c1ecf43388f6b21997a878a5f5fecf60a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-15 14:59:01 +08:00
Xiang Xiao
4d66266a8e sched: Don't include nuttx/sched.h inside sched.h
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6fe673364be9eb1259381e6575d4c1a9fea58097
2021-06-13 00:25:26 -07:00
Xiang Xiao
8ae0e1759e arch: Colorize the idle thread stack in an unified way
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idae8da53e5a4799a8edc0e882f17fd515b70cb14
2021-06-11 11:37:32 +08:00
Xiang Xiao
35035f5c89 arch: Rename xxx_getsp to up_getsp
All modern desgin support stack pointer and it's also an
important information, so let's standardize this interface.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-11 11:37:19 +08:00
chao.an
0d960286a6 Revert "arch: adjust idle stack offset to reserve space of stack info"
This reverts commit 91dbb26153.
2021-06-09 23:21:56 +08:00
chao.an
e223790148 serial/uart/h4: add bt h4 uart serial driver
Change-Id: I456622ce097006447cc8b050e4a44ee96865ddfe
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:20 +08:00
chao.an
8f0cc709d4 wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
Change-Id: I12879c364cf8ca63898da94621e94d8fc23a4f6f
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:14 +08:00
chao.an
e9954c80dd arch/sim: remove BT uart implement
Change-Id: Ic9ea51116ba46cb667eae0ea151f69079f9f05ab
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:32:49 +08:00
chao.an
91dbb26153 arch: adjust idle stack offset to reserve space of stack info
Change-Id: I064b6dfcfa5152e58ad2dba98021b1aa37c98b7e
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 17:31:05 +08:00
Dong Heng
2af7861b31 riscv/esp32c3: Fix SPI Flash driver internal chip data address error
"g_rom_flashchip" is not in fixed address between all ESP32-C3's different versions.
2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
16dd2260f1 risc-v/esp32c3: Uniformize alignment for assembly instructions 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
6b5fe76506 risc-v/esp32c3: Improve interrupt handler documentation 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
f948f9fa8d risc-v/esp32c3: Reorder register restoration on interrupt handler epiloque 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
401a1bf751 risc-v/esp32c3: Fix wrong references to ESP32 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
5a76c52ae2 arch/risc-v: Fix stack alignment according to calling convention
The RISC-V Integer Calling Convention states that the stack pointer
shall always be aligned to a 128-bit boundary upon procedure entry, both
for RV32* and RV64* ISAs (exception to the RV32E ISA, which must follow a
specific convention)
2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
e0e9f4db1c xtensa/esp32: Change ESP32_RT_TIMER_TASK_PRIORITY comment into help text 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
3782ca8dcc xtensa/esp32: Add missing default value for CONFIG_ESP32_GPIO_IRQ 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
91039bff97 xtensa/esp32: Uniformize Kconfig alignment and styling 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
e06fa3cc7e xtensa/esp32: Remove inconsistent usage of comment command 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
a35c140d0c xtensa/esp32: Remove redundant dependency 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
bfb8eec64a risc-v/esp32c3: Change ESP32C3_RT_TIMER_TASK_PRIORITY comment into help text 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
b85090684d risc-v/esp32c3: Uniformize Kconfig alignment and styling 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
672d879d34 risc-v/esp32c3: Remove inconsistent usage of comment command 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
0d32ff6a5c risc-v/esp32c3: Remove redundant dependency 2021-05-10 19:23:33 +08:00
Byron Ellacott
70ab250c5d Add experimental support for an eZ80 toolchain using llvm and GNU binutils.
An additional fix for the RTC driver to lock the RTC after setting values instead of unlocking it is included.
2021-05-10 19:23:33 +08:00
chenwen
98d97f27fd xtensa/esp32: Fix crash issue caused by null pointer operation 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
0e0c7a9a47 risc-v/esp32c3: Add driver for General Purpose SPI Master 2021-05-10 19:23:33 +08:00
Huang Qi
9e5aa98495 arch/sim: Fix warning of duplicated object
N/A

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I91cf182a396fc8f8024faf65c1cc7bf45cf34bbc
2021-05-08 22:11:52 +08:00
Jiuzhu Dong
94eecb1702 sim/rptun: support multi(>2) core interactive by share memory
N/A

Change-Id: Ia8254bfe369e40a04ed54adfa64afa38974b165c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:45:26 +08:00
Jiuzhu Dong
788e409cb7 driver/syslog: add config SYSLOG_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:22:28 +08:00