This definition was added in order to solve some compilation problems
encountered when porting tripartite libraries
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This definition was added in order to solve some compilation problems
encountered when porting third-party libraries
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
To solve some compilation issues encountered during the porting of
third-party libraries, this function has been added.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This adds field type to canioc_bittiming_s structure that allows
to set/obtain bit timing for both CAN CC and CAN FD.
CANIOC_GET_BITTIMING is now bidirectional: user specifies type field
and gets other fields from the controller.
The commit also updates current CAN FD capable controllers using the
ioctl. The type is not checked for classical CAN only controllers
and nominal bit timing is returned regardless of type value.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit moves can_bytes2dlc and can_dlc2bytes from kernel internal
functions to API. These functions are necessary to convert bytes to
dlc for CAN FD frames and has to be accessible from the application
since can_hdr_s does not store message length in bytes but directly in
dlc.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Add a common method to format backtrace to buffer, so it can be used by both mm, fs and other possoble modules.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
Allow CPU_XXX macros to be used without CONFIG_SMP=y
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
Co-authored-by: Bowen Wang <wangbowen6@xiaomi.com>
Thread args have already been saved to stack after the TLS section by
nxtask_setup_stackargs. This is to retrieve it for use.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
make possible enable pool, but disabled in system heap.
also compatible for further extra heap use/not use pool.
Now use MM_HEAP_MEMPOOL_THRESHOLD -1 to indicate pool disabled.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
we can use g_cpu_lockset to determine whether we are currently in the scheduling lock,
and all accesses and modifications to g_cpu_lockset, g_cpu_irqlock, g_cpu_irqset
are in the critical section, so we can directly operate on it.
test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx
Signed-off-by: hujun5 <hujun5@xiaomi.com>
If the CAN stack receiving packets fast, but the application layer reading packets slow. Then `conn->readahead` will continue to grow, leading to memory leaks. Finally CAN stack potentially starve out all IOB buffers. To prevent memory leaks, users can restrict can socket buffer length.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h: In function 'oneshot_max_delay':
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h:272:3: error: implicit declaration of function 'timespec_from_tick' [-Wimplicit-function-declaration]
272 | timespec_from_tick(ts, tick);
| ^~~~~~~~~~~~~~~~~~
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h: In function 'oneshot_start':
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h:285:10: error: implicit declaration of function 'timespec_to_tick'; did you mean 'timespec_get'? [-Wimplicit-function-declaration]
285 | tick = timespec_to_tick(ts);
| ^~~~~~~~~~~~~~~~
| timespec_get
This adds IS_POWER_OF_2 macro to help catching config errors at
build time.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
sched implementation not depends on macro abstraction, so revert below commit:
This reverts commit 4e62d0005a
This reverts commit 0f0c370520
This reverts commit ad0efd04ee
Signed-off-by: chao an <anchao@lixiang.com>
pointer comparison is unsigned, when returning -errno will be converted
to a large positive number, can not enter the error handling branch,
therefore, the error code is returned directly and the sem is returned
through the parameters.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
After change, when CONFIG_PM_NDOMAINS > 1,
the pm_register will not able to get notificaion
from not PM_IDLE_DOMAIN.
Should use pm_domain_register as a replacement.
Isolate domains from global callbacks can decrease
not necessary execution, and reduce the
lock instruction requirements.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
umm_memdump() should be always declared otherwise we get error when DEBUG_MM=n:
sched/task/task_exithook.c:468:7: error: implicit declaration of function ‘umm_memdump’; did you mean ‘mm_memdump’? [-Wimplicit-function-declaration]
MCP794XX supports digital trimming that periodically adds or subtracts
clock cycles, resulting in small adjustments in the internal timing.
This way inaccuracies of clock source can be compensated.
This commit adds option to set the trimming register for MCP794XX.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
The definition of nxsched_process_cpuload_ticks uses clock_t, which is
portable across uint32_t and uint64_t timers, and works if CONFIG_SYSTEM_TIME64 is
defined.
only when first time change state can hold WFI for enough time thresh,
allow second time goto target state,
suitable for the case when wakeup from sleep too slow, etc.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>