Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
67d8487b
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67d8487b
编写于
5月 24, 2011
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
e_padlock.c: last x86_64 commit didn't work with some optimizers.
上级
760d2551
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
13 deletion
+15
-13
engines/e_padlock.c
engines/e_padlock.c
+15
-13
未找到文件。
engines/e_padlock.c
浏览文件 @
67d8487b
...
@@ -453,32 +453,33 @@ padlock_available(void)
...
@@ -453,32 +453,33 @@ padlock_available(void)
{
{
char
vendor_string
[
16
];
char
vendor_string
[
16
];
unsigned
int
eax
,
edx
;
unsigned
int
eax
,
edx
;
size_t
scratch
;
/* Are we running on the Centaur (VIA) CPU? */
/* Are we running on the Centaur (VIA) CPU? */
eax
=
0x00000000
;
eax
=
0x00000000
;
vendor_string
[
12
]
=
0
;
vendor_string
[
12
]
=
0
;
asm
volatile
(
asm
volatile
(
"
pushq %%rbx
\n
"
"
movq %%rbx,%1
\n
"
"cpuid
\n
"
"cpuid
\n
"
"movl %%ebx,(%
1
)
\n
"
"movl %%ebx,(%
2
)
\n
"
"movl %%edx,4(%
1
)
\n
"
"movl %%edx,4(%
2
)
\n
"
"movl %%ecx,8(%
1
)
\n
"
"movl %%ecx,8(%
2
)
\n
"
"
popq
%%rbx"
"
movq %1,
%%rbx"
:
"+a"
(
eax
)
:
"r"
(
vendor_string
)
:
"rcx"
,
"rdx"
);
:
"+a"
(
eax
)
,
"=&r"
(
scratch
)
:
"r"
(
vendor_string
)
:
"rcx"
,
"rdx"
);
if
(
strcmp
(
vendor_string
,
"CentaurHauls"
)
!=
0
)
if
(
strcmp
(
vendor_string
,
"CentaurHauls"
)
!=
0
)
return
0
;
return
0
;
/* Check for Centaur Extended Feature Flags presence */
/* Check for Centaur Extended Feature Flags presence */
eax
=
0xC0000000
;
eax
=
0xC0000000
;
asm
volatile
(
"
pushq %%rbx; cpuid; popq
%%rbx"
asm
volatile
(
"
movq %%rbx,%1; cpuid; movq %1,
%%rbx"
:
"+a"
(
eax
)
:
:
"rcx"
,
"rdx"
);
:
"+a"
(
eax
)
,
"=&r"
(
scratch
)
:
:
"rcx"
,
"rdx"
);
if
(
eax
<
0xC0000001
)
if
(
eax
<
0xC0000001
)
return
0
;
return
0
;
/* Read the Centaur Extended Feature Flags */
/* Read the Centaur Extended Feature Flags */
eax
=
0xC0000001
;
eax
=
0xC0000001
;
asm
volatile
(
"
pushq %%rbx; cpuid; popq
%%rbx"
asm
volatile
(
"
movq %%rbx,%2; cpuid; movq %2,
%%rbx"
:
"+a"
(
eax
),
"=d"
(
edx
)
:
:
"rcx"
);
:
"+a"
(
eax
),
"=d"
(
edx
)
,
"=&r"
(
scratch
)
:
:
"rcx"
);
/* Fill up some flags */
/* Fill up some flags */
padlock_use_ace
=
((
edx
&
(
0x3
<<
6
))
==
(
0x3
<<
6
));
padlock_use_ace
=
((
edx
&
(
0x3
<<
6
))
==
(
0x3
<<
6
));
...
@@ -534,12 +535,13 @@ static inline void *name(size_t cnt, \
...
@@ -534,12 +535,13 @@ static inline void *name(size_t cnt, \
struct padlock_cipher_data *cdata, \
struct padlock_cipher_data *cdata, \
void *out, const void *inp) \
void *out, const void *inp) \
{ void *iv; \
{ void *iv; \
asm volatile ( "pushq %%rbx\n" \
size_t scratch; \
asm volatile ( "movq %%rbx,%4\n" \
" leaq 16(%0),%%rdx\n" \
" leaq 16(%0),%%rdx\n" \
" leaq 32(%0),%%rbx\n" \
" leaq 32(%0),%%rbx\n" \
rep_xcrypt "\n" \
rep_xcrypt "\n" \
"
popq %%rbx"
\
"
movq %%rbx,%4"
\
: "=a"(iv), "=c"(cnt), "=D"(out), "=S"(inp) \
: "=a"(iv), "=c"(cnt), "=D"(out), "=S"(inp)
, "=&r"(scratch)
\
: "0"(cdata), "1"(cnt), "2"(out), "3"(inp) \
: "0"(cdata), "1"(cnt), "2"(out), "3"(inp) \
: "rdx", "cc", "memory"); \
: "rdx", "cc", "memory"); \
return iv; \
return iv; \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录