Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
beef7145
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看板
提交
beef7145
编写于
12月 27, 2009
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Switch to new uplink assembler.
上级
d741cf22
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
210 deletion
+16
-210
Configure
Configure
+1
-1
crypto/Makefile
crypto/Makefile
+2
-2
ms/do_win64a.bat
ms/do_win64a.bat
+12
-2
ms/do_win64i.bat
ms/do_win64i.bat
+1
-1
ms/uplink.pl
ms/uplink.pl
+0
-204
未找到文件。
Configure
浏览文件 @
beef7145
...
...
@@ -1294,7 +1294,7 @@ if (!$IsMK1MF)
}
}
$cpuid_obj.=" uplink.o uplink-
cof
.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
$cpuid_obj.=" uplink.o uplink-
x86
.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
#
# Platform fix-ups
...
...
crypto/Makefile
浏览文件 @
beef7145
...
...
@@ -67,8 +67,8 @@ applink.o: $(TOP)/ms/applink.c
uplink.o
:
$(TOP)/ms/uplink.c applink.o
$(CC)
$(CFLAGS)
-c
-o
$@
$(TOP)
/ms/uplink.c
uplink-
cof.s
:
$(TOP)/ms/uplink
.pl
$(PERL)
$(TOP)
/ms/uplink
.pl coff
>
$@
uplink-
x86.s
:
$(TOP)/ms/uplink-x86
.pl
$(PERL)
$(TOP)
/ms/uplink
-x86.pl
$(PERLASM_SCHEME)
>
$@
x86_64cpuid.s
:
x86_64cpuid.pl
$(PERL)
x86_64cpuid.pl
$(PERLASM_SCHEME)
>
$@
...
...
ms/do_win64a.bat
浏览文件 @
beef7145
perl
util
\mkfiles.pl
>
MINFO
perl
ms
\uplink.pl
win64a
>
ms
\uptable.asm
cmd
/c
"nasm -f win64 -v"
>
NUL
:
2
>&
1
if
%errorlevel%
neq
0
goto
ml64
perl
ms
\uplink
-x
86
_64.pl
nasm
>
ms
\uptable.asm
nasm
-f
win64
-o
ms
\uptable.obj
ms
\uptable.asm
goto
proceed
:ml
64
perl
ms
\uplink
-x
86
_64.pl
masm
>
ms
\uptable.asm
ml64
-c -Foms
\uptable.obj
ms
\uptable.asm
:proceed
perl
util
\mk1mf.pl
no
-asm
VC
-WIN
64
A
>
ms
\nt.mak
perl
util
\mk1mf.pl
dll
no
-asm
VC
-WIN
64
A
>
ms
\ntdll.mak
...
...
ms/do_win64i.bat
浏览文件 @
beef7145
perl
util
\mkfiles.pl
>
MINFO
perl
ms
\uplink
.pl
win64i
>
ms
\uptable.asm
perl
ms
\uplink
-ia
64
.pl
>
ms
\uptable.asm
ias
-o
ms
\uptable.obj
ms
\uptable.asm
perl
util
\mk1mf.pl
no
-asm
VC
-WIN
64
I
>
ms
\nt.mak
perl
util
\mk1mf.pl
dll
no
-asm
VC
-WIN
64
I
>
ms
\ntdll.mak
...
...
ms/uplink.pl
已删除
100755 → 0
浏览文件 @
d741cf22
#!/usr/bin/env perl
#
# For Microsoft CL this is implemented as inline assembler. So that
# even though this script can generate even Win32 code, we'll be
# using it primarily to generate Win64 modules. Both IA-64 and AMD64
# are supported...
# pull APPLINK_MAX value from applink.c...
$applink_c
=
$
0
;
$applink_c
=~
s|[^/\\]+$||g
;
$applink_c
.=
"
applink.c
";
open
(
INPUT
,
$applink_c
)
||
die
"
can't open
$applink_c
: $!
";
@max
=
grep
{
/APPLINK_MAX\s+(\d+)/
}
<
INPUT
>
;
close
(
INPUT
);
(
$#max
==
0
)
or
die
"
can't find APPLINK_MAX in
$applink_c
";
$max
[
0
]
=~
/APPLINK_MAX\s+(\d+)/
;
$N
=
$
1
;
# number of entries in OPENSSL_UplinkTable not including
# OPENSSL_UplinkTable[0], which contains this value...
# Idea is to fill the OPENSSL_UplinkTable with pointers to stubs
# which invoke 'void OPENSSL_Uplink (ULONG_PTR *table,int index)';
# and then dereference themselves. Latter shall result in endless
# loop *unless* OPENSSL_Uplink does not replace 'table[index]' with
# something else, e.g. as 'table[index]=unimplemented;'...
$arg
=
shift
;
#( defined shift || open STDOUT,">$arg" ) || die "can't open $arg: $!";
if
(
$arg
=~
/win32n/
)
{
ia32nasm
();
}
elsif
(
$arg
=~
/win32/
)
{
ia32masm
();
}
elsif
(
$arg
=~
/coff/
)
{
ia32gas
();
}
elsif
(
$arg
=~
/win64i/
or
$arg
=~
/ia64/
)
{
ia64ias
();
}
elsif
(
$arg
=~
/win64a/
or
$arg
=~
/amd64/
)
{
amd64masm
();
}
else
{
die
"
nonsense
$arg
";
}
sub
ia32gas
()
{
print
<<___;
.text
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
<<___;
.def .Lazy$i; .scl 3; .type 32; .endef
.align 4
.Lazy$i:
pushl \$$i
pushl \$_OPENSSL_UplinkTable
call _OPENSSL_Uplink
addl \$8,%esp
jmp *(_OPENSSL_UplinkTable+4*$i)
___
}
print
<<___;
.data
.align 4
.globl _OPENSSL_UplinkTable
_OPENSSL_UplinkTable:
.long $N
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
"
.long .Lazy
$i
\n
";
}
}
sub
ia32masm
()
{
print
<<___;
.386P
.model FLAT
_DATA SEGMENT
PUBLIC _OPENSSL_UplinkTable
_OPENSSL_UplinkTable DD $N ; amount of following entries
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
"
DD FLAT:
\$
lazy
$i
\n
";
}
print
<<___;
_DATA ENDS
_TEXT SEGMENT
EXTRN _OPENSSL_Uplink:NEAR
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
<<___;
ALIGN 4
\$lazy$i PROC NEAR
push $i
push OFFSET FLAT:_OPENSSL_UplinkTable
call _OPENSSL_Uplink
add esp,8
jmp DWORD PTR _OPENSSL_UplinkTable+4*$i
\$lazy$i ENDP
___
}
print
<<___;
ALIGN 4
_TEXT ENDS
END
___
}
sub
ia32nasm
()
{
print
<<___;
SEGMENT .data
GLOBAL _OPENSSL_UplinkTable
_OPENSSL_UplinkTable DD $N ; amount of following entries
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
"
DD
\$
lazy
$i
\n
";
}
print
<<___;
SEGMENT .text
EXTERN _OPENSSL_Uplink
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
<<___;
ALIGN 4
\$lazy$i:
push $i
push _OPENSSL_UplinkTable
call _OPENSSL_Uplink
add esp,8
jmp [_OPENSSL_UplinkTable+4*$i]
___
}
print
<<___;
ALIGN 4
END
___
}
sub
ia64ias
()
{
local
$V
=
8
;
# max number of args uplink functions may accept...
print
<<___;
.data
.global OPENSSL_UplinkTable#
OPENSSL_UplinkTable: data8 $N // amount of following entries
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
"
data8
\@
fptr(lazy
$i
#)
\n
";
}
print
<<___;
.size OPENSSL_UplinkTable,.-OPENSSL_UplinkTable#
.text
.global OPENSSL_Uplink#
.type OPENSSL_Uplink#,\@function
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
<<___;
.proc lazy$i
lazy$i:
{ .mii; alloc loc0=ar.pfs,$V,3,2,0
mov loc1=b0
addl loc2=\@ltoff(OPENSSL_UplinkTable#),gp };;
{ .mmi; ld8 out0=[loc2]
mov out1=$i };;
{ .mib; adds loc2=8*$i,out0
br.call.sptk.many b0=OPENSSL_Uplink# };;
{ .mmi; ld8 r31=[loc2];;
ld8 r30=[r31],8 };;
{ .mii; ld8 gp=[r31]
mov b6=r30
mov b0=loc1 };;
{ .mib; mov ar.pfs=loc0
br.many b6 };;
.endp lazy$i#
___
}
}
sub
amd64masm
()
{
print
<<___;
_DATA SEGMENT
PUBLIC OPENSSL_UplinkTable
OPENSSL_UplinkTable DQ $N
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
"
DQ
\$
lazy
$i
\n
";
}
print
<<___;
_DATA ENDS
_TEXT SEGMENT
EXTERN OPENSSL_Uplink:PROC
___
for
(
$i
=
1
;
$i
<=
$N
;
$i
++
)
{
print
<<___;
ALIGN 4
\$lazy$i PROC
push r9
push r8
push rdx
push rcx
sub rsp,40
lea rcx,OFFSET OPENSSL_UplinkTable
mov rdx,$i
call OPENSSL_Uplink
add rsp,40
pop rcx
pop rdx
pop r8
pop r9
jmp QWORD PTR OPENSSL_UplinkTable+8*$i
\$lazy$i ENDP
___
}
print
<<___;
_TEXT ENDS
END
___
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录