Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
9254d1a3
R
rt-thread
项目概览
BaiXuePrincess
/
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,发现更多精彩内容 >>
提交
9254d1a3
编写于
11月 13, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[iar][syscalls] 补充注释
上级
215d1d4c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
61 addition
and
3 deletion
+61
-3
components/libc/compilers/dlib/syscall_close.c
components/libc/compilers/dlib/syscall_close.c
+6
-0
components/libc/compilers/dlib/syscall_lseek.c
components/libc/compilers/dlib/syscall_lseek.c
+15
-0
components/libc/compilers/dlib/syscall_open.c
components/libc/compilers/dlib/syscall_open.c
+5
-0
components/libc/compilers/dlib/syscall_read.c
components/libc/compilers/dlib/syscall_read.c
+12
-0
components/libc/compilers/dlib/syscall_remove.c
components/libc/compilers/dlib/syscall_remove.c
+9
-3
components/libc/compilers/dlib/syscall_write.c
components/libc/compilers/dlib/syscall_write.c
+14
-0
未找到文件。
components/libc/compilers/dlib/syscall_close.c
浏览文件 @
9254d1a3
...
...
@@ -11,7 +11,13 @@
#include <LowLevelIOInterface.h>
#include <unistd.h>
/*
* The "__close" function should close the file corresponding to
* "handle". It should return 0 on success and nonzero on failure.
*/
#pragma module_name = "?__close"
int
__close
(
int
handle
)
{
if
(
handle
==
_LLIO_STDOUT
||
...
...
components/libc/compilers/dlib/syscall_lseek.c
浏览文件 @
9254d1a3
...
...
@@ -11,7 +11,22 @@
#include <LowLevelIOInterface.h>
#include <unistd.h>
/*
* The "__lseek" function makes the next file operation (__read or
* __write) act on a new location. The parameter "whence" specifies
* how the "offset" parameter should be interpreted according to the
* following table:
*
* 0 (=SEEK_SET) - Goto location "offset".
* 1 (=SEEK_CUR) - Go "offset" bytes from the current location.
* 2 (=SEEK_END) - Go to "offset" bytes from the end.
*
* This function should return the current file position, or -1 on
* failure.
*/
#pragma module_name = "?__lseek"
long
__lseek
(
int
handle
,
long
offset
,
int
whence
)
{
if
(
handle
==
_LLIO_STDOUT
||
...
...
components/libc/compilers/dlib/syscall_open.c
浏览文件 @
9254d1a3
...
...
@@ -12,6 +12,11 @@
#include <LowLevelIOInterface.h>
#include <fcntl.h>
/*
* The "__open" function opens the file named "filename" as specified
* by "mode".
*/
#pragma module_name = "?__open"
int
__open
(
const
char
*
filename
,
int
mode
)
...
...
components/libc/compilers/dlib/syscall_read.c
浏览文件 @
9254d1a3
...
...
@@ -19,7 +19,19 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
/*
* The "__read" function reads a number of bytes, at most "size" into
* the memory area pointed to by "buffer". It returns the number of
* bytes read, 0 at the end of the file, or _LLIO_ERROR if failure
* occurs.
*
* The template implementation below assumes that the application
* provides the function "MyLowLevelGetchar". It should return a
* character value, or -1 on failure.
*/
#pragma module_name = "?__read"
size_t
__read
(
int
handle
,
unsigned
char
*
buf
,
size_t
len
)
{
#ifdef RT_USING_POSIX
...
...
components/libc/compilers/dlib/syscall_remove.c
浏览文件 @
9254d1a3
...
...
@@ -11,12 +11,18 @@
#include <LowLevelIOInterface.h>
#include <unistd.h>
/*
* The "remove" function should remove the file named "filename". It
* should return 0 on success and nonzero on failure.
*/
#pragma module_name = "?remove"
int
remove
(
const
char
*
val
)
int
remove
(
const
char
*
filename
)
{
#ifdef RT_USING_POSIX
return
unlink
(
val
);
return
unlink
(
filename
);
#else
return
-
1
;
return
_LLIO_ERROR
;
#endif
/* RT_USING_POSIX */
}
components/libc/compilers/dlib/syscall_write.c
浏览文件 @
9254d1a3
...
...
@@ -19,6 +19,20 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
/*
* The "__write" function should output "size" number of bytes from
* "buffer" in some application-specific way. It should return the
* number of characters written, or _LLIO_ERROR on failure.
*
* If "buffer" is zero then __write should perform flushing of
* internal buffers, if any. In this case "handle" can be -1 to
* indicate that all handles should be flushed.
*
* The template implementation below assumes that the application
* provides the function "MyLowLevelPutchar". It should return the
* character written, or -1 on failure.
*/
#pragma module_name = "?__write"
size_t
__write
(
int
handle
,
const
unsigned
char
*
buf
,
size_t
len
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录