- User mode allocator was used for setting up the environment. This
works in flat mode and probably in protected mode as well, as there
is always a a single user allocator present
- This does not work in kernel mode, where each user task has its own
heap allocator. Also, when the idle tasks environment is being set,
no allocator is ready and the system crashes at once.
Fix this by using the group allocators instead:
- Idle task is a kernel task, so its group is privileged
- Add group_realloc
- Use the group_malloc/realloc functions instead of kumm_malloc
For mult domains scene,,
activity and greety can be used at same time.
Let user to select domain governor.
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
NuttX' string.h is using the FAR preprocessor definition, which is
defined in nuttx/compiler.h. Thus, it should include it.
Signed-off-by: Michael Jung <mijung@gmx.net>
since the temporary kernel spawn proxy need duplicate file handler
from caller, please reference the follow source code for more info:
sched/task/task_posixspawn.c
sched/task/task_spawn.c
This reverts commit 5c5f1dec08.
the private data should be done like this:
struct xxx_lowerhalf_s
{
struct djoy_lowerhalf_s lower;
/* Add more private data here */
};
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Summary:
- In case of BUILD_KERNEL, NuttX uses USR mode sp and SVC mode sp.
- The kernel runs on SVC mode sp.
- While the kernel is running, up_getsp() cannot get the TLS address.
- The kernel requires tls_get_info() function.
- For the user land, up_getsp() can be used.
- tls_getinfo.c is always compiled and tls_get_info() function is
filtered by macros in the tls_getinfo.c.
Impact:
BUILD_KERNEL
Testing:
test program on custom Cortex-A9 board (BUILD_KERNEL)
ostest on sabre-6quad:smp (QEMU, BUILD_FLAT)
Signed-off-by: Oki Minabe <minabe.oki@gmail.com>
usage:
echo <pid/used/free> trace > /proc/memdump
echo used > /proc/memdump //output all used memory info with backtrace
echo free > /proc/memdump //output all free memory info
echo 22 > /proc/memdump //output used memory info for task pid is 22 with backtrace
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
In some scenarios, We need to update state information internally.
Instead of use idle-task to drive the checkstate and change state
function.
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
Gregory Nutt has submitted the SGA
Giorgio Gross has submitted the ICLA
as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
here is the reason:
1.clock_systime_timespec(core function) always exist regardless the setting
2.CLOCK_MONOTONIC is a foundamental clock type required by many places
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
State of problem:
- Some drivers that do not support write operations (does not
have write handler or ioctl do not perform any write actions)
are registered with write permissions
- Some drivers that do not support read operation (does not
have read handler or ioctl do not perform any read actions)
are registered with read permissions
- Some drivers are registered with execute permissions
Solution:
- Iterate code where register_driver() is used and change 'mode'
parameter to reflect the actual read/write operations executed
by a driver
- Remove execute permissions from 'mode' parameter
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
The angle observer always refer to a motor electrical angle,
while the speed observer can be applied to a motor electrical speed or a motor mechanical speed.
They can be used completely independently, so they should'n be coupled.
For example, a sensored motor controller in speed control mode doesn't need an angle estimator.
The packed-attribute on the tcb_info_s type was misplaced, which caused
incompatible memory layout between host and target. According to
current GCC documentation:
> You may specify type attributes in an enum, struct or union type
> declaration or definition by placing them immediately after the struct,
> union or enum keyword. You can also place them just past the closing
> curly brace of the definition, but this is less preferred because
> logically the type should be fully defined at the closing brace.
I also added jlink-nuttx.so to the .gitignore list and updated nxstyle
to ignore the camel case function names required by JLinkGDBServer.
Signed-off-by: Michael Jung <mijung@gmx.net>
Add a list in TCB to track all semphores the task held, so we
can release all holders when exit, so nxsched_verify_tcb
is unnecessary.
Signed-off-by: Zeng Zhaoxiu <walker.zeng@transtekcorp.com>
Basically, mirror the following two commits from modlib.
It's shame we have two copies of elf loaders.
```
commit 51490bad55
Author: YAMAMOTO Takashi <yamamoto@midokura.com>
Date: Wed Apr 14 17:07:39 2021 +0900
modlib: Implement sh_addralign handling
I've seen a module with 16 bytes .rodata alignment for xmm operations.
It was getting SEGV on sim/Linux because of the alignment issue.
The same module binary seems working fine after applying this patch.
Also, tested on sim/macOS and esp32 on qemu,
using a module with an artificially large alignment. (64 bytes)
```
```
commit 418e11b8b3
Author: YAMAMOTO Takashi <yamamoto@midokura.com>
Date: Thu Apr 15 11:33:48 2021 +0900
modlib: Always use separate allocation for text and data
Pros:
* Reduce code differences
* Smaller allocations for !CONFIG_ARCH_USE_MODULE_TEXT
Cons:
* Likely to use more memory for !CONFIG_ARCH_USE_MODULE_TEXT in total
Tested with:
* sim:module on macOS
* esp32-devkit:nsh + CONFIG_MODULE on qemu
* lm3s6965-ek:qemu-protected + CONFIG_EXAMPLES_SOTEST on qemu
```
Some PPG devices have 4 ADCs to output quad-channel PPG values while some of them only have 2 ADCs to output dual-channel PPG.
To deal the case above, the type PPGD(PPG of Dual-channel) takes the place of former type PPG, which also have 2-channel PPG outputs. Type PPGQ (PPG of Quad-channel) is new for 4-ADC-PPG. Both types have contained new data "gain" to indicate ADC gains of each PPG channel, for the reason that the gains may vary during automatical optical adjustments.
Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
Commit 5d1a444812 replaced __attribute__
((unused)) with unused_code but two instances of __attribute__ ((used))
were also incorrectly replaced. Add used_code/used_data and used them
instead.
iSerialNumber field in the device descriptor can be used to determining the
board when multiple boards connected to the same host. So add feature to change
serial string by board unique ID dynamically.
To use this feature, user must be implement the board_usbdev_serialstr() logic.
refs #13909