Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
84dbdbb9
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
84dbdbb9
编写于
12月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!753 x86_64 add ohos ident flag合入monthly分支 & 解决编译失败问题
Merge pull request !753 from haotuo/cherry-pick-1671438902
上级
d2e1df49
1ebc07fa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
135 addition
and
0 deletion
+135
-0
musl_src.gni
musl_src.gni
+2
-0
porting/linux/user/crt/x86_64/crti.s
porting/linux/user/crt/x86_64/crti.s
+11
-0
porting/linux/user/src/linux/cache.c
porting/linux/user/src/linux/cache.c
+65
-0
porting/linux/user/src/sched/sched_getcpu.c
porting/linux/user/src/sched/sched_getcpu.c
+57
-0
未找到文件。
musl_src.gni
浏览文件 @
84dbdbb9
...
...
@@ -2131,6 +2131,8 @@ musl_src_porting_file = [
"src/time/gettimeofday.c",
"src/time/time.c",
"src/stdio/__fdopen.c",
"src/linux/cache.c",
"src/sched/sched_getcpu.c",
]
musl_inc_hook_files = [
...
...
porting/linux/user/crt/x86_64/crti.s
0 → 100644
浏览文件 @
84dbdbb9
.
include
"
crtbrand.s
"
.
section
.
init
.
global
_init
_init
:
push
%
rax
.
section
.
fini
.
global
_fini
_fini
:
push
%
rax
porting/linux/user/src/linux/cache.c
0 → 100644
浏览文件 @
84dbdbb9
/* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <errno.h>
#include "syscall.h"
#include "atomic.h"
#ifdef SYS_cacheflush
int
_flush_cache
(
void
*
addr
,
int
len
,
int
op
)
{
return
syscall
(
SYS_cacheflush
,
addr
,
len
,
op
);
}
weak_alias
(
_flush_cache
,
cacheflush
);
#endif
#ifdef SYS_cachectl
int
__cachectl
(
void
*
addr
,
int
len
,
int
op
)
{
return
syscall
(
SYS_cachectl
,
addr
,
len
,
op
);
}
weak_alias
(
__cachectl
,
cachectl
);
#endif
#ifdef SYS_riscv_flush_icache
#define VDSO_FLUSH_ICACHE_SYM "__vdso_flush_icache"
#define VDSO_FLUSH_ICACHE_VER "LINUX_4.5"
static
void
*
volatile
vdso_func
;
static
int
flush_icache_init
(
void
*
start
,
void
*
end
,
unsigned
long
int
flags
)
{
__get_vdso_info
();
void
*
p
=
__get_vdso_addr
(
VDSO_FLUSH_ICACHE_VER
,
VDSO_FLUSH_ICACHE_SYM
);
int
(
*
f
)(
void
*
,
void
*
,
unsigned
long
int
)
=
(
int
(
*
)(
void
*
,
void
*
,
unsigned
long
int
))
p
;
a_cas_p
(
&
vdso_func
,
(
void
*
)
flush_icache_init
,
p
);
return
f
?
f
(
start
,
end
,
flags
)
:
-
ENOSYS
;
}
static
void
*
volatile
vdso_func
=
(
void
*
)
flush_icache_init
;
int
__riscv_flush_icache
(
void
*
start
,
void
*
end
,
unsigned
long
int
flags
)
{
int
(
*
f
)(
void
*
,
void
*
,
unsigned
long
int
)
=
(
int
(
*
)(
void
*
,
void
*
,
unsigned
long
int
))
vdso_func
;
if
(
f
)
{
int
r
=
f
(
start
,
end
,
flags
);
if
(
!
r
)
return
r
;
if
(
r
!=
-
ENOSYS
)
return
__syscall_ret
(
r
);
}
}
weak_alias
(
__riscv_flush_icache
,
riscv_flush_icache
);
#endif
porting/linux/user/src/sched/sched_getcpu.c
0 → 100644
浏览文件 @
84dbdbb9
/* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include "syscall.h"
#include "atomic.h"
#ifdef VDSO_GETCPU_SYM
static
void
*
volatile
vdso_func
;
typedef
long
(
*
getcpu_f
)(
unsigned
*
,
unsigned
*
,
void
*
);
static
long
getcpu_init
(
unsigned
*
cpu
,
unsigned
*
node
,
void
*
unused
)
{
__get_vdso_info
();
void
*
p
=
__get_vdso_addr
(
VDSO_GETCPU_VER
,
VDSO_GETCPU_SYM
);
getcpu_f
f
=
(
getcpu_f
)
p
;
a_cas_p
(
&
vdso_func
,
(
void
*
)
getcpu_init
,
p
);
return
f
?
f
(
cpu
,
node
,
unused
)
:
-
ENOSYS
;
}
static
void
*
volatile
vdso_func
=
(
void
*
)
getcpu_init
;
#endif
int
sched_getcpu
(
void
)
{
int
r
;
unsigned
cpu
;
#ifdef VDSO_GETCPU_SYM
getcpu_f
f
=
(
getcpu_f
)
vdso_func
;
if
(
f
)
{
r
=
f
(
&
cpu
,
0
,
0
);
if
(
!
r
)
return
cpu
;
if
(
r
!=
-
ENOSYS
)
return
__syscall_ret
(
r
);
}
#endif
r
=
__syscall
(
SYS_getcpu
,
&
cpu
,
0
,
0
);
if
(
!
r
)
return
cpu
;
return
__syscall_ret
(
r
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录