Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
2c885336
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看板
提交
2c885336
编写于
1月 31, 2015
作者:
B
bernard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[LIBC] fix compiling issue for dlib (IAR).
上级
622e6d82
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
204 addition
and
72 deletion
+204
-72
components/libc/SConscript
components/libc/SConscript
+2
-0
components/libc/dlib/SConscript
components/libc/dlib/SConscript
+1
-1
components/libc/dlib/rmtx.c
components/libc/dlib/rmtx.c
+1
-0
components/libc/dlib/syscall_close.c
components/libc/dlib/syscall_close.c
+43
-0
components/libc/dlib/syscall_lseek.c
components/libc/dlib/syscall_lseek.c
+6
-31
components/libc/dlib/syscall_mem.c
components/libc/dlib/syscall_mem.c
+44
-0
components/libc/dlib/syscall_open.c
components/libc/dlib/syscall_open.c
+60
-36
components/libc/dlib/syscall_read.c
components/libc/dlib/syscall_read.c
+4
-2
components/libc/dlib/syscall_remove.c
components/libc/dlib/syscall_remove.c
+38
-0
components/libc/dlib/syscall_write.c
components/libc/dlib/syscall_write.c
+5
-2
未找到文件。
components/libc/SConscript
浏览文件 @
2c885336
...
...
@@ -11,6 +11,8 @@ if GetDepend('RT_USING_LIBC'):
objs
=
objs
+
SConscript
(
'newlib/SConscript'
)
elif
rtconfig
.
PLATFORM
==
'armcc'
:
objs
=
objs
+
SConscript
(
'armlibc/SConscript'
)
elif
rtconfig
.
PLATFORM
==
'iar'
:
objs
=
objs
+
SConscript
(
'dlib/SConscript'
)
else
:
if
rtconfig
.
PLATFORM
==
'gcc'
:
objs
=
objs
+
SConscript
(
'minilibc/SConscript'
)
...
...
components/libc/dlib/SConscript
浏览文件 @
2c885336
...
...
@@ -10,6 +10,6 @@ CPPDEFINES = ['RT_USING_DLIBC']
if
rtconfig
.
PLATFORM
==
'iar'
:
group
=
DefineGroup
(
'dlib'
,
src
,
depend
=
[
'RT_USING_LIBC'
],
CPPPATH
=
CPPPATH
,
CPPDEFINES
=
CPPDEFINES
,
LIBS
=
LIBS
)
CPPPATH
=
CPPPATH
,
CPPDEFINES
=
CPPDEFINES
)
Return
(
'group'
)
components/libc/dlib/rmtx.c
浏览文件 @
2c885336
...
...
@@ -30,6 +30,7 @@
*/
#if _DLIB_THREAD_SUPPORT
typedef
void
*
_Rmtx
;
void
_Mtxinit
(
_Rmtx
*
m
)
{
rt_mutex_t
mutex
;
...
...
components/libc/dlib/syscall_close.c
0 → 100644
浏览文件 @
2c885336
/*
* File : syscall_close.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-01-28 Bernard first version
*/
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_posix.h>
#endif
#include <yfuns.h>
#pragma module_name = "?__close"
int
__close
(
int
handle
)
{
if
(
handle
==
_LLIO_STDOUT
||
handle
==
_LLIO_STDERR
||
handle
==
_LLIO_STDIN
)
return
_LLIO_ERROR
;
#ifdef RT_USING_DFS
return
close
(
handle
);
#else
return
0
;
#endif
}
components/libc/dlib/syscall
s
.c
→
components/libc/dlib/syscall
_lseek
.c
浏览文件 @
2c885336
/*
* File : syscall
s
.c
* File : syscall
_lseek
.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
*
...
...
@@ -23,46 +23,21 @@
*/
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_
file
.h>
#include <dfs_
posix
.h>
#endif
#include <yfuns.h>
#pragma module_name = "?__close"
int
__close
(
int
handle
)
{
if
(
handle
==
_LLIO_STDOUT
||
handle
==
_LLIO_STDERR
||
handle
==
_LLIO_STDIN
)
return
_LLIO_ERROR
;
#ifdef RT_USING_DFS
return
close
(
handle
);
#else
return
0
;
#endif
}
#pragma module_name = "?remove"
int
remove
(
const
char
*
val
)
{
#ifdef RT_USING_DFS
dfs_file_unlink
(
val
);
#endif
return
0
;
}
#pragma module_name = "?__lseek"
long
__lseek
(
int
handle
,
long
offset
,
int
whence
)
{
#ifdef RT_USING_DFS
#endif
if
(
handle
==
_LLIO_STDOUT
||
handle
==
_LLIO_STDERR
||
handle
==
_LLIO_STDIN
)
return
_LLIO_ERROR
;
#ifdef RT_USING_DFS
return
lseek
(
handle
,
offset
,
whence
);
#else
return
_LLIO_ERROR
;
#endif
}
components/libc/dlib/syscall_mem.c
0 → 100644
浏览文件 @
2c885336
/*
* File : syscall_mem.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-01-28 Bernard first version
*/
#include <rtthread.h>
void
*
malloc
(
rt_size_t
n
)
{
return
rt_malloc
(
n
);
}
void
*
realloc
(
void
*
rmem
,
rt_size_t
newsize
)
{
return
rt_realloc
(
rmem
,
newsize
);
}
void
*
calloc
(
rt_size_t
nelem
,
rt_size_t
elsize
)
{
return
rt_calloc
(
nelem
,
elsize
);
}
void
free
(
void
*
rmem
)
{
rt_free
(
rmem
);
}
components/libc/dlib/syscall_open.c
浏览文件 @
2c885336
/*
* File : syscall_open.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-01-28 Bernard first version
*/
* File : syscall_open.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-01-28 Bernard first version
*/
#include <rtthread.h>
#include <yfuns.h>
...
...
@@ -32,33 +32,57 @@
int
__open
(
const
char
*
filename
,
int
mode
)
{
if
(
mode
&
_LLIO_CREAT
)
#ifndef RT_USING_DFS
return
-
1
;
#else
int
handle
;
int
open_mode
=
O_RDONLY
;
if
(
mode
&
_LLIO_CREAT
)
{
open_mode
|=
O_CREAT
;
/* Check what we should do with it if it exists. */
if
(
mode
&
_LLIO_APPEND
)
{
/* Append to the existing file. */
open_mode
|=
O_APPEND
;
}
if
(
mode
&
_LLIO_T
EXT
)
if
(
mode
&
_LLIO_T
RUNC
)
{
/* we didn't support text mode */
/* Truncate the existsing file. */
open_mode
|=
O_TRUNC
;
}
switch
(
mode
&
_LLIO_RDWRMASK
)
{
}
if
(
mode
&
_LLIO_TEXT
)
{
/* we didn't support text mode */
}
switch
(
mode
&
_LLIO_RDWRMASK
)
{
case
_LLIO_RDONLY
:
/* The file should be opened for read only. */
break
;
case
_LLIO_WRONLY
:
/* The file should be opened for write only. */
open_mode
|=
O_WRONLY
;
break
;
case
_LLIO_RDWR
:
/* The file should be opened for both reads and writes. */
open_mode
|=
O_RDWR
;
break
;
default:
return
-
1
;
}
return
handle
;
handle
=
open
(
filename
,
open_mode
,
0
);
if
(
handle
<
0
)
return
-
1
;
return
handle
+
_LLIO_STDERR
+
1
;
#endif
}
components/libc/dlib/syscall_read.c
浏览文件 @
2c885336
...
...
@@ -23,6 +23,9 @@
*/
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_posix.h>
#endif
#include <yfuns.h>
#pragma module_name = "?__read"
...
...
@@ -44,8 +47,7 @@ size_t __read(int handle, unsigned char *buf, size_t len)
#ifndef RT_USING_DFS
return
_LLIO_ERROR
;
#else
size
=
read
(
handle
-
STDERR
-
1
,
buf
,
len
);
size
=
read
(
handle
-
_LLIO_
STDERR
-
1
,
buf
,
len
);
return
size
;
#endif
}
components/libc/dlib/syscall_remove.c
0 → 100644
浏览文件 @
2c885336
/*
* File : syscall_remove.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-01-28 Bernard first version
*/
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_file.h>
#endif
#include <yfuns.h>
#pragma module_name = "?remove"
int
remove
(
const
char
*
val
)
{
#ifdef RT_USING_DFS
dfs_file_unlink
(
val
);
#endif
return
0
;
}
components/libc/dlib/syscall_write.c
浏览文件 @
2c885336
...
...
@@ -23,6 +23,9 @@
*/
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_posix.h>
#endif
#include <yfuns.h>
#pragma module_name = "?__write"
...
...
@@ -47,12 +50,12 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
#endif
}
if
(
handle
==
STDIN
)
return
-
1
;
if
(
handle
==
_LLIO_
STDIN
)
return
-
1
;
#ifndef RT_USING_DFS
return
_LLIO_ERROR
;
#else
size
=
write
(
handle
-
STDERR
-
1
,
buf
,
len
);
size
=
write
(
handle
-
_LLIO_
STDERR
-
1
,
buf
,
len
);
return
size
;
#endif
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录