Skip to content

Conversation

xiangxistu
Copy link
Member

@xiangxistu xiangxistu commented Dec 14, 2021

拉取/合并请求描述:(PR description)

[

  • add some posix's interfaces that we haven't before.
  • these PR have passed the interface definition test across gcc platfrom;
  • have tested base on qemu-a9 and stm32h750-art-pi.

]

以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
  • 本拉取/合并使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

@mysterywolf mysterywolf added the in progress PR/issue in progress. label Dec 14, 2021
Comment on lines +615 to +617
int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, struct timespec *rmtp)
{
if ((clockid != CLOCK_REALTIME) || (rqtp == RT_NULL))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys/time.h没有给出这个函数的声明

Comment on lines +669 to +672
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
{
uint32_t time_ms = rqtp->tv_sec * 1000;
uint32_t time_us = rqtp->tv_nsec / 1000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys/time.h没有给出这个函数的声明

libc_ver = GetDepend('LIBC_VERSION')
try:
ver = libc_ver.split(' ')
ver = ver[1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个位置怎么加回来了?

Comment on lines +1 to +19
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-07-21 xiangxistu The first version
*/

#ifndef _SYS__TIMESPEC_H_
#define _SYS__TIMESPEC_H_

#include <sys/_types.h>

#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t;
#define __time_t_defined
#define _TIME_T_DECLARED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件删掉

# There is no 'sys/select.h' in tthe mips gcc toolchain; it will be copied from 'nogcc/sys/select.h'
# There is no 'sys/_timespec.h' in tthe mips gcc toolchain; it will be copied from 'nogcc/sys/_timespec.h'
copy("../../../common/nogcc/sys/select.h", "./sys/select.h")
copy("../../../common/nogcc/sys/_timespec.h", "./sys/_timespec.h")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除掉此句

!(defined(__ICCARM__) && (__VER__ >= 8010001)) && \
!defined(_WIN32)
#ifndef _TIMESPEC_DEFINED
#define _TIMESPEC_DEFINED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert此文件的修改

Comment on lines -7 to 9

#ifdef __SPU__
#include <sys/_timespec.h>
int nanosleep (const struct timespec *, struct timespec *);
#endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段删掉吧

@mysterywolf
Copy link
Member

mysterywolf commented Dec 14, 2021

把time相关的先都移除吧 这部分我来处理,只需要帮我把这里删除掉就可以了machine/time.h :

#ifdef __SPU__
#include <sys/_timespec.h>
int nanosleep (const struct timespec *, struct timespec *);
#endif

@mysterywolf
Copy link
Member

#5384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress PR/issue in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants