Avoid the errno changed after interrupt in sim and make return value
mistake when according to errno.
Move host_errno_convert from macro to sim_errno.c.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
We will remove the API in next commit, so remove the errno manual save
API and save errno more commonly.
After whole pull request, should no longer need to care about errno.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This reverts commit ac5b38c9e5.
Keep host_errno_convert as a common interface in sim_internal.h
Keep the up_irq_save & up_irq_restore as common interface
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
modify the code of the adapted protocol stack to avoid deadlocks and the
logic that cannot be protected by locks after modification.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
The USB driver framework only implements a single ISOC transfer.
If multiple transfers are needed, the class driver can initiate
multiple urbs to meet the real-time requirements of the ISOC
endpoint. The class driver's urb record the buf address, length,
and number of packets sent. The callback function calculates the
data location in the buf based on the callback number and length
returned.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
On success, zero (OK) is returned. On a failure, a negated errno value
is returned indicating the nature of the failure.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
The -D_FILE_OFFSET_BITS=64 parameter is missing
during the CMake compilation of the sim (simulator) build,
which causes incorrect version invocations of interfaces
such as hostfs_stat.
Signed-off-by: guohao15 <guohao15@xiaomi.com>
After processing a packet of data, do not exit interrupt, but continues
to check whether there is data to be processed. If there is, continue
processing.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
when start multiple sim, the host refuses to recognize multiple USB
devices, and the prompt message is as follows:
[365652.175289] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[365652.175304] misc raw-gadget: fail, usb_gadget_probe_driver returned -16
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit fixed oneshot driver to work with both signal and sleep.
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Many times, context switching does not occur when the thread stack
memory is almost exhausted, so we need to mofify up_check_tcbstack to
accurately detect it.
Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Complete the missing scheduling information in some architectures
In these architectures (riscv, avr, tricor) context switching
can occur in both up_switch_context and xx_doirq
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Replace all nxsched_suspend/resume_*** with nxsched_switch_context
Delete nxsched_resume_scheduler in up_exit and call it uniformly in task_exit
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>