Commit Graph

5786 Commits

Author SHA1 Message Date
zhangyuan21
fc9b5e1980 arch_alarm: adjust oneshot/arch_alarm to support tick 2022-10-12 11:55:46 +08:00
zhangyuan21
750007ded9 sched: use tick count for sched timer expiration 2022-10-12 11:55:46 +08:00
liangchaozhong
cc426f8539 usrsock:add done flag in usrsock_iovec_do
set done to true if all data in iovec array is copied

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-10-11 00:57:49 +08:00
Xiang Xiao
a875e13105 list.h: Add local temp variable to avoid the double evaluation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 08:29:39 +02:00
Petro Karashchenko
d247e8d1d2 sched/semaphore: fix priority boost restoration for priority inheritance
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-03 15:14:24 -03:00
Xiang Xiao
6ec74d8d36 bluetooth: Forward ioctl to btuart lowerhalf driver
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-02 18:14:00 -03:00
wangbowen6
e9ccab2db3 fs/poll: using callback mechanism to implement poll notification
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-10-03 00:00:56 +08:00
raiden00pl
0aa0394ca2 include/stdint.h: add sig_atomic_t limits 2022-10-02 22:30:54 +08:00
raiden00pl
d8483a24e8 include/threads.h: return values should be integer type to prevent compiler warnings 2022-10-02 22:30:29 +08:00
zhangyuan21
85d013f69a sched: mqueue wait list optimize 2022-09-28 18:08:37 +08:00
zhangyuan21
838309313e sched: semaphore wait list optimize 2022-09-28 18:08:37 +08:00
Fotis Panagiotopoulos
bbf3f2866d Fixed non-UTF8 characters. 2022-09-28 09:38:55 +08:00
Xiang Xiao
764540267e sched/clock: Rename g_system_timer to g_system_ticks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-27 17:45:44 -03:00
yinshengkai
ae38e3eb10 sched: Optimize sched_note_begin/end
Optimize sched_note_begin/end, replace note_printf with note_string
sched_note_begin/end optimized from 50us to 1us per consumption

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-27 21:32:35 +08:00
Xiang Xiao
40ef5bc6db libc: Move queue.h from include to include/nuttx
to avoid the conflict with libuv's queue.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:58 +02:00
wangbowen6
344c8be049 poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
chao an
74842880f9 compiler.h: add MSVC(Microsoft Visual C++)-specific definitions
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-26 04:40:34 +08:00
Xiang Xiao
70290b6e38 arch: Change the linker generated symbols from uint32_t to uint8_t *
and remove the duplicated declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-24 21:26:56 +02:00
zhangyuan21
af72a528f1 sched: merge waitsem and msgwaitq 2022-09-22 16:32:44 +08:00
Xiang Xiao
4c44c6f709 arch.h: Make _sinit/_einit as an offical interface
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-22 08:29:24 +08:00
Xiang Xiao
53466c6d46 net: Add IN6_IS_ADDR_LINKLOCAL macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-21 18:28:40 +08:00
Xiang Xiao
03f45a124a watchdog: Support auto monitor keep alive from oneshot lowerhalf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 22:04:36 +02:00
Xiang Xiao
1eefec4db3 watchdog: Support auto monitor keep alive from timer lowerhalf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 22:04:36 +02:00
Xiang Xiao
db518bf0df fs: Allocate unique serial number for the root pseduo file system node
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:21:06 +08:00
Xiang Xiao
079a6fa6cc arch/armv7[a|r]: Implement up_affinity_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
ef43283c67 arch/arm: Unify arm_cpu_sgi to up_trigger_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
chao an
d5a1576361 net/wireless: add support for netdev private ioctl
Signed-off-by: chao an <anchao@xiaomi.com>
Signed-off-by: caohongwei <caohongwei@xiaomi.com>
2022-09-20 01:16:22 +08:00
chao an
8b238e0b3d net/wireless: separate command catagory of bt/pktradio from wireless ioctl
1. separate command catagory of bt/pktradio from wireless ioctl
2. Remove commoand count limit to support vendor command

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-20 01:16:22 +08:00
ligd
e2df52390a SMP: fix crash when switch to new task which is still running
Situation:

Assume we have 2 cpus, and busy run task0.

CPU0                                CPU1
task0 -> task1                      task2 -> task0
1. remove task0 form runninglist
2. take task1 as new tcb
3. add task0 to blocklist
4. clear spinlock
                                    4.1 remove task2 form runninglist
                                    4.2 take task0 as new tcb
                                    4.3 add task2 to blocklist
                                    4.4 use svc ISR swith to task0
                                    4.5 crash
5. use svc ISR swith to task1

