Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天涯不与海角
rt-thread
提交
2e488e04
R
rt-thread
项目概览
天涯不与海角
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
2e488e04
编写于
12月 08, 2022
作者:
Z
zhkag
提交者:
GitHub
12月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[rt-smart]同步 gitee nanosleep 修复 (#6710)
上级
50d5046f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
6 deletion
+34
-6
bsp/qemu-vexpress-a9/drivers/drv_log.h
bsp/qemu-vexpress-a9/drivers/drv_log.h
+27
-0
components/libc/compilers/common/ctime.c
components/libc/compilers/common/ctime.c
+3
-4
components/lwp/lwp_syscall.c
components/lwp/lwp_syscall.c
+4
-2
未找到文件。
bsp/qemu-vexpress-a9/drivers/drv_log.h
0 → 100644
浏览文件 @
2e488e04
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-12-8 zhkag first version
*/
/*
* NOTE: DO NOT include this file on the header file.
*/
#ifndef LOG_TAG
#define DBG_TAG "drv"
#else
#define DBG_TAG LOG_TAG
#endif
/* LOG_TAG */
#ifdef DRV_DEBUG
#define DBG_LVL DBG_LOG
#else
#define DBG_LVL DBG_INFO
#endif
/* DRV_DEBUG */
#include <rtdbg.h>
components/libc/compilers/common/ctime.c
浏览文件 @
2e488e04
...
...
@@ -727,7 +727,7 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, s
case
CLOCK_REALTIME
:
{
rt_tick_t
tick
,
tick_old
=
rt_tick_get
();
if
(
flags
&
TIMER_ABSTIME
==
TIMER_ABSTIME
)
if
(
(
flags
&
TIMER_ABSTIME
)
==
TIMER_ABSTIME
)
{
tick
=
(
rqtp
->
tv_sec
-
_timevalue
.
tv_sec
)
*
RT_TICK_PER_SECOND
+
(
rqtp
->
tv_nsec
-
_timevalue
.
tv_usec
)
*
(
RT_TICK_PER_SECOND
/
NANOSECOND_PER_SECOND
);
rt_tick_t
rt_tick
=
rt_tick_get
();
...
...
@@ -763,7 +763,7 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, s
float
unit
=
clock_cpu_getres
();
cpu_tick
=
(
rqtp
->
tv_sec
*
NANOSECOND_PER_SECOND
+
rqtp
->
tv_nsec
*
(
NANOSECOND_PER_SECOND
/
NANOSECOND_PER_SECOND
))
/
unit
;
if
(
flags
&
TIMER_ABSTIME
==
TIMER_ABSTIME
)
if
(
(
flags
&
TIMER_ABSTIME
)
==
TIMER_ABSTIME
)
cpu_tick
=
cpu_tick
<
cpu_tick_old
?
0
:
cpu_tick
-
cpu_tick_old
;
tick
=
(
unit
*
cpu_tick
)
/
(
NANOSECOND_PER_SECOND
/
RT_TICK_PER_SECOND
);
rt_thread_delay
(
tick
);
...
...
@@ -1007,7 +1007,6 @@ RTM_EXPORT(timer_delete);
**/
int
timer_getoverrun
(
timer_t
timerid
)
{
struct
timer_obj
*
timer
=
(
struct
timer_obj
*
)((
uintptr_t
)
timerid
<<
1
);
rt_set_errno
(
ENOSYS
);
return
-
RT_ERROR
;
}
...
...
@@ -1125,7 +1124,7 @@ int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
* RT_TICK_PER_SECOND NANOSECOND_PER_SECOND NANOSECOND_PER_SECOND
*
*/
if
(
flags
&
TIMER_ABSTIME
==
TIMER_ABSTIME
)
if
(
(
flags
&
TIMER_ABSTIME
)
==
TIMER_ABSTIME
)
{
#ifndef RT_USING_RTC
LOG_W
(
_WARNING_NO_RTC
);
...
...
components/lwp/lwp_syscall.c
浏览文件 @
2e488e04
...
...
@@ -929,7 +929,8 @@ int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
if
((
ret
!=
-
1
||
rt_get_errno
()
==
EINTR
)
&&
rmtp
&&
lwp_user_accessable
((
void
*
)
rmtp
,
sizeof
*
rmtp
))
{
lwp_put_to_user
(
rmtp
,
(
void
*
)
&
rmtp_k
,
sizeof
rmtp_k
);
return
-
EINTR
;
if
(
ret
!=
0
)
return
-
EINTR
;
}
#else
if
(
rmtp
)
...
...
@@ -3878,7 +3879,8 @@ int sys_clock_nanosleep(clockid_t clk, int flags, const struct timespec *rqtp, s
if
((
ret
!=
-
1
||
rt_get_errno
()
==
EINTR
)
&&
rmtp
&&
lwp_user_accessable
((
void
*
)
rmtp
,
sizeof
*
rmtp
))
{
lwp_put_to_user
(
rmtp
,
(
void
*
)
&
rmtp_k
,
sizeof
rmtp_k
);
return
-
EINTR
;
if
(
ret
!=
0
)
return
-
EINTR
;
}
#else
if
(
rmtp
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录