Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c32fcca6
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看板
提交
c32fcca6
编写于
7月 01, 2010
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SPARCv9 assembler pack: refine CPU detection on Linux, fix for "unaligned
opcodes detected in executable segment" error.
上级
9674de7d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
88 addition
and
3 deletion
+88
-3
crypto/modes/asm/ghash-sparcv9.pl
crypto/modes/asm/ghash-sparcv9.pl
+1
-0
crypto/sha/asm/sha1-sparcv9.pl
crypto/sha/asm/sha1-sparcv9.pl
+1
-0
crypto/sha/asm/sha1-sparcv9a.pl
crypto/sha/asm/sha1-sparcv9a.pl
+1
-0
crypto/sha/asm/sha512-sparcv9.pl
crypto/sha/asm/sha512-sparcv9.pl
+1
-0
crypto/sparccpuid.S
crypto/sparccpuid.S
+21
-1
crypto/sparcv9cap.c
crypto/sparcv9cap.c
+63
-2
未找到文件。
crypto/modes/asm/ghash-sparcv9.pl
浏览文件 @
c32fcca6
...
...
@@ -315,6 +315,7 @@ gcm_gmult_4bit:
.type gcm_gmult_4bit,#function
.size gcm_gmult_4bit,(.-gcm_gmult_4bit)
.asciz "GHASH for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
.align 4
___
$code
=~
s/\`([^\`]*)\`/eval $1/g
em
;
...
...
crypto/sha/asm/sha1-sparcv9.pl
浏览文件 @
c32fcca6
...
...
@@ -276,6 +276,7 @@ $code.=<<___;
.type sha1_block_data_order,#function
.size sha1_block_data_order,(.-sha1_block_data_order)
.asciz "SHA1 block transform for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
.align 4
___
$code
=~
s/\`([^\`]*)\`/eval $1/g
em
;
...
...
crypto/sha/asm/sha1-sparcv9a.pl
浏览文件 @
c32fcca6
...
...
@@ -539,6 +539,7 @@ $code.=<<___;
.type sha1_block_data_order,#function
.size sha1_block_data_order,(.-sha1_block_data_order)
.asciz "SHA1 block transform for SPARCv9a, CRYPTOGAMS by <appro\@openssl.org>"
.align 4
___
# Purpose of these subroutines is to explicitly encode VIS instructions,
...
...
crypto/sha/asm/sha512-sparcv9.pl
浏览文件 @
c32fcca6
...
...
@@ -586,6 +586,7 @@ $code.=<<___;
.type sha${label}_block_data_order,#function
.size sha${label}_block_data_order,(.-sha${label}_block_data_order)
.asciz "SHA${label} block transform for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
.align 4
___
$code
=~
s/\`([^\`]*)\`/eval $1/g
em
;
...
...
crypto/sparccpuid.S
浏览文件 @
c32fcca6
...
...
@@ -225,13 +225,33 @@ _sparcv9_rdtick:
xor
%
o0
,%
o0
,%
o0
.
word
0x91410000
!
rd
%
tick
,%
o0
retl
.
word
0x93323020
!
srlx
%
o
2
,
32
,%
o1
.
word
0x93323020
!
srlx
%
o
0
,
32
,%
o1
.
notick
:
retl
xor
%
o1
,%
o1
,%
o1
.
type
_sparcv9_rdtick
,#
function
.
size
_sparcv9_rdtick
,.-
_sparcv9_rdtick
.
global
_sparcv9_rdwrasi
.
align
8
_sparcv9_rdwrasi
:
.
word
0x9340c000
!
rd
%
asi
,%
o1
.
word
0x87820000
!
wr
%
o0
,%
g0
,%
asi
retl
mov
%
o1
,%
o0
.
type
_sparcv9_rdwrasi
,#
function
.
size
_sparcv9_rdwrasi
,.-
_sparcv9_rdwrasi
.
global
_sparcv9_vis1_probe
.
align
8
_sparcv9_vis1_probe
:
.
word
0x81b00c20
!
fzeros
%f0
.
word
0xc19ba002
+
BIAS
!
ldda
[%
sp
+
BIAS
+
2
]%
asi
,
%f0
retl
nop
.
type
_sparcv9_vis1_probe
,#
function
.
size
_sparcv9_vis1_probe
,.-
_sparcv9_vis1_probe
.
global
OPENSSL_cleanse
.
align
32
OPENSSL_cleanse
:
...
...
crypto/sparcv9cap.c
浏览文件 @
c32fcca6
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include <signal.h>
#include <sys/time.h>
#include <openssl/bn.h>
...
...
@@ -9,6 +11,7 @@
#define SPARCV9_VIS1 (1<<2)
#define SPARCV9_VIS2 (1<<3)
/* reserved */
#define SPARCV9_FMADD (1<<4)
/* reserved for SPARC64 V */
static
int
OPENSSL_sparcv9cap_P
=
SPARCV9_TICK_PRIVILEGED
;
int
bn_mul_mont
(
BN_ULONG
*
rp
,
const
BN_ULONG
*
ap
,
const
BN_ULONG
*
bp
,
const
BN_ULONG
*
np
,
const
BN_ULONG
*
n0
,
int
num
)
...
...
@@ -23,10 +26,12 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_U
return
bn_mul_mont_int
(
rp
,
ap
,
bp
,
np
,
n0
,
num
);
}
unsigned
long
_sparcv9_rdtick
(
void
);
unsigned
long
_sparcv9_rdwrasi
(
unsigned
long
);
void
_sparcv9_vis1_probe
(
void
);
unsigned
long
OPENSSL_rdtsc
(
void
)
{
unsigned
long
_sparcv9_rdtick
(
void
);
if
(
OPENSSL_sparcv9cap_P
&
SPARCV9_TICK_PRIVILEGED
)
#if defined(__sun) && defined(__SVR4)
return
gethrtime
();
...
...
@@ -137,9 +142,16 @@ void OPENSSL_cpuid_setup(void)
#else
static
sigjmp_buf
common_jmp
;
static
void
common_handler
(
int
sig
)
{
siglongjmp
(
common_jmp
,
sig
);
}
void
OPENSSL_cpuid_setup
(
void
)
{
char
*
e
;
struct
sigaction
common_act
,
ill_oact
,
bus_oact
;
sigset_t
all_masked
,
oset
;
unsigned
long
oasi
;
int
sig
;
if
((
e
=
getenv
(
"OPENSSL_sparcv9cap"
)))
{
...
...
@@ -149,6 +161,55 @@ void OPENSSL_cpuid_setup(void)
/* For now we assume that the rest supports UltraSPARC-I* only */
OPENSSL_sparcv9cap_P
|=
SPARCV9_PREFER_FPU
|
SPARCV9_VIS1
;
sigfillset
(
&
all_masked
);
sigdelset
(
&
all_masked
,
SIGILL
);
sigdelset
(
&
all_masked
,
SIGTRAP
);
#ifdef SIGEMT
sigdelset
(
&
all_masked
,
SIGEMT
);
#endif
sigdelset
(
&
all_masked
,
SIGFPE
);
sigdelset
(
&
all_masked
,
SIGBUS
);
sigdelset
(
&
all_masked
,
SIGSEGV
);
sigprocmask
(
SIG_SETMASK
,
&
all_masked
,
&
oset
);
memset
(
&
common_act
,
0
,
sizeof
(
common_act
));
common_act
.
sa_handler
=
common_handler
;
common_act
.
sa_mask
=
all_masked
;
sigaction
(
SIGILL
,
&
common_act
,
&
ill_oact
);
sigaction
(
SIGBUS
,
&
common_act
,
&
bus_oact
);
/* T1 fails 16-bit ldda */
oasi
=
_sparcv9_rdwrasi
(
0xD2
);
/* ASI_FL16_P */
if
((
sig
=
sigsetjmp
(
common_jmp
,
0
))
==
0
)
{
_sparcv9_vis1_probe
();
OPENSSL_sparcv9cap_P
|=
SPARCV9_VIS1
;
}
else
if
(
sig
==
SIGBUS
)
/* T1 fails 16-bit ldda */
{
OPENSSL_sparcv9cap_P
&=
~
SPARCV9_PREFER_FPU
;
}
else
{
OPENSSL_sparcv9cap_P
&=
~
SPARCV9_VIS1
;
}
_sparcv9_rdwrasi
(
oasi
);
sigaction
(
SIGBUS
,
&
bus_oact
,
NULL
);
sigaction
(
SIGILL
,
&
ill_oact
,
NULL
);
sigaction
(
SIGILL
,
&
common_act
,
&
ill_oact
);
if
(
sigsetjmp
(
common_jmp
,
0
)
==
0
)
{
_sparcv9_rdtick
();
OPENSSL_sparcv9cap_P
&=
~
SPARCV9_TICK_PRIVILEGED
;
}
else
{
OPENSSL_sparcv9cap_P
|=
SPARCV9_TICK_PRIVILEGED
;
}
sigaction
(
SIGILL
,
&
ill_oact
,
NULL
);
sigprocmask
(
SIG_SETMASK
,
&
oset
,
NULL
);
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录