]>
Commit | Line | Data |
---|---|---|
e0a65194 RS |
1 | #! /usr/bin/env perl |
2 | # Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. | |
3 | # | |
4 | # Licensed under the OpenSSL license (the "License"). You may not use | |
5 | # this file except in compliance with the License. You can obtain a copy | |
6 | # in the file LICENSE in the source distribution or at | |
7 | # https://www.openssl.org/source/license.html | |
4c048211 | 8 | |
acf15259 | 9 | $output=pop; |
4c048211 | 10 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
cfe1d992 | 11 | open OUT,"| \"$^X\" \"${dir}../crypto/perlasm/x86_64-xlate.pl\" \"$output\""; |
46bf83f0 | 12 | *STDOUT=*OUT; |
4c048211 AP |
13 | push(@INC,"${dir}."); |
14 | ||
15 | require "uplink-common.pl"; | |
16 | ||
17 | $prefix="_lazy"; | |
18 | ||
19 | print <<___; | |
20 | .text | |
21 | .extern OPENSSL_Uplink | |
be01f79d | 22 | .globl OPENSSL_UplinkTable |
4c048211 AP |
23 | ___ |
24 | for ($i=1;$i<=$N;$i++) { | |
25 | print <<___; | |
26 | .type $prefix${i},\@abi-omnipotent | |
27 | .align 16 | |
28 | $prefix${i}: | |
29 | .byte 0x48,0x83,0xEC,0x28 # sub rsp,40 | |
30 | mov %rcx,48(%rsp) | |
31 | mov %rdx,56(%rsp) | |
32 | mov %r8,64(%rsp) | |
33 | mov %r9,72(%rsp) | |
34 | lea OPENSSL_UplinkTable(%rip),%rcx | |
35 | mov \$$i,%rdx | |
36 | call OPENSSL_Uplink | |
37 | mov 48(%rsp),%rcx | |
38 | mov 56(%rsp),%rdx | |
39 | mov 64(%rsp),%r8 | |
40 | mov 72(%rsp),%r9 | |
4c048211 | 41 | lea OPENSSL_UplinkTable(%rip),%rax |
be01f79d | 42 | add \$40,%rsp |
4c048211 AP |
43 | jmp *8*$i(%rax) |
44 | $prefix${i}_end: | |
45 | .size $prefix${i},.-$prefix${i} | |
46 | ___ | |
47 | } | |
48 | print <<___; | |
49 | .data | |
4c048211 AP |
50 | OPENSSL_UplinkTable: |
51 | .quad $N | |
52 | ___ | |
53 | for ($i=1;$i<=$N;$i++) { print " .quad $prefix$i\n"; } | |
54 | print <<___; | |
be01f79d AP |
55 | .section .pdata,"r" |
56 | .align 4 | |
4c048211 AP |
57 | ___ |
58 | for ($i=1;$i<=$N;$i++) { | |
59 | print <<___; | |
be01f79d | 60 | .rva $prefix${i},$prefix${i}_end,${prefix}_unwind_info |
4c048211 AP |
61 | ___ |
62 | } | |
63 | print <<___; | |
be01f79d AP |
64 | .section .xdata,"r" |
65 | .align 8 | |
4c048211 AP |
66 | ${prefix}_unwind_info: |
67 | .byte 0x01,0x04,0x01,0x00 | |
68 | .byte 0x04,0x42,0x00,0x00 | |
69 | ___ | |
be01f79d AP |
70 | |
71 | close STDOUT; |