Fix:
Move clear spinlock to the end of svc ISR

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
田昕
f6ebbe4429 drivers/mtd:init commit of power-loss resilient cfg
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-15 17:46:56 +08:00
liangchaozhong
62cbd72149 remove access on /dev/usrsock in up_usrsock.c
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-10 13:08:22 +08:00
liangchaozhong
644c4afeed usrsock:refine usrsock's architecture
Seperate usrsock device driver with usrsock core function layer
to make it more flexiable to adopt other kind of usrsock interface driver

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-09 20:56:12 +09:00
wangbowen6
c754df6411 drivers/mtd: add rpmsg mtd support
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
wangbowen6
25c2f3e042 driver: move find_mtddriver() to fs.h and add close_mtddriver.c
Rpmsg mtd need a way to find the mtd device according to the
mtd device path.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-09 19:27:57 +08:00
ligd
4bd88acf1b wqueue: fix work_qcancel() judge error caused by the union in struct work_s
in struct work_s:
union
{
  struct
  {
    struct dq_entry_s dq; /* Implements a double linked list */
    clock_t qtime;        /* Time work queued */
  } s;
  struct wdog_s timer;    /* Delay expiry timer */
}

while we use WDOG_ISACTIVE(&work->timer) to decide use dq or timer,
that is error, wd_cancel() maybe modify this area, dq_rem() also can
modify this area.
So we can't use the WDOG_ISACTIVE(&work->timer) to take as the judgement,
when there is a union.

Fix:
swap the order in struct wdog_s, move the arg to the second 32bit

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
4a87578bdb wqueue: change single queue to double queue to improve speed
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
ligd
2cc3ec57ef queue: add dq_rmafter support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-08 15:03:54 +02:00
Neale Ferguson
213b954a90 * Squash round() commits
- Add check in roundx() functions for infinite or NaN cases
  - Add block to avoid style warnings
  - Define long double constants and macros for infinity and nan
  - Correct return syntax to match NuttX style
  - Make c89 compliant
  - Fix definitions of INFINITY_L/NAN_L

* include/nuttx/lib/math.h - match standard naming conventions
  - Rename isinf_l to isinfl
  - Rename isinf_f to isinff
  - Add finite()
  - Add finitel()
  - Add finitef()
  - Define isnanl and isnanf
  - Define isfinite() so that it uses the appropriate macro

* libs/libc/math/lib_asinf.c
  libs/libc/math/lib_asinl.c
  libs/libc/math/lib_roundf.c
  libs/libc/math/lib_roundl.c
  libs/libc/math/lib_sqrtf.c
  libs/libc/math/lib_sqrtl.c
  - Use renamed macros
  - Use correct NAN_x or INFINIT_x macro on returns
2022-09-08 20:57:27 +08:00
Nathan Hartman
de8d54781c fs: Fix symbol name in comments 2022-09-08 09:01:55 +08:00
Xiang Xiao
e17b678a16 compiler.h: Rename inline_function to always_inline_function
reserve inline_function macro for inline keyword

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-07 10:24:04 +02:00
zhanghongyu
9bff29d7e7 udp: add IPVx_PKTINFO related support
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-09-07 10:49:47 +08:00
Xiang Xiao
e0bb281e7a net: Align the prototype of sock_intf_s::si_ioctl with file_operations::ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-06 22:46:37 +08:00
anjiahao
1a5351edac libc:add timingsafe_bcmp to libc
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-05 22:27:05 +08:00
anjiahao
21934122d5 include:endian.h add openbsd style
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-05 10:39:36 -03:00
Michal Lenc
8e2b4576bf sensors/qencoder: add QEIOC_GETINDEX ioctl
This IOCTL (QEIOC_GETINDEX) allows the application to get the actual
encoder position, the index last position and the index count with
one IOCTL call if supported by architecture specific level.

The position, index and count is passed to application level through
qe_index_s structure.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-04 11:08:45 +08:00
zhangyuan21
1a9252aec9 nuttx/queue: change some queue function to macro 2022-09-04 11:08:02 +08:00
Xiang Xiao
71af0b5295 list.h: Change inline function to macro as much as possbile
since C89 doesn't support inline keyword:
https://github.com/apache/incubator-nuttx/issues/6896

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-31 09:01:02 +02:00
Junbo Zheng
c947ddd441 include/nuttx/list.h: support list entry macro
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-08-31 09:01:02 +02:00
Huang Qi
7e316d0ba9 compiler.h: Add a new attribute nosanitize_undefined
This allow us to disable UBSan for particular function.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-30 19:35:24 +08:00
Xiang Xiao
3b0516f6a2 libc/crc: Add full suffix to avoid the the penitential symbol collision
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-29 18:06:53 +02:00