diff options
author | jsing <> | 2014-04-30 13:40:02 +0000 |
---|---|---|
committer | jsing <> | 2014-04-30 13:40:02 +0000 |
commit | b8e088b53dabff9eeb33721c6fa4e60831bf9797 (patch) | |
tree | 75932b21b0fece851ece3d9ad0c80de6a9ff65e2 /src | |
parent | 11a8133c7b915dcd4af9f7cf1c70b1179eeddf14 (diff) | |
download | openbsd-b8e088b53dabff9eeb33721c6fa4e60831bf9797.tar.gz openbsd-b8e088b53dabff9eeb33721c6fa4e60831bf9797.tar.bz2 openbsd-b8e088b53dabff9eeb33721c6fa4e60831bf9797.zip |
First pass at removing win64 support from the assembly generating Perl
scripts. We certainly do not need an identical copy of the win64
exception handler in each script (surely one copy would be sufficient).
ok miod@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/bn/asm/modexp512-x86_64.pl | 109 | ||||
-rwxr-xr-x | src/lib/libcrypto/bn/asm/x86_64-mont.pl | 177 | ||||
-rw-r--r-- | src/lib/libcrypto/camellia/asm/cmll-x86_64.pl | 216 | ||||
-rwxr-xr-x | src/lib/libcrypto/md5/asm/md5-x86_64.pl | 106 | ||||
-rw-r--r-- | src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl | 107 | ||||
-rwxr-xr-x | src/lib/libcrypto/rc4/asm/rc4-x86_64.pl | 134 | ||||
-rwxr-xr-x | src/lib/libcrypto/sha/asm/sha512-x86_64.pl | 109 | ||||
-rw-r--r-- | src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl | 109 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/asm/modexp512-x86_64.pl | 109 | ||||
-rwxr-xr-x | src/lib/libssl/src/crypto/bn/asm/x86_64-mont.pl | 177 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/camellia/asm/cmll-x86_64.pl | 216 | ||||
-rwxr-xr-x | src/lib/libssl/src/crypto/md5/asm/md5-x86_64.pl | 106 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/rc4/asm/rc4-md5-x86_64.pl | 107 | ||||
-rwxr-xr-x | src/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl | 134 | ||||
-rwxr-xr-x | src/lib/libssl/src/crypto/sha/asm/sha512-x86_64.pl | 109 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/whrlpool/asm/wp-x86_64.pl | 109 |
16 files changed, 2 insertions, 2132 deletions
diff --git a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl index bfd6e97541..4317282835 100644 --- a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl +++ b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl | |||
@@ -61,8 +61,6 @@ $flavour = shift; | |||
61 | $output = shift; | 61 | $output = shift; |
62 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 62 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
63 | 63 | ||
64 | my $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
65 | |||
66 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 64 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
67 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 65 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
68 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 66 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -1374,113 +1372,6 @@ end_main_loop_a3b: | |||
1374 | .size mod_exp_512, . - mod_exp_512 | 1372 | .size mod_exp_512, . - mod_exp_512 |
1375 | ___ | 1373 | ___ |
1376 | 1374 | ||
1377 | if ($win64) { | ||
1378 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
1379 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
1380 | my $rec="%rcx"; | ||
1381 | my $frame="%rdx"; | ||
1382 | my $context="%r8"; | ||
1383 | my $disp="%r9"; | ||
1384 | |||
1385 | $code.=<<___; | ||
1386 | .extern __imp_RtlVirtualUnwind | ||
1387 | .type mod_exp_512_se_handler,\@abi-omnipotent | ||
1388 | .align 16 | ||
1389 | mod_exp_512_se_handler: | ||
1390 | push %rsi | ||
1391 | push %rdi | ||
1392 | push %rbx | ||
1393 | push %rbp | ||
1394 | push %r12 | ||
1395 | push %r13 | ||
1396 | push %r14 | ||
1397 | push %r15 | ||
1398 | pushfq | ||
1399 | sub \$64,%rsp | ||
1400 | |||
1401 | mov 120($context),%rax # pull context->Rax | ||
1402 | mov 248($context),%rbx # pull context->Rip | ||
1403 | |||
1404 | lea .Lbody(%rip),%r10 | ||
1405 | cmp %r10,%rbx # context->Rip<prologue label | ||
1406 | jb .Lin_prologue | ||
1407 | |||
1408 | mov 152($context),%rax # pull context->Rsp | ||
1409 | |||
1410 | lea .Lepilogue(%rip),%r10 | ||
1411 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
1412 | jae .Lin_prologue | ||
1413 | |||
1414 | mov $rsp_offset(%rax),%rax # pull saved Rsp | ||
1415 | |||
1416 | mov 32(%rax),%rbx | ||
1417 | mov 40(%rax),%rbp | ||
1418 | mov 24(%rax),%r12 | ||
1419 | mov 16(%rax),%r13 | ||
1420 | mov 8(%rax),%r14 | ||
1421 | mov 0(%rax),%r15 | ||
1422 | lea 48(%rax),%rax | ||
1423 | mov %rbx,144($context) # restore context->Rbx | ||
1424 | mov %rbp,160($context) # restore context->Rbp | ||
1425 | mov %r12,216($context) # restore context->R12 | ||
1426 | mov %r13,224($context) # restore context->R13 | ||
1427 | mov %r14,232($context) # restore context->R14 | ||
1428 | mov %r15,240($context) # restore context->R15 | ||
1429 | |||
1430 | .Lin_prologue: | ||
1431 | mov 8(%rax),%rdi | ||
1432 | mov 16(%rax),%rsi | ||
1433 | mov %rax,152($context) # restore context->Rsp | ||
1434 | mov %rsi,168($context) # restore context->Rsi | ||
1435 | mov %rdi,176($context) # restore context->Rdi | ||
1436 | |||
1437 | mov 40($disp),%rdi # disp->ContextRecord | ||
1438 | mov $context,%rsi # context | ||
1439 | mov \$154,%ecx # sizeof(CONTEXT) | ||
1440 | .long 0xa548f3fc # cld; rep movsq | ||
1441 | |||
1442 | mov $disp,%rsi | ||
1443 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
1444 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
1445 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
1446 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
1447 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
1448 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
1449 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
1450 | mov %r10,32(%rsp) # arg5 | ||
1451 | mov %r11,40(%rsp) # arg6 | ||
1452 | mov %r12,48(%rsp) # arg7 | ||
1453 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
1454 | call *__imp_RtlVirtualUnwind(%rip) | ||
1455 | |||
1456 | mov \$1,%eax # ExceptionContinueSearch | ||
1457 | add \$64,%rsp | ||
1458 | popfq | ||
1459 | pop %r15 | ||
1460 | pop %r14 | ||
1461 | pop %r13 | ||
1462 | pop %r12 | ||
1463 | pop %rbp | ||
1464 | pop %rbx | ||
1465 | pop %rdi | ||
1466 | pop %rsi | ||
1467 | ret | ||
1468 | .size mod_exp_512_se_handler,.-mod_exp_512_se_handler | ||
1469 | |||
1470 | .section .pdata | ||
1471 | .align 4 | ||
1472 | .rva .LSEH_begin_mod_exp_512 | ||
1473 | .rva .LSEH_end_mod_exp_512 | ||
1474 | .rva .LSEH_info_mod_exp_512 | ||
1475 | |||
1476 | .section .xdata | ||
1477 | .align 8 | ||
1478 | .LSEH_info_mod_exp_512: | ||
1479 | .byte 9,0,0,0 | ||
1480 | .rva mod_exp_512_se_handler | ||
1481 | ___ | ||
1482 | } | ||
1483 | |||
1484 | sub reg_part { | 1375 | sub reg_part { |
1485 | my ($reg,$conv)=@_; | 1376 | my ($reg,$conv)=@_; |
1486 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } | 1377 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } |
diff --git a/src/lib/libcrypto/bn/asm/x86_64-mont.pl b/src/lib/libcrypto/bn/asm/x86_64-mont.pl index 17fb94c84c..90c717f115 100755 --- a/src/lib/libcrypto/bn/asm/x86_64-mont.pl +++ b/src/lib/libcrypto/bn/asm/x86_64-mont.pl | |||
@@ -33,8 +33,6 @@ $flavour = shift; | |||
33 | $output = shift; | 33 | $output = shift; |
34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
35 | 35 | ||
36 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
37 | |||
38 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 36 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
39 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 37 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
40 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 38 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -1502,180 +1500,5 @@ $code.=<<___; | |||
1502 | .align 16 | 1500 | .align 16 |
1503 | ___ | 1501 | ___ |
1504 | 1502 | ||
1505 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
1506 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
1507 | if ($win64) { | ||
1508 | $rec="%rcx"; | ||
1509 | $frame="%rdx"; | ||
1510 | $context="%r8"; | ||
1511 | $disp="%r9"; | ||
1512 | |||
1513 | $code.=<<___; | ||
1514 | .extern __imp_RtlVirtualUnwind | ||
1515 | .type mul_handler,\@abi-omnipotent | ||
1516 | .align 16 | ||
1517 | mul_handler: | ||
1518 | push %rsi | ||
1519 | push %rdi | ||
1520 | push %rbx | ||
1521 | push %rbp | ||
1522 | push %r12 | ||
1523 | push %r13 | ||
1524 | push %r14 | ||
1525 | push %r15 | ||
1526 | pushfq | ||
1527 | sub \$64,%rsp | ||
1528 | |||
1529 | mov 120($context),%rax # pull context->Rax | ||
1530 | mov 248($context),%rbx # pull context->Rip | ||
1531 | |||
1532 | mov 8($disp),%rsi # disp->ImageBase | ||
1533 | mov 56($disp),%r11 # disp->HandlerData | ||
1534 | |||
1535 | mov 0(%r11),%r10d # HandlerData[0] | ||
1536 | lea (%rsi,%r10),%r10 # end of prologue label | ||
1537 | cmp %r10,%rbx # context->Rip<end of prologue label | ||
1538 | jb .Lcommon_seh_tail | ||
1539 | |||
1540 | mov 152($context),%rax # pull context->Rsp | ||
1541 | |||
1542 | mov 4(%r11),%r10d # HandlerData[1] | ||
1543 | lea (%rsi,%r10),%r10 # epilogue label | ||
1544 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
1545 | jae .Lcommon_seh_tail | ||
1546 | |||
1547 | mov 192($context),%r10 # pull $num | ||
1548 | mov 8(%rax,%r10,8),%rax # pull saved stack pointer | ||
1549 | lea 48(%rax),%rax | ||
1550 | |||
1551 | mov -8(%rax),%rbx | ||
1552 | mov -16(%rax),%rbp | ||
1553 | mov -24(%rax),%r12 | ||
1554 | mov -32(%rax),%r13 | ||
1555 | mov -40(%rax),%r14 | ||
1556 | mov -48(%rax),%r15 | ||
1557 | mov %rbx,144($context) # restore context->Rbx | ||
1558 | mov %rbp,160($context) # restore context->Rbp | ||
1559 | mov %r12,216($context) # restore context->R12 | ||
1560 | mov %r13,224($context) # restore context->R13 | ||
1561 | mov %r14,232($context) # restore context->R14 | ||
1562 | mov %r15,240($context) # restore context->R15 | ||
1563 | |||
1564 | jmp .Lcommon_seh_tail | ||
1565 | .size mul_handler,.-mul_handler | ||
1566 | |||
1567 | .type sqr_handler,\@abi-omnipotent | ||
1568 | .align 16 | ||
1569 | sqr_handler: | ||
1570 | push %rsi | ||
1571 | push %rdi | ||
1572 | push %rbx | ||
1573 | push %rbp | ||
1574 | push %r12 | ||
1575 | push %r13 | ||
1576 | push %r14 | ||
1577 | push %r15 | ||
1578 | pushfq | ||
1579 | sub \$64,%rsp | ||
1580 | |||
1581 | mov 120($context),%rax # pull context->Rax | ||
1582 | mov 248($context),%rbx # pull context->Rip | ||
1583 | |||
1584 | lea .Lsqr4x_body(%rip),%r10 | ||
1585 | cmp %r10,%rbx # context->Rip<.Lsqr_body | ||
1586 | jb .Lcommon_seh_tail | ||
1587 | |||
1588 | mov 152($context),%rax # pull context->Rsp | ||
1589 | |||
1590 | lea .Lsqr4x_epilogue(%rip),%r10 | ||
1591 | cmp %r10,%rbx # context->Rip>=.Lsqr_epilogue | ||
1592 | jae .Lcommon_seh_tail | ||
1593 | |||
1594 | mov 56(%rax),%rax # pull saved stack pointer | ||
1595 | lea 48(%rax),%rax | ||
1596 | |||
1597 | mov -8(%rax),%rbx | ||
1598 | mov -16(%rax),%rbp | ||
1599 | mov -24(%rax),%r12 | ||
1600 | mov -32(%rax),%r13 | ||
1601 | mov -40(%rax),%r14 | ||
1602 | mov -48(%rax),%r15 | ||
1603 | mov %rbx,144($context) # restore context->Rbx | ||
1604 | mov %rbp,160($context) # restore context->Rbp | ||
1605 | mov %r12,216($context) # restore context->R12 | ||
1606 | mov %r13,224($context) # restore context->R13 | ||
1607 | mov %r14,232($context) # restore context->R14 | ||
1608 | mov %r15,240($context) # restore context->R15 | ||
1609 | |||
1610 | .Lcommon_seh_tail: | ||
1611 | mov 8(%rax),%rdi | ||
1612 | mov 16(%rax),%rsi | ||
1613 | mov %rax,152($context) # restore context->Rsp | ||
1614 | mov %rsi,168($context) # restore context->Rsi | ||
1615 | mov %rdi,176($context) # restore context->Rdi | ||
1616 | |||
1617 | mov 40($disp),%rdi # disp->ContextRecord | ||
1618 | mov $context,%rsi # context | ||
1619 | mov \$154,%ecx # sizeof(CONTEXT) | ||
1620 | .long 0xa548f3fc # cld; rep movsq | ||
1621 | |||
1622 | mov $disp,%rsi | ||
1623 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
1624 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
1625 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
1626 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
1627 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
1628 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
1629 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
1630 | mov %r10,32(%rsp) # arg5 | ||
1631 | mov %r11,40(%rsp) # arg6 | ||
1632 | mov %r12,48(%rsp) # arg7 | ||
1633 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
1634 | call *__imp_RtlVirtualUnwind(%rip) | ||
1635 | |||
1636 | mov \$1,%eax # ExceptionContinueSearch | ||
1637 | add \$64,%rsp | ||
1638 | popfq | ||
1639 | pop %r15 | ||
1640 | pop %r14 | ||
1641 | pop %r13 | ||
1642 | pop %r12 | ||
1643 | pop %rbp | ||
1644 | pop %rbx | ||
1645 | pop %rdi | ||
1646 | pop %rsi | ||
1647 | ret | ||
1648 | .size sqr_handler,.-sqr_handler | ||
1649 | |||
1650 | .section .pdata | ||
1651 | .align 4 | ||
1652 | .rva .LSEH_begin_bn_mul_mont | ||
1653 | .rva .LSEH_end_bn_mul_mont | ||
1654 | .rva .LSEH_info_bn_mul_mont | ||
1655 | |||
1656 | .rva .LSEH_begin_bn_mul4x_mont | ||
1657 | .rva .LSEH_end_bn_mul4x_mont | ||
1658 | .rva .LSEH_info_bn_mul4x_mont | ||
1659 | |||
1660 | .rva .LSEH_begin_bn_sqr4x_mont | ||
1661 | .rva .LSEH_end_bn_sqr4x_mont | ||
1662 | .rva .LSEH_info_bn_sqr4x_mont | ||
1663 | |||
1664 | .section .xdata | ||
1665 | .align 8 | ||
1666 | .LSEH_info_bn_mul_mont: | ||
1667 | .byte 9,0,0,0 | ||
1668 | .rva mul_handler | ||
1669 | .rva .Lmul_body,.Lmul_epilogue # HandlerData[] | ||
1670 | .LSEH_info_bn_mul4x_mont: | ||
1671 | .byte 9,0,0,0 | ||
1672 | .rva mul_handler | ||
1673 | .rva .Lmul4x_body,.Lmul4x_epilogue # HandlerData[] | ||
1674 | .LSEH_info_bn_sqr4x_mont: | ||
1675 | .byte 9,0,0,0 | ||
1676 | .rva sqr_handler | ||
1677 | ___ | ||
1678 | } | ||
1679 | |||
1680 | print $code; | 1503 | print $code; |
1681 | close STDOUT; | 1504 | close STDOUT; |
diff --git a/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl b/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl index 9f4b82fa48..a171c654b2 100644 --- a/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl +++ b/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl | |||
@@ -33,8 +33,6 @@ $flavour = shift; | |||
33 | $output = shift; | 33 | $output = shift; |
34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
35 | 35 | ||
36 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
37 | |||
38 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 36 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
39 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 37 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
40 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 38 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -57,7 +55,7 @@ $inp="%r12"; | |||
57 | $out="%r13"; | 55 | $out="%r13"; |
58 | $key="%r14"; | 56 | $key="%r14"; |
59 | $keyend="%r15"; | 57 | $keyend="%r15"; |
60 | $arg0d=$win64?"%ecx":"%edi"; | 58 | $arg0d="%edi"; |
61 | 59 | ||
62 | # const unsigned int Camellia_SBOX[4][256]; | 60 | # const unsigned int Camellia_SBOX[4][256]; |
63 | # Well, sort of... Camellia_SBOX[0][] is interleaved with [1][], | 61 | # Well, sort of... Camellia_SBOX[0][] is interleaved with [1][], |
@@ -864,218 +862,6 @@ Camellia_cbc_encrypt: | |||
864 | ___ | 862 | ___ |
865 | } | 863 | } |
866 | 864 | ||
867 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
868 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
869 | if ($win64) { | ||
870 | $rec="%rcx"; | ||
871 | $frame="%rdx"; | ||
872 | $context="%r8"; | ||
873 | $disp="%r9"; | ||
874 | |||
875 | $code.=<<___; | ||
876 | .extern __imp_RtlVirtualUnwind | ||
877 | .type common_se_handler,\@abi-omnipotent | ||
878 | .align 16 | ||
879 | common_se_handler: | ||
880 | push %rsi | ||
881 | push %rdi | ||
882 | push %rbx | ||
883 | push %rbp | ||
884 | push %r12 | ||
885 | push %r13 | ||
886 | push %r14 | ||
887 | push %r15 | ||
888 | pushfq | ||
889 | lea -64(%rsp),%rsp | ||
890 | |||
891 | mov 120($context),%rax # pull context->Rax | ||
892 | mov 248($context),%rbx # pull context->Rip | ||
893 | |||
894 | mov 8($disp),%rsi # disp->ImageBase | ||
895 | mov 56($disp),%r11 # disp->HandlerData | ||
896 | |||
897 | mov 0(%r11),%r10d # HandlerData[0] | ||
898 | lea (%rsi,%r10),%r10 # prologue label | ||
899 | cmp %r10,%rbx # context->Rip<prologue label | ||
900 | jb .Lin_prologue | ||
901 | |||
902 | mov 152($context),%rax # pull context->Rsp | ||
903 | |||
904 | mov 4(%r11),%r10d # HandlerData[1] | ||
905 | lea (%rsi,%r10),%r10 # epilogue label | ||
906 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
907 | jae .Lin_prologue | ||
908 | |||
909 | lea 40(%rax),%rax | ||
910 | mov -8(%rax),%rbx | ||
911 | mov -16(%rax),%rbp | ||
912 | mov -24(%rax),%r13 | ||
913 | mov -32(%rax),%r14 | ||
914 | mov -40(%rax),%r15 | ||
915 | mov %rbx,144($context) # restore context->Rbx | ||
916 | mov %rbp,160($context) # restore context->Rbp | ||
917 | mov %r13,224($context) # restore context->R13 | ||
918 | mov %r14,232($context) # restore context->R14 | ||
919 | mov %r15,240($context) # restore context->R15 | ||
920 | |||
921 | .Lin_prologue: | ||
922 | mov 8(%rax),%rdi | ||
923 | mov 16(%rax),%rsi | ||
924 | mov %rax,152($context) # restore context->Rsp | ||
925 | mov %rsi,168($context) # restore context->Rsi | ||
926 | mov %rdi,176($context) # restore context->Rdi | ||
927 | |||
928 | jmp .Lcommon_seh_exit | ||
929 | .size common_se_handler,.-common_se_handler | ||
930 | |||
931 | .type cbc_se_handler,\@abi-omnipotent | ||
932 | .align 16 | ||
933 | cbc_se_handler: | ||
934 | push %rsi | ||
935 | push %rdi | ||
936 | push %rbx | ||
937 | push %rbp | ||
938 | push %r12 | ||
939 | push %r13 | ||
940 | push %r14 | ||
941 | push %r15 | ||
942 | pushfq | ||
943 | lea -64(%rsp),%rsp | ||
944 | |||
945 | mov 120($context),%rax # pull context->Rax | ||
946 | mov 248($context),%rbx # pull context->Rip | ||
947 | |||
948 | lea .Lcbc_prologue(%rip),%r10 | ||
949 | cmp %r10,%rbx # context->Rip<.Lcbc_prologue | ||
950 | jb .Lin_cbc_prologue | ||
951 | |||
952 | lea .Lcbc_body(%rip),%r10 | ||
953 | cmp %r10,%rbx # context->Rip<.Lcbc_body | ||
954 | jb .Lin_cbc_frame_setup | ||
955 | |||
956 | mov 152($context),%rax # pull context->Rsp | ||
957 | |||
958 | lea .Lcbc_abort(%rip),%r10 | ||
959 | cmp %r10,%rbx # context->Rip>=.Lcbc_abort | ||
960 | jae .Lin_cbc_prologue | ||
961 | |||
962 | # handle pushf/popf in Camellia_cbc_encrypt | ||
963 | lea .Lcbc_enc_pushf(%rip),%r10 | ||
964 | cmp %r10,%rbx # context->Rip<=.Lcbc_enc_pushf | ||
965 | jbe .Lin_cbc_no_flag | ||
966 | lea 8(%rax),%rax | ||
967 | lea .Lcbc_enc_popf(%rip),%r10 | ||
968 | cmp %r10,%rbx # context->Rip<.Lcbc_enc_popf | ||
969 | jb .Lin_cbc_no_flag | ||
970 | lea -8(%rax),%rax | ||
971 | lea .Lcbc_dec_pushf(%rip),%r10 | ||
972 | cmp %r10,%rbx # context->Rip<=.Lcbc_dec_pushf | ||
973 | jbe .Lin_cbc_no_flag | ||
974 | lea 8(%rax),%rax | ||
975 | lea .Lcbc_dec_popf(%rip),%r10 | ||
976 | cmp %r10,%rbx # context->Rip<.Lcbc_dec_popf | ||
977 | jb .Lin_cbc_no_flag | ||
978 | lea -8(%rax),%rax | ||
979 | |||
980 | .Lin_cbc_no_flag: | ||
981 | mov 48(%rax),%rax # $_rsp | ||
982 | lea 48(%rax),%rax | ||
983 | |||
984 | .Lin_cbc_frame_setup: | ||
985 | mov -8(%rax),%rbx | ||
986 | mov -16(%rax),%rbp | ||
987 | mov -24(%rax),%r12 | ||
988 | mov -32(%rax),%r13 | ||
989 | mov -40(%rax),%r14 | ||
990 | mov -48(%rax),%r15 | ||
991 | mov %rbx,144($context) # restore context->Rbx | ||
992 | mov %rbp,160($context) # restore context->Rbp | ||
993 | mov %r12,216($context) # restore context->R12 | ||
994 | mov %r13,224($context) # restore context->R13 | ||
995 | mov %r14,232($context) # restore context->R14 | ||
996 | mov %r15,240($context) # restore context->R15 | ||
997 | |||
998 | .Lin_cbc_prologue: | ||
999 | mov 8(%rax),%rdi | ||
1000 | mov 16(%rax),%rsi | ||
1001 | mov %rax,152($context) # restore context->Rsp | ||
1002 | mov %rsi,168($context) # restore context->Rsi | ||
1003 | mov %rdi,176($context) # restore context->Rdi | ||
1004 | |||
1005 | .align 4 | ||
1006 | .Lcommon_seh_exit: | ||
1007 | |||
1008 | mov 40($disp),%rdi # disp->ContextRecord | ||
1009 | mov $context,%rsi # context | ||
1010 | mov \$`1232/8`,%ecx # sizeof(CONTEXT) | ||
1011 | .long 0xa548f3fc # cld; rep movsq | ||
1012 | |||
1013 | mov $disp,%rsi | ||
1014 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
1015 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
1016 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
1017 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
1018 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
1019 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
1020 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
1021 | mov %r10,32(%rsp) # arg5 | ||
1022 | mov %r11,40(%rsp) # arg6 | ||
1023 | mov %r12,48(%rsp) # arg7 | ||
1024 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
1025 | call *__imp_RtlVirtualUnwind(%rip) | ||
1026 | |||
1027 | mov \$1,%eax # ExceptionContinueSearch | ||
1028 | lea 64(%rsp),%rsp | ||
1029 | popfq | ||
1030 | pop %r15 | ||
1031 | pop %r14 | ||
1032 | pop %r13 | ||
1033 | pop %r12 | ||
1034 | pop %rbp | ||
1035 | pop %rbx | ||
1036 | pop %rdi | ||
1037 | pop %rsi | ||
1038 | ret | ||
1039 | .size cbc_se_handler,.-cbc_se_handler | ||
1040 | |||
1041 | .section .pdata | ||
1042 | .align 4 | ||
1043 | .rva .LSEH_begin_Camellia_EncryptBlock_Rounds | ||
1044 | .rva .LSEH_end_Camellia_EncryptBlock_Rounds | ||
1045 | .rva .LSEH_info_Camellia_EncryptBlock_Rounds | ||
1046 | |||
1047 | .rva .LSEH_begin_Camellia_DecryptBlock_Rounds | ||
1048 | .rva .LSEH_end_Camellia_DecryptBlock_Rounds | ||
1049 | .rva .LSEH_info_Camellia_DecryptBlock_Rounds | ||
1050 | |||
1051 | .rva .LSEH_begin_Camellia_Ekeygen | ||
1052 | .rva .LSEH_end_Camellia_Ekeygen | ||
1053 | .rva .LSEH_info_Camellia_Ekeygen | ||
1054 | |||
1055 | .rva .LSEH_begin_Camellia_cbc_encrypt | ||
1056 | .rva .LSEH_end_Camellia_cbc_encrypt | ||
1057 | .rva .LSEH_info_Camellia_cbc_encrypt | ||
1058 | |||
1059 | .section .xdata | ||
1060 | .align 8 | ||
1061 | .LSEH_info_Camellia_EncryptBlock_Rounds: | ||
1062 | .byte 9,0,0,0 | ||
1063 | .rva common_se_handler | ||
1064 | .rva .Lenc_prologue,.Lenc_epilogue # HandlerData[] | ||
1065 | .LSEH_info_Camellia_DecryptBlock_Rounds: | ||
1066 | .byte 9,0,0,0 | ||
1067 | .rva common_se_handler | ||
1068 | .rva .Ldec_prologue,.Ldec_epilogue # HandlerData[] | ||
1069 | .LSEH_info_Camellia_Ekeygen: | ||
1070 | .byte 9,0,0,0 | ||
1071 | .rva common_se_handler | ||
1072 | .rva .Lkey_prologue,.Lkey_epilogue # HandlerData[] | ||
1073 | .LSEH_info_Camellia_cbc_encrypt: | ||
1074 | .byte 9,0,0,0 | ||
1075 | .rva cbc_se_handler | ||
1076 | ___ | ||
1077 | } | ||
1078 | |||
1079 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 865 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
1080 | print $code; | 866 | print $code; |
1081 | close STDOUT; | 867 | close STDOUT; |
diff --git a/src/lib/libcrypto/md5/asm/md5-x86_64.pl b/src/lib/libcrypto/md5/asm/md5-x86_64.pl index f11224d172..c902a1b532 100755 --- a/src/lib/libcrypto/md5/asm/md5-x86_64.pl +++ b/src/lib/libcrypto/md5/asm/md5-x86_64.pl | |||
@@ -112,8 +112,6 @@ my $flavour = shift; | |||
112 | my $output = shift; | 112 | my $output = shift; |
113 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 113 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
114 | 114 | ||
115 | my $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
116 | |||
117 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; | 115 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; |
118 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 116 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
119 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 117 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -261,110 +259,6 @@ $code .= <<EOF; | |||
261 | .size md5_block_asm_data_order,.-md5_block_asm_data_order | 259 | .size md5_block_asm_data_order,.-md5_block_asm_data_order |
262 | EOF | 260 | EOF |
263 | 261 | ||
264 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
265 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
266 | if ($win64) { | ||
267 | my $rec="%rcx"; | ||
268 | my $frame="%rdx"; | ||
269 | my $context="%r8"; | ||
270 | my $disp="%r9"; | ||
271 | |||
272 | $code.=<<___; | ||
273 | .extern __imp_RtlVirtualUnwind | ||
274 | .type se_handler,\@abi-omnipotent | ||
275 | .align 16 | ||
276 | se_handler: | ||
277 | push %rsi | ||
278 | push %rdi | ||
279 | push %rbx | ||
280 | push %rbp | ||
281 | push %r12 | ||
282 | push %r13 | ||
283 | push %r14 | ||
284 | push %r15 | ||
285 | pushfq | ||
286 | sub \$64,%rsp | ||
287 | |||
288 | mov 120($context),%rax # pull context->Rax | ||
289 | mov 248($context),%rbx # pull context->Rip | ||
290 | |||
291 | lea .Lprologue(%rip),%r10 | ||
292 | cmp %r10,%rbx # context->Rip<.Lprologue | ||
293 | jb .Lin_prologue | ||
294 | |||
295 | mov 152($context),%rax # pull context->Rsp | ||
296 | |||
297 | lea .Lepilogue(%rip),%r10 | ||
298 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
299 | jae .Lin_prologue | ||
300 | |||
301 | lea 40(%rax),%rax | ||
302 | |||
303 | mov -8(%rax),%rbp | ||
304 | mov -16(%rax),%rbx | ||
305 | mov -24(%rax),%r12 | ||
306 | mov -32(%rax),%r14 | ||
307 | mov -40(%rax),%r15 | ||
308 | mov %rbx,144($context) # restore context->Rbx | ||
309 | mov %rbp,160($context) # restore context->Rbp | ||
310 | mov %r12,216($context) # restore context->R12 | ||
311 | mov %r14,232($context) # restore context->R14 | ||
312 | mov %r15,240($context) # restore context->R15 | ||
313 | |||
314 | .Lin_prologue: | ||
315 | mov 8(%rax),%rdi | ||
316 | mov 16(%rax),%rsi | ||
317 | mov %rax,152($context) # restore context->Rsp | ||
318 | mov %rsi,168($context) # restore context->Rsi | ||
319 | mov %rdi,176($context) # restore context->Rdi | ||
320 | |||
321 | mov 40($disp),%rdi # disp->ContextRecord | ||
322 | mov $context,%rsi # context | ||
323 | mov \$154,%ecx # sizeof(CONTEXT) | ||
324 | .long 0xa548f3fc # cld; rep movsq | ||
325 | |||
326 | mov $disp,%rsi | ||
327 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
328 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
329 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
330 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
331 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
332 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
333 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
334 | mov %r10,32(%rsp) # arg5 | ||
335 | mov %r11,40(%rsp) # arg6 | ||
336 | mov %r12,48(%rsp) # arg7 | ||
337 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
338 | call *__imp_RtlVirtualUnwind(%rip) | ||
339 | |||
340 | mov \$1,%eax # ExceptionContinueSearch | ||
341 | add \$64,%rsp | ||
342 | popfq | ||
343 | pop %r15 | ||
344 | pop %r14 | ||
345 | pop %r13 | ||
346 | pop %r12 | ||
347 | pop %rbp | ||
348 | pop %rbx | ||
349 | pop %rdi | ||
350 | pop %rsi | ||
351 | ret | ||
352 | .size se_handler,.-se_handler | ||
353 | |||
354 | .section .pdata | ||
355 | .align 4 | ||
356 | .rva .LSEH_begin_md5_block_asm_data_order | ||
357 | .rva .LSEH_end_md5_block_asm_data_order | ||
358 | .rva .LSEH_info_md5_block_asm_data_order | ||
359 | |||
360 | .section .xdata | ||
361 | .align 8 | ||
362 | .LSEH_info_md5_block_asm_data_order: | ||
363 | .byte 9,0,0,0 | ||
364 | .rva se_handler | ||
365 | ___ | ||
366 | } | ||
367 | |||
368 | print $code; | 262 | print $code; |
369 | 263 | ||
370 | close STDOUT; | 264 | close STDOUT; |
diff --git a/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl b/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl index 272fa91e1a..501d9e936b 100644 --- a/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl +++ b/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl | |||
@@ -44,8 +44,6 @@ my $flavour = shift; | |||
44 | my $output = shift; | 44 | my $output = shift; |
45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
46 | 46 | ||
47 | my $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
48 | |||
49 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; | 47 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; |
50 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 48 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
51 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 49 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -505,111 +503,6 @@ RC4_options: | |||
505 | .size RC4_options,.-RC4_options | 503 | .size RC4_options,.-RC4_options |
506 | ___ | 504 | ___ |
507 | } | 505 | } |
508 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
509 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
510 | if ($win64) { | ||
511 | my $rec="%rcx"; | ||
512 | my $frame="%rdx"; | ||
513 | my $context="%r8"; | ||
514 | my $disp="%r9"; | ||
515 | |||
516 | $code.=<<___; | ||
517 | .extern __imp_RtlVirtualUnwind | ||
518 | .type se_handler,\@abi-omnipotent | ||
519 | .align 16 | ||
520 | se_handler: | ||
521 | push %rsi | ||
522 | push %rdi | ||
523 | push %rbx | ||
524 | push %rbp | ||
525 | push %r12 | ||
526 | push %r13 | ||
527 | push %r14 | ||
528 | push %r15 | ||
529 | pushfq | ||
530 | sub \$64,%rsp | ||
531 | |||
532 | mov 120($context),%rax # pull context->Rax | ||
533 | mov 248($context),%rbx # pull context->Rip | ||
534 | |||
535 | lea .Lbody(%rip),%r10 | ||
536 | cmp %r10,%rbx # context->Rip<.Lbody | ||
537 | jb .Lin_prologue | ||
538 | |||
539 | mov 152($context),%rax # pull context->Rsp | ||
540 | |||
541 | lea .Lepilogue(%rip),%r10 | ||
542 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
543 | jae .Lin_prologue | ||
544 | |||
545 | mov 40(%rax),%r15 | ||
546 | mov 48(%rax),%r14 | ||
547 | mov 56(%rax),%r13 | ||
548 | mov 64(%rax),%r12 | ||
549 | mov 72(%rax),%rbp | ||
550 | mov 80(%rax),%rbx | ||
551 | lea 88(%rax),%rax | ||
552 | |||
553 | mov %rbx,144($context) # restore context->Rbx | ||
554 | mov %rbp,160($context) # restore context->Rbp | ||
555 | mov %r12,216($context) # restore context->R12 | ||
556 | mov %r13,224($context) # restore context->R12 | ||
557 | mov %r14,232($context) # restore context->R14 | ||
558 | mov %r15,240($context) # restore context->R15 | ||
559 | |||
560 | .Lin_prologue: | ||
561 | mov 8(%rax),%rdi | ||
562 | mov 16(%rax),%rsi | ||
563 | mov %rax,152($context) # restore context->Rsp | ||
564 | mov %rsi,168($context) # restore context->Rsi | ||
565 | mov %rdi,176($context) # restore context->Rdi | ||
566 | |||
567 | mov 40($disp),%rdi # disp->ContextRecord | ||
568 | mov $context,%rsi # context | ||
569 | mov \$154,%ecx # sizeof(CONTEXT) | ||
570 | .long 0xa548f3fc # cld; rep movsq | ||
571 | |||
572 | mov $disp,%rsi | ||
573 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
574 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
575 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
576 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
577 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
578 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
579 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
580 | mov %r10,32(%rsp) # arg5 | ||
581 | mov %r11,40(%rsp) # arg6 | ||
582 | mov %r12,48(%rsp) # arg7 | ||
583 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
584 | call *__imp_RtlVirtualUnwind(%rip) | ||
585 | |||
586 | mov \$1,%eax # ExceptionContinueSearch | ||
587 | add \$64,%rsp | ||
588 | popfq | ||
589 | pop %r15 | ||
590 | pop %r14 | ||
591 | pop %r13 | ||
592 | pop %r12 | ||
593 | pop %rbp | ||
594 | pop %rbx | ||
595 | pop %rdi | ||
596 | pop %rsi | ||
597 | ret | ||
598 | .size se_handler,.-se_handler | ||
599 | |||
600 | .section .pdata | ||
601 | .align 4 | ||
602 | .rva .LSEH_begin_$func | ||
603 | .rva .LSEH_end_$func | ||
604 | .rva .LSEH_info_$func | ||
605 | |||
606 | .section .xdata | ||
607 | .align 8 | ||
608 | .LSEH_info_$func: | ||
609 | .byte 9,0,0,0 | ||
610 | .rva se_handler | ||
611 | ___ | ||
612 | } | ||
613 | 506 | ||
614 | sub reg_part { | 507 | sub reg_part { |
615 | my ($reg,$conv)=@_; | 508 | my ($reg,$conv)=@_; |
diff --git a/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl b/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl index 75750dbf33..2bed1e279f 100755 --- a/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl +++ b/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl | |||
@@ -105,8 +105,6 @@ $flavour = shift; | |||
105 | $output = shift; | 105 | $output = shift; |
106 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 106 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
107 | 107 | ||
108 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
109 | |||
110 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 108 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
111 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 109 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
112 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 110 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -528,138 +526,6 @@ RC4_options: | |||
528 | .size RC4_options,.-RC4_options | 526 | .size RC4_options,.-RC4_options |
529 | ___ | 527 | ___ |
530 | 528 | ||
531 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
532 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
533 | if ($win64) { | ||
534 | $rec="%rcx"; | ||
535 | $frame="%rdx"; | ||
536 | $context="%r8"; | ||
537 | $disp="%r9"; | ||
538 | |||
539 | $code.=<<___; | ||
540 | .extern __imp_RtlVirtualUnwind | ||
541 | .type stream_se_handler,\@abi-omnipotent | ||
542 | .align 16 | ||
543 | stream_se_handler: | ||
544 | push %rsi | ||
545 | push %rdi | ||
546 | push %rbx | ||
547 | push %rbp | ||
548 | push %r12 | ||
549 | push %r13 | ||
550 | push %r14 | ||
551 | push %r15 | ||
552 | pushfq | ||
553 | sub \$64,%rsp | ||
554 | |||
555 | mov 120($context),%rax # pull context->Rax | ||
556 | mov 248($context),%rbx # pull context->Rip | ||
557 | |||
558 | lea .Lprologue(%rip),%r10 | ||
559 | cmp %r10,%rbx # context->Rip<prologue label | ||
560 | jb .Lin_prologue | ||
561 | |||
562 | mov 152($context),%rax # pull context->Rsp | ||
563 | |||
564 | lea .Lepilogue(%rip),%r10 | ||
565 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
566 | jae .Lin_prologue | ||
567 | |||
568 | lea 24(%rax),%rax | ||
569 | |||
570 | mov -8(%rax),%rbx | ||
571 | mov -16(%rax),%r12 | ||
572 | mov -24(%rax),%r13 | ||
573 | mov %rbx,144($context) # restore context->Rbx | ||
574 | mov %r12,216($context) # restore context->R12 | ||
575 | mov %r13,224($context) # restore context->R13 | ||
576 | |||
577 | .Lin_prologue: | ||
578 | mov 8(%rax),%rdi | ||
579 | mov 16(%rax),%rsi | ||
580 | mov %rax,152($context) # restore context->Rsp | ||
581 | mov %rsi,168($context) # restore context->Rsi | ||
582 | mov %rdi,176($context) # restore context->Rdi | ||
583 | |||
584 | jmp .Lcommon_seh_exit | ||
585 | .size stream_se_handler,.-stream_se_handler | ||
586 | |||
587 | .type key_se_handler,\@abi-omnipotent | ||
588 | .align 16 | ||
589 | key_se_handler: | ||
590 | push %rsi | ||
591 | push %rdi | ||
592 | push %rbx | ||
593 | push %rbp | ||
594 | push %r12 | ||
595 | push %r13 | ||
596 | push %r14 | ||
597 | push %r15 | ||
598 | pushfq | ||
599 | sub \$64,%rsp | ||
600 | |||
601 | mov 152($context),%rax # pull context->Rsp | ||
602 | mov 8(%rax),%rdi | ||
603 | mov 16(%rax),%rsi | ||
604 | mov %rsi,168($context) # restore context->Rsi | ||
605 | mov %rdi,176($context) # restore context->Rdi | ||
606 | |||
607 | .Lcommon_seh_exit: | ||
608 | |||
609 | mov 40($disp),%rdi # disp->ContextRecord | ||
610 | mov $context,%rsi # context | ||
611 | mov \$154,%ecx # sizeof(CONTEXT) | ||
612 | .long 0xa548f3fc # cld; rep movsq | ||
613 | |||
614 | mov $disp,%rsi | ||
615 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
616 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
617 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
618 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
619 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
620 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
621 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
622 | mov %r10,32(%rsp) # arg5 | ||
623 | mov %r11,40(%rsp) # arg6 | ||
624 | mov %r12,48(%rsp) # arg7 | ||
625 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
626 | call *__imp_RtlVirtualUnwind(%rip) | ||
627 | |||
628 | mov \$1,%eax # ExceptionContinueSearch | ||
629 | add \$64,%rsp | ||
630 | popfq | ||
631 | pop %r15 | ||
632 | pop %r14 | ||
633 | pop %r13 | ||
634 | pop %r12 | ||
635 | pop %rbp | ||
636 | pop %rbx | ||
637 | pop %rdi | ||
638 | pop %rsi | ||
639 | ret | ||
640 | .size key_se_handler,.-key_se_handler | ||
641 | |||
642 | .section .pdata | ||
643 | .align 4 | ||
644 | .rva .LSEH_begin_RC4 | ||
645 | .rva .LSEH_end_RC4 | ||
646 | .rva .LSEH_info_RC4 | ||
647 | |||
648 | .rva .LSEH_begin_private_RC4_set_key | ||
649 | .rva .LSEH_end_private_RC4_set_key | ||
650 | .rva .LSEH_info_private_RC4_set_key | ||
651 | |||
652 | .section .xdata | ||
653 | .align 8 | ||
654 | .LSEH_info_RC4: | ||
655 | .byte 9,0,0,0 | ||
656 | .rva stream_se_handler | ||
657 | .LSEH_info_private_RC4_set_key: | ||
658 | .byte 9,0,0,0 | ||
659 | .rva key_se_handler | ||
660 | ___ | ||
661 | } | ||
662 | |||
663 | sub reg_part { | 529 | sub reg_part { |
664 | my ($reg,$conv)=@_; | 530 | my ($reg,$conv)=@_; |
665 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } | 531 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } |
diff --git a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl index 8d51678557..feb0f9e776 100755 --- a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl +++ b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl | |||
@@ -44,8 +44,6 @@ $flavour = shift; | |||
44 | $output = shift; | 44 | $output = shift; |
45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
46 | 46 | ||
47 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
48 | |||
49 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 47 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
50 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 48 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
51 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 49 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -339,113 +337,6 @@ $TABLE: | |||
339 | ___ | 337 | ___ |
340 | } | 338 | } |
341 | 339 | ||
342 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
343 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
344 | if ($win64) { | ||
345 | $rec="%rcx"; | ||
346 | $frame="%rdx"; | ||
347 | $context="%r8"; | ||
348 | $disp="%r9"; | ||
349 | |||
350 | $code.=<<___; | ||
351 | .extern __imp_RtlVirtualUnwind | ||
352 | .type se_handler,\@abi-omnipotent | ||
353 | .align 16 | ||
354 | se_handler: | ||
355 | push %rsi | ||
356 | push %rdi | ||
357 | push %rbx | ||
358 | push %rbp | ||
359 | push %r12 | ||
360 | push %r13 | ||
361 | push %r14 | ||
362 | push %r15 | ||
363 | pushfq | ||
364 | sub \$64,%rsp | ||
365 | |||
366 | mov 120($context),%rax # pull context->Rax | ||
367 | mov 248($context),%rbx # pull context->Rip | ||
368 | |||
369 | lea .Lprologue(%rip),%r10 | ||
370 | cmp %r10,%rbx # context->Rip<.Lprologue | ||
371 | jb .Lin_prologue | ||
372 | |||
373 | mov 152($context),%rax # pull context->Rsp | ||
374 | |||
375 | lea .Lepilogue(%rip),%r10 | ||
376 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
377 | jae .Lin_prologue | ||
378 | |||
379 | mov 16*$SZ+3*8(%rax),%rax # pull $_rsp | ||
380 | lea 48(%rax),%rax | ||
381 | |||
382 | mov -8(%rax),%rbx | ||
383 | mov -16(%rax),%rbp | ||
384 | mov -24(%rax),%r12 | ||
385 | mov -32(%rax),%r13 | ||
386 | mov -40(%rax),%r14 | ||
387 | mov -48(%rax),%r15 | ||
388 | mov %rbx,144($context) # restore context->Rbx | ||
389 | mov %rbp,160($context) # restore context->Rbp | ||
390 | mov %r12,216($context) # restore context->R12 | ||
391 | mov %r13,224($context) # restore context->R13 | ||
392 | mov %r14,232($context) # restore context->R14 | ||
393 | mov %r15,240($context) # restore context->R15 | ||
394 | |||
395 | .Lin_prologue: | ||
396 | mov 8(%rax),%rdi | ||
397 | mov 16(%rax),%rsi | ||
398 | mov %rax,152($context) # restore context->Rsp | ||
399 | mov %rsi,168($context) # restore context->Rsi | ||
400 | mov %rdi,176($context) # restore context->Rdi | ||
401 | |||
402 | mov 40($disp),%rdi # disp->ContextRecord | ||
403 | mov $context,%rsi # context | ||
404 | mov \$154,%ecx # sizeof(CONTEXT) | ||
405 | .long 0xa548f3fc # cld; rep movsq | ||
406 | |||
407 | mov $disp,%rsi | ||
408 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
409 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
410 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
411 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
412 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
413 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
414 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
415 | mov %r10,32(%rsp) # arg5 | ||
416 | mov %r11,40(%rsp) # arg6 | ||
417 | mov %r12,48(%rsp) # arg7 | ||
418 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
419 | call *__imp_RtlVirtualUnwind(%rip) | ||
420 | |||
421 | mov \$1,%eax # ExceptionContinueSearch | ||
422 | add \$64,%rsp | ||
423 | popfq | ||
424 | pop %r15 | ||
425 | pop %r14 | ||
426 | pop %r13 | ||
427 | pop %r12 | ||
428 | pop %rbp | ||
429 | pop %rbx | ||
430 | pop %rdi | ||
431 | pop %rsi | ||
432 | ret | ||
433 | .size se_handler,.-se_handler | ||
434 | |||
435 | .section .pdata | ||
436 | .align 4 | ||
437 | .rva .LSEH_begin_$func | ||
438 | .rva .LSEH_end_$func | ||
439 | .rva .LSEH_info_$func | ||
440 | |||
441 | .section .xdata | ||
442 | .align 8 | ||
443 | .LSEH_info_$func: | ||
444 | .byte 9,0,0,0 | ||
445 | .rva se_handler | ||
446 | ___ | ||
447 | } | ||
448 | |||
449 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 340 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
450 | print $code; | 341 | print $code; |
451 | close STDOUT; | 342 | close STDOUT; |
diff --git a/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl b/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl index 24b2ff60c3..afadd5d2f1 100644 --- a/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl +++ b/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl | |||
@@ -34,8 +34,6 @@ $flavour = shift; | |||
34 | $output = shift; | 34 | $output = shift; |
35 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 35 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
36 | 36 | ||
37 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
38 | |||
39 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; | 37 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; |
40 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 38 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
41 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 39 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -478,113 +476,6 @@ ___ | |||
478 | &L(0xfb,0xee,0x7c,0x66,0xdd,0x17,0x47,0x9e); | 476 | &L(0xfb,0xee,0x7c,0x66,0xdd,0x17,0x47,0x9e); |
479 | &L(0xca,0x2d,0xbf,0x07,0xad,0x5a,0x83,0x33); | 477 | &L(0xca,0x2d,0xbf,0x07,0xad,0x5a,0x83,0x33); |
480 | 478 | ||
481 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
482 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
483 | if ($win64) { | ||
484 | $rec="%rcx"; | ||
485 | $frame="%rdx"; | ||
486 | $context="%r8"; | ||
487 | $disp="%r9"; | ||
488 | |||
489 | $code.=<<___; | ||
490 | .extern __imp_RtlVirtualUnwind | ||
491 | .type se_handler,\@abi-omnipotent | ||
492 | .align 16 | ||
493 | se_handler: | ||
494 | push %rsi | ||
495 | push %rdi | ||
496 | push %rbx | ||
497 | push %rbp | ||
498 | push %r12 | ||
499 | push %r13 | ||
500 | push %r14 | ||
501 | push %r15 | ||
502 | pushfq | ||
503 | sub \$64,%rsp | ||
504 | |||
505 | mov 120($context),%rax # pull context->Rax | ||
506 | mov 248($context),%rbx # pull context->Rip | ||
507 | |||
508 | lea .Lprologue(%rip),%r10 | ||
509 | cmp %r10,%rbx # context->Rip<.Lprologue | ||
510 | jb .Lin_prologue | ||
511 | |||
512 | mov 152($context),%rax # pull context->Rsp | ||
513 | |||
514 | lea .Lepilogue(%rip),%r10 | ||
515 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
516 | jae .Lin_prologue | ||
517 | |||
518 | mov 128+32(%rax),%rax # pull saved stack pointer | ||
519 | lea 48(%rax),%rax | ||
520 | |||
521 | mov -8(%rax),%rbx | ||
522 | mov -16(%rax),%rbp | ||
523 | mov -24(%rax),%r12 | ||
524 | mov -32(%rax),%r13 | ||
525 | mov -40(%rax),%r14 | ||
526 | mov -48(%rax),%r15 | ||
527 | mov %rbx,144($context) # restore context->Rbx | ||
528 | mov %rbp,160($context) # restore context->Rbp | ||
529 | mov %r12,216($context) # restore context->R12 | ||
530 | mov %r13,224($context) # restore context->R13 | ||
531 | mov %r14,232($context) # restore context->R14 | ||
532 | mov %r15,240($context) # restore context->R15 | ||
533 | |||
534 | .Lin_prologue: | ||
535 | mov 8(%rax),%rdi | ||
536 | mov 16(%rax),%rsi | ||
537 | mov %rax,152($context) # restore context->Rsp | ||
538 | mov %rsi,168($context) # restore context->Rsi | ||
539 | mov %rdi,176($context) # restore context->Rdi | ||
540 | |||
541 | mov 40($disp),%rdi # disp->ContextRecord | ||
542 | mov $context,%rsi # context | ||
543 | mov \$154,%ecx # sizeof(CONTEXT) | ||
544 | .long 0xa548f3fc # cld; rep movsq | ||
545 | |||
546 | mov $disp,%rsi | ||
547 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
548 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
549 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
550 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
551 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
552 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
553 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
554 | mov %r10,32(%rsp) # arg5 | ||
555 | mov %r11,40(%rsp) # arg6 | ||
556 | mov %r12,48(%rsp) # arg7 | ||
557 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
558 | call *__imp_RtlVirtualUnwind(%rip) | ||
559 | |||
560 | mov \$1,%eax # ExceptionContinueSearch | ||
561 | add \$64,%rsp | ||
562 | popfq | ||
563 | pop %r15 | ||
564 | pop %r14 | ||
565 | pop %r13 | ||
566 | pop %r12 | ||
567 | pop %rbp | ||
568 | pop %rbx | ||
569 | pop %rdi | ||
570 | pop %rsi | ||
571 | ret | ||
572 | .size se_handler,.-se_handler | ||
573 | |||
574 | .section .pdata | ||
575 | .align 4 | ||
576 | .rva .LSEH_begin_$func | ||
577 | .rva .LSEH_end_$func | ||
578 | .rva .LSEH_info_$func | ||
579 | |||
580 | .section .xdata | ||
581 | .align 8 | ||
582 | .LSEH_info_$func: | ||
583 | .byte 9,0,0,0 | ||
584 | .rva se_handler | ||
585 | ___ | ||
586 | } | ||
587 | |||
588 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 479 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
589 | print $code; | 480 | print $code; |
590 | close STDOUT; | 481 | close STDOUT; |
diff --git a/src/lib/libssl/src/crypto/bn/asm/modexp512-x86_64.pl b/src/lib/libssl/src/crypto/bn/asm/modexp512-x86_64.pl index bfd6e97541..4317282835 100644 --- a/src/lib/libssl/src/crypto/bn/asm/modexp512-x86_64.pl +++ b/src/lib/libssl/src/crypto/bn/asm/modexp512-x86_64.pl | |||
@@ -61,8 +61,6 @@ $flavour = shift; | |||
61 | $output = shift; | 61 | $output = shift; |
62 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 62 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
63 | 63 | ||
64 | my $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
65 | |||
66 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 64 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
67 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 65 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
68 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 66 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -1374,113 +1372,6 @@ end_main_loop_a3b: | |||
1374 | .size mod_exp_512, . - mod_exp_512 | 1372 | .size mod_exp_512, . - mod_exp_512 |
1375 | ___ | 1373 | ___ |
1376 | 1374 | ||
1377 | if ($win64) { | ||
1378 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
1379 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
1380 | my $rec="%rcx"; | ||
1381 | my $frame="%rdx"; | ||
1382 | my $context="%r8"; | ||
1383 | my $disp="%r9"; | ||
1384 | |||
1385 | $code.=<<___; | ||
1386 | .extern __imp_RtlVirtualUnwind | ||
1387 | .type mod_exp_512_se_handler,\@abi-omnipotent | ||
1388 | .align 16 | ||
1389 | mod_exp_512_se_handler: | ||
1390 | push %rsi | ||
1391 | push %rdi | ||
1392 | push %rbx | ||
1393 | push %rbp | ||
1394 | push %r12 | ||
1395 | push %r13 | ||
1396 | push %r14 | ||
1397 | push %r15 | ||
1398 | pushfq | ||
1399 | sub \$64,%rsp | ||
1400 | |||
1401 | mov 120($context),%rax # pull context->Rax | ||
1402 | mov 248($context),%rbx # pull context->Rip | ||
1403 | |||
1404 | lea .Lbody(%rip),%r10 | ||
1405 | cmp %r10,%rbx # context->Rip<prologue label | ||
1406 | jb .Lin_prologue | ||
1407 | |||
1408 | mov 152($context),%rax # pull context->Rsp | ||
1409 | |||
1410 | lea .Lepilogue(%rip),%r10 | ||
1411 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
1412 | jae .Lin_prologue | ||
1413 | |||
1414 | mov $rsp_offset(%rax),%rax # pull saved Rsp | ||
1415 | |||
1416 | mov 32(%rax),%rbx | ||
1417 | mov 40(%rax),%rbp | ||
1418 | mov 24(%rax),%r12 | ||
1419 | mov 16(%rax),%r13 | ||
1420 | mov 8(%rax),%r14 | ||
1421 | mov 0(%rax),%r15 | ||
1422 | lea 48(%rax),%rax | ||
1423 | mov %rbx,144($context) # restore context->Rbx | ||
1424 | mov %rbp,160($context) # restore context->Rbp | ||
1425 | mov %r12,216($context) # restore context->R12 | ||
1426 | mov %r13,224($context) # restore context->R13 | ||
1427 | mov %r14,232($context) # restore context->R14 | ||
1428 | mov %r15,240($context) # restore context->R15 | ||
1429 | |||
1430 | .Lin_prologue: | ||
1431 | mov 8(%rax),%rdi | ||
1432 | mov 16(%rax),%rsi | ||
1433 | mov %rax,152($context) # restore context->Rsp | ||
1434 | mov %rsi,168($context) # restore context->Rsi | ||
1435 | mov %rdi,176($context) # restore context->Rdi | ||
1436 | |||
1437 | mov 40($disp),%rdi # disp->ContextRecord | ||
1438 | mov $context,%rsi # context | ||
1439 | mov \$154,%ecx # sizeof(CONTEXT) | ||
1440 | .long 0xa548f3fc # cld; rep movsq | ||
1441 | |||
1442 | mov $disp,%rsi | ||
1443 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
1444 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
1445 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
1446 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
1447 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
1448 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
1449 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
1450 | mov %r10,32(%rsp) # arg5 | ||
1451 | mov %r11,40(%rsp) # arg6 | ||
1452 | mov %r12,48(%rsp) # arg7 | ||
1453 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
1454 | call *__imp_RtlVirtualUnwind(%rip) | ||
1455 | |||
1456 | mov \$1,%eax # ExceptionContinueSearch | ||
1457 | add \$64,%rsp | ||
1458 | popfq | ||
1459 | pop %r15 | ||
1460 | pop %r14 | ||
1461 | pop %r13 | ||
1462 | pop %r12 | ||
1463 | pop %rbp | ||
1464 | pop %rbx | ||
1465 | pop %rdi | ||
1466 | pop %rsi | ||
1467 | ret | ||
1468 | .size mod_exp_512_se_handler,.-mod_exp_512_se_handler | ||
1469 | |||
1470 | .section .pdata | ||
1471 | .align 4 | ||
1472 | .rva .LSEH_begin_mod_exp_512 | ||
1473 | .rva .LSEH_end_mod_exp_512 | ||
1474 | .rva .LSEH_info_mod_exp_512 | ||
1475 | |||
1476 | .section .xdata | ||
1477 | .align 8 | ||
1478 | .LSEH_info_mod_exp_512: | ||
1479 | .byte 9,0,0,0 | ||
1480 | .rva mod_exp_512_se_handler | ||
1481 | ___ | ||
1482 | } | ||
1483 | |||
1484 | sub reg_part { | 1375 | sub reg_part { |
1485 | my ($reg,$conv)=@_; | 1376 | my ($reg,$conv)=@_; |
1486 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } | 1377 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } |
diff --git a/src/lib/libssl/src/crypto/bn/asm/x86_64-mont.pl b/src/lib/libssl/src/crypto/bn/asm/x86_64-mont.pl index 17fb94c84c..90c717f115 100755 --- a/src/lib/libssl/src/crypto/bn/asm/x86_64-mont.pl +++ b/src/lib/libssl/src/crypto/bn/asm/x86_64-mont.pl | |||
@@ -33,8 +33,6 @@ $flavour = shift; | |||
33 | $output = shift; | 33 | $output = shift; |
34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
35 | 35 | ||
36 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
37 | |||
38 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 36 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
39 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 37 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
40 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 38 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -1502,180 +1500,5 @@ $code.=<<___; | |||
1502 | .align 16 | 1500 | .align 16 |
1503 | ___ | 1501 | ___ |
1504 | 1502 | ||
1505 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
1506 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
1507 | if ($win64) { | ||
1508 | $rec="%rcx"; | ||
1509 | $frame="%rdx"; | ||
1510 | $context="%r8"; | ||
1511 | $disp="%r9"; | ||
1512 | |||
1513 | $code.=<<___; | ||
1514 | .extern __imp_RtlVirtualUnwind | ||
1515 | .type mul_handler,\@abi-omnipotent | ||
1516 | .align 16 | ||
1517 | mul_handler: | ||
1518 | push %rsi | ||
1519 | push %rdi | ||
1520 | push %rbx | ||
1521 | push %rbp | ||
1522 | push %r12 | ||
1523 | push %r13 | ||
1524 | push %r14 | ||
1525 | push %r15 | ||
1526 | pushfq | ||
1527 | sub \$64,%rsp | ||
1528 | |||
1529 | mov 120($context),%rax # pull context->Rax | ||
1530 | mov 248($context),%rbx # pull context->Rip | ||
1531 | |||
1532 | mov 8($disp),%rsi # disp->ImageBase | ||
1533 | mov 56($disp),%r11 # disp->HandlerData | ||
1534 | |||
1535 | mov 0(%r11),%r10d # HandlerData[0] | ||
1536 | lea (%rsi,%r10),%r10 # end of prologue label | ||
1537 | cmp %r10,%rbx # context->Rip<end of prologue label | ||
1538 | jb .Lcommon_seh_tail | ||
1539 | |||
1540 | mov 152($context),%rax # pull context->Rsp | ||
1541 | |||
1542 | mov 4(%r11),%r10d # HandlerData[1] | ||
1543 | lea (%rsi,%r10),%r10 # epilogue label | ||
1544 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
1545 | jae .Lcommon_seh_tail | ||
1546 | |||
1547 | mov 192($context),%r10 # pull $num | ||
1548 | mov 8(%rax,%r10,8),%rax # pull saved stack pointer | ||
1549 | lea 48(%rax),%rax | ||
1550 | |||
1551 | mov -8(%rax),%rbx | ||
1552 | mov -16(%rax),%rbp | ||
1553 | mov -24(%rax),%r12 | ||
1554 | mov -32(%rax),%r13 | ||
1555 | mov -40(%rax),%r14 | ||
1556 | mov -48(%rax),%r15 | ||
1557 | mov %rbx,144($context) # restore context->Rbx | ||
1558 | mov %rbp,160($context) # restore context->Rbp | ||
1559 | mov %r12,216($context) # restore context->R12 | ||
1560 | mov %r13,224($context) # restore context->R13 | ||
1561 | mov %r14,232($context) # restore context->R14 | ||
1562 | mov %r15,240($context) # restore context->R15 | ||
1563 | |||
1564 | jmp .Lcommon_seh_tail | ||
1565 | .size mul_handler,.-mul_handler | ||
1566 | |||
1567 | .type sqr_handler,\@abi-omnipotent | ||
1568 | .align 16 | ||
1569 | sqr_handler: | ||
1570 | push %rsi | ||
1571 | push %rdi | ||
1572 | push %rbx | ||
1573 | push %rbp | ||
1574 | push %r12 | ||
1575 | push %r13 | ||
1576 | push %r14 | ||
1577 | push %r15 | ||
1578 | pushfq | ||
1579 | sub \$64,%rsp | ||
1580 | |||
1581 | mov 120($context),%rax # pull context->Rax | ||
1582 | mov 248($context),%rbx # pull context->Rip | ||
1583 | |||
1584 | lea .Lsqr4x_body(%rip),%r10 | ||
1585 | cmp %r10,%rbx # context->Rip<.Lsqr_body | ||
1586 | jb .Lcommon_seh_tail | ||
1587 | |||
1588 | mov 152($context),%rax # pull context->Rsp | ||
1589 | |||
1590 | lea .Lsqr4x_epilogue(%rip),%r10 | ||
1591 | cmp %r10,%rbx # context->Rip>=.Lsqr_epilogue | ||
1592 | jae .Lcommon_seh_tail | ||
1593 | |||
1594 | mov 56(%rax),%rax # pull saved stack pointer | ||
1595 | lea 48(%rax),%rax | ||
1596 | |||
1597 | mov -8(%rax),%rbx | ||
1598 | mov -16(%rax),%rbp | ||
1599 | mov -24(%rax),%r12 | ||
1600 | mov -32(%rax),%r13 | ||
1601 | mov -40(%rax),%r14 | ||
1602 | mov -48(%rax),%r15 | ||
1603 | mov %rbx,144($context) # restore context->Rbx | ||
1604 | mov %rbp,160($context) # restore context->Rbp | ||
1605 | mov %r12,216($context) # restore context->R12 | ||
1606 | mov %r13,224($context) # restore context->R13 | ||
1607 | mov %r14,232($context) # restore context->R14 | ||
1608 | mov %r15,240($context) # restore context->R15 | ||
1609 | |||
1610 | .Lcommon_seh_tail: | ||
1611 | mov 8(%rax),%rdi | ||
1612 | mov 16(%rax),%rsi | ||
1613 | mov %rax,152($context) # restore context->Rsp | ||
1614 | mov %rsi,168($context) # restore context->Rsi | ||
1615 | mov %rdi,176($context) # restore context->Rdi | ||
1616 | |||
1617 | mov 40($disp),%rdi # disp->ContextRecord | ||
1618 | mov $context,%rsi # context | ||
1619 | mov \$154,%ecx # sizeof(CONTEXT) | ||
1620 | .long 0xa548f3fc # cld; rep movsq | ||
1621 | |||
1622 | mov $disp,%rsi | ||
1623 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
1624 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
1625 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
1626 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
1627 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
1628 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
1629 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
1630 | mov %r10,32(%rsp) # arg5 | ||
1631 | mov %r11,40(%rsp) # arg6 | ||
1632 | mov %r12,48(%rsp) # arg7 | ||
1633 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
1634 | call *__imp_RtlVirtualUnwind(%rip) | ||
1635 | |||
1636 | mov \$1,%eax # ExceptionContinueSearch | ||
1637 | add \$64,%rsp | ||
1638 | popfq | ||
1639 | pop %r15 | ||
1640 | pop %r14 | ||
1641 | pop %r13 | ||
1642 | pop %r12 | ||
1643 | pop %rbp | ||
1644 | pop %rbx | ||
1645 | pop %rdi | ||
1646 | pop %rsi | ||
1647 | ret | ||
1648 | .size sqr_handler,.-sqr_handler | ||
1649 | |||
1650 | .section .pdata | ||
1651 | .align 4 | ||
1652 | .rva .LSEH_begin_bn_mul_mont | ||
1653 | .rva .LSEH_end_bn_mul_mont | ||
1654 | .rva .LSEH_info_bn_mul_mont | ||
1655 | |||
1656 | .rva .LSEH_begin_bn_mul4x_mont | ||
1657 | .rva .LSEH_end_bn_mul4x_mont | ||
1658 | .rva .LSEH_info_bn_mul4x_mont | ||
1659 | |||
1660 | .rva .LSEH_begin_bn_sqr4x_mont | ||
1661 | .rva .LSEH_end_bn_sqr4x_mont | ||
1662 | .rva .LSEH_info_bn_sqr4x_mont | ||
1663 | |||
1664 | .section .xdata | ||
1665 | .align 8 | ||
1666 | .LSEH_info_bn_mul_mont: | ||
1667 | .byte 9,0,0,0 | ||
1668 | .rva mul_handler | ||
1669 | .rva .Lmul_body,.Lmul_epilogue # HandlerData[] | ||
1670 | .LSEH_info_bn_mul4x_mont: | ||
1671 | .byte 9,0,0,0 | ||
1672 | .rva mul_handler | ||
1673 | .rva .Lmul4x_body,.Lmul4x_epilogue # HandlerData[] | ||
1674 | .LSEH_info_bn_sqr4x_mont: | ||
1675 | .byte 9,0,0,0 | ||
1676 | .rva sqr_handler | ||
1677 | ___ | ||
1678 | } | ||
1679 | |||
1680 | print $code; | 1503 | print $code; |
1681 | close STDOUT; | 1504 | close STDOUT; |
diff --git a/src/lib/libssl/src/crypto/camellia/asm/cmll-x86_64.pl b/src/lib/libssl/src/crypto/camellia/asm/cmll-x86_64.pl index 9f4b82fa48..a171c654b2 100644 --- a/src/lib/libssl/src/crypto/camellia/asm/cmll-x86_64.pl +++ b/src/lib/libssl/src/crypto/camellia/asm/cmll-x86_64.pl | |||
@@ -33,8 +33,6 @@ $flavour = shift; | |||
33 | $output = shift; | 33 | $output = shift; |
34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 34 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
35 | 35 | ||
36 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
37 | |||
38 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 36 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
39 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 37 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
40 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 38 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -57,7 +55,7 @@ $inp="%r12"; | |||
57 | $out="%r13"; | 55 | $out="%r13"; |
58 | $key="%r14"; | 56 | $key="%r14"; |
59 | $keyend="%r15"; | 57 | $keyend="%r15"; |
60 | $arg0d=$win64?"%ecx":"%edi"; | 58 | $arg0d="%edi"; |
61 | 59 | ||
62 | # const unsigned int Camellia_SBOX[4][256]; | 60 | # const unsigned int Camellia_SBOX[4][256]; |
63 | # Well, sort of... Camellia_SBOX[0][] is interleaved with [1][], | 61 | # Well, sort of... Camellia_SBOX[0][] is interleaved with [1][], |
@@ -864,218 +862,6 @@ Camellia_cbc_encrypt: | |||
864 | ___ | 862 | ___ |
865 | } | 863 | } |
866 | 864 | ||
867 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
868 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
869 | if ($win64) { | ||
870 | $rec="%rcx"; | ||
871 | $frame="%rdx"; | ||
872 | $context="%r8"; | ||
873 | $disp="%r9"; | ||
874 | |||
875 | $code.=<<___; | ||
876 | .extern __imp_RtlVirtualUnwind | ||
877 | .type common_se_handler,\@abi-omnipotent | ||
878 | .align 16 | ||
879 | common_se_handler: | ||
880 | push %rsi | ||
881 | push %rdi | ||
882 | push %rbx | ||
883 | push %rbp | ||
884 | push %r12 | ||
885 | push %r13 | ||
886 | push %r14 | ||
887 | push %r15 | ||
888 | pushfq | ||
889 | lea -64(%rsp),%rsp | ||
890 | |||
891 | mov 120($context),%rax # pull context->Rax | ||
892 | mov 248($context),%rbx # pull context->Rip | ||
893 | |||
894 | mov 8($disp),%rsi # disp->ImageBase | ||
895 | mov 56($disp),%r11 # disp->HandlerData | ||
896 | |||
897 | mov 0(%r11),%r10d # HandlerData[0] | ||
898 | lea (%rsi,%r10),%r10 # prologue label | ||
899 | cmp %r10,%rbx # context->Rip<prologue label | ||
900 | jb .Lin_prologue | ||
901 | |||
902 | mov 152($context),%rax # pull context->Rsp | ||
903 | |||
904 | mov 4(%r11),%r10d # HandlerData[1] | ||
905 | lea (%rsi,%r10),%r10 # epilogue label | ||
906 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
907 | jae .Lin_prologue | ||
908 | |||
909 | lea 40(%rax),%rax | ||
910 | mov -8(%rax),%rbx | ||
911 | mov -16(%rax),%rbp | ||
912 | mov -24(%rax),%r13 | ||
913 | mov -32(%rax),%r14 | ||
914 | mov -40(%rax),%r15 | ||
915 | mov %rbx,144($context) # restore context->Rbx | ||
916 | mov %rbp,160($context) # restore context->Rbp | ||
917 | mov %r13,224($context) # restore context->R13 | ||
918 | mov %r14,232($context) # restore context->R14 | ||
919 | mov %r15,240($context) # restore context->R15 | ||
920 | |||
921 | .Lin_prologue: | ||
922 | mov 8(%rax),%rdi | ||
923 | mov 16(%rax),%rsi | ||
924 | mov %rax,152($context) # restore context->Rsp | ||
925 | mov %rsi,168($context) # restore context->Rsi | ||
926 | mov %rdi,176($context) # restore context->Rdi | ||
927 | |||
928 | jmp .Lcommon_seh_exit | ||
929 | .size common_se_handler,.-common_se_handler | ||
930 | |||
931 | .type cbc_se_handler,\@abi-omnipotent | ||
932 | .align 16 | ||
933 | cbc_se_handler: | ||
934 | push %rsi | ||
935 | push %rdi | ||
936 | push %rbx | ||
937 | push %rbp | ||
938 | push %r12 | ||
939 | push %r13 | ||
940 | push %r14 | ||
941 | push %r15 | ||
942 | pushfq | ||
943 | lea -64(%rsp),%rsp | ||
944 | |||
945 | mov 120($context),%rax # pull context->Rax | ||
946 | mov 248($context),%rbx # pull context->Rip | ||
947 | |||
948 | lea .Lcbc_prologue(%rip),%r10 | ||
949 | cmp %r10,%rbx # context->Rip<.Lcbc_prologue | ||
950 | jb .Lin_cbc_prologue | ||
951 | |||
952 | lea .Lcbc_body(%rip),%r10 | ||
953 | cmp %r10,%rbx # context->Rip<.Lcbc_body | ||
954 | jb .Lin_cbc_frame_setup | ||
955 | |||
956 | mov 152($context),%rax # pull context->Rsp | ||
957 | |||
958 | lea .Lcbc_abort(%rip),%r10 | ||
959 | cmp %r10,%rbx # context->Rip>=.Lcbc_abort | ||
960 | jae .Lin_cbc_prologue | ||
961 | |||
962 | # handle pushf/popf in Camellia_cbc_encrypt | ||
963 | lea .Lcbc_enc_pushf(%rip),%r10 | ||
964 | cmp %r10,%rbx # context->Rip<=.Lcbc_enc_pushf | ||
965 | jbe .Lin_cbc_no_flag | ||
966 | lea 8(%rax),%rax | ||
967 | lea .Lcbc_enc_popf(%rip),%r10 | ||
968 | cmp %r10,%rbx # context->Rip<.Lcbc_enc_popf | ||
969 | jb .Lin_cbc_no_flag | ||
970 | lea -8(%rax),%rax | ||
971 | lea .Lcbc_dec_pushf(%rip),%r10 | ||
972 | cmp %r10,%rbx # context->Rip<=.Lcbc_dec_pushf | ||
973 | jbe .Lin_cbc_no_flag | ||
974 | lea 8(%rax),%rax | ||
975 | lea .Lcbc_dec_popf(%rip),%r10 | ||
976 | cmp %r10,%rbx # context->Rip<.Lcbc_dec_popf | ||
977 | jb .Lin_cbc_no_flag | ||
978 | lea -8(%rax),%rax | ||
979 | |||
980 | .Lin_cbc_no_flag: | ||
981 | mov 48(%rax),%rax # $_rsp | ||
982 | lea 48(%rax),%rax | ||
983 | |||
984 | .Lin_cbc_frame_setup: | ||
985 | mov -8(%rax),%rbx | ||
986 | mov -16(%rax),%rbp | ||
987 | mov -24(%rax),%r12 | ||
988 | mov -32(%rax),%r13 | ||
989 | mov -40(%rax),%r14 | ||
990 | mov -48(%rax),%r15 | ||
991 | mov %rbx,144($context) # restore context->Rbx | ||
992 | mov %rbp,160($context) # restore context->Rbp | ||
993 | mov %r12,216($context) # restore context->R12 | ||
994 | mov %r13,224($context) # restore context->R13 | ||
995 | mov %r14,232($context) # restore context->R14 | ||
996 | mov %r15,240($context) # restore context->R15 | ||
997 | |||
998 | .Lin_cbc_prologue: | ||
999 | mov 8(%rax),%rdi | ||
1000 | mov 16(%rax),%rsi | ||
1001 | mov %rax,152($context) # restore context->Rsp | ||
1002 | mov %rsi,168($context) # restore context->Rsi | ||
1003 | mov %rdi,176($context) # restore context->Rdi | ||
1004 | |||
1005 | .align 4 | ||
1006 | .Lcommon_seh_exit: | ||
1007 | |||
1008 | mov 40($disp),%rdi # disp->ContextRecord | ||
1009 | mov $context,%rsi # context | ||
1010 | mov \$`1232/8`,%ecx # sizeof(CONTEXT) | ||
1011 | .long 0xa548f3fc # cld; rep movsq | ||
1012 | |||
1013 | mov $disp,%rsi | ||
1014 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
1015 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
1016 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
1017 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
1018 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
1019 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
1020 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
1021 | mov %r10,32(%rsp) # arg5 | ||
1022 | mov %r11,40(%rsp) # arg6 | ||
1023 | mov %r12,48(%rsp) # arg7 | ||
1024 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
1025 | call *__imp_RtlVirtualUnwind(%rip) | ||
1026 | |||
1027 | mov \$1,%eax # ExceptionContinueSearch | ||
1028 | lea 64(%rsp),%rsp | ||
1029 | popfq | ||
1030 | pop %r15 | ||
1031 | pop %r14 | ||
1032 | pop %r13 | ||
1033 | pop %r12 | ||
1034 | pop %rbp | ||
1035 | pop %rbx | ||
1036 | pop %rdi | ||
1037 | pop %rsi | ||
1038 | ret | ||
1039 | .size cbc_se_handler,.-cbc_se_handler | ||
1040 | |||
1041 | .section .pdata | ||
1042 | .align 4 | ||
1043 | .rva .LSEH_begin_Camellia_EncryptBlock_Rounds | ||
1044 | .rva .LSEH_end_Camellia_EncryptBlock_Rounds | ||
1045 | .rva .LSEH_info_Camellia_EncryptBlock_Rounds | ||
1046 | |||
1047 | .rva .LSEH_begin_Camellia_DecryptBlock_Rounds | ||
1048 | .rva .LSEH_end_Camellia_DecryptBlock_Rounds | ||
1049 | .rva .LSEH_info_Camellia_DecryptBlock_Rounds | ||
1050 | |||
1051 | .rva .LSEH_begin_Camellia_Ekeygen | ||
1052 | .rva .LSEH_end_Camellia_Ekeygen | ||
1053 | .rva .LSEH_info_Camellia_Ekeygen | ||
1054 | |||
1055 | .rva .LSEH_begin_Camellia_cbc_encrypt | ||
1056 | .rva .LSEH_end_Camellia_cbc_encrypt | ||
1057 | .rva .LSEH_info_Camellia_cbc_encrypt | ||
1058 | |||
1059 | .section .xdata | ||
1060 | .align 8 | ||
1061 | .LSEH_info_Camellia_EncryptBlock_Rounds: | ||
1062 | .byte 9,0,0,0 | ||
1063 | .rva common_se_handler | ||
1064 | .rva .Lenc_prologue,.Lenc_epilogue # HandlerData[] | ||
1065 | .LSEH_info_Camellia_DecryptBlock_Rounds: | ||
1066 | .byte 9,0,0,0 | ||
1067 | .rva common_se_handler | ||
1068 | .rva .Ldec_prologue,.Ldec_epilogue # HandlerData[] | ||
1069 | .LSEH_info_Camellia_Ekeygen: | ||
1070 | .byte 9,0,0,0 | ||
1071 | .rva common_se_handler | ||
1072 | .rva .Lkey_prologue,.Lkey_epilogue # HandlerData[] | ||
1073 | .LSEH_info_Camellia_cbc_encrypt: | ||
1074 | .byte 9,0,0,0 | ||
1075 | .rva cbc_se_handler | ||
1076 | ___ | ||
1077 | } | ||
1078 | |||
1079 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 865 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
1080 | print $code; | 866 | print $code; |
1081 | close STDOUT; | 867 | close STDOUT; |
diff --git a/src/lib/libssl/src/crypto/md5/asm/md5-x86_64.pl b/src/lib/libssl/src/crypto/md5/asm/md5-x86_64.pl index f11224d172..c902a1b532 100755 --- a/src/lib/libssl/src/crypto/md5/asm/md5-x86_64.pl +++ b/src/lib/libssl/src/crypto/md5/asm/md5-x86_64.pl | |||
@@ -112,8 +112,6 @@ my $flavour = shift; | |||
112 | my $output = shift; | 112 | my $output = shift; |
113 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 113 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
114 | 114 | ||
115 | my $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
116 | |||
117 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; | 115 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; |
118 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 116 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
119 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 117 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -261,110 +259,6 @@ $code .= <<EOF; | |||
261 | .size md5_block_asm_data_order,.-md5_block_asm_data_order | 259 | .size md5_block_asm_data_order,.-md5_block_asm_data_order |
262 | EOF | 260 | EOF |
263 | 261 | ||
264 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
265 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
266 | if ($win64) { | ||
267 | my $rec="%rcx"; | ||
268 | my $frame="%rdx"; | ||
269 | my $context="%r8"; | ||
270 | my $disp="%r9"; | ||
271 | |||
272 | $code.=<<___; | ||
273 | .extern __imp_RtlVirtualUnwind | ||
274 | .type se_handler,\@abi-omnipotent | ||
275 | .align 16 | ||
276 | se_handler: | ||
277 | push %rsi | ||
278 | push %rdi | ||
279 | push %rbx | ||
280 | push %rbp | ||
281 | push %r12 | ||
282 | push %r13 | ||
283 | push %r14 | ||
284 | push %r15 | ||
285 | pushfq | ||
286 | sub \$64,%rsp | ||
287 | |||
288 | mov 120($context),%rax # pull context->Rax | ||
289 | mov 248($context),%rbx # pull context->Rip | ||
290 | |||
291 | lea .Lprologue(%rip),%r10 | ||
292 | cmp %r10,%rbx # context->Rip<.Lprologue | ||
293 | jb .Lin_prologue | ||
294 | |||
295 | mov 152($context),%rax # pull context->Rsp | ||
296 | |||
297 | lea .Lepilogue(%rip),%r10 | ||
298 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
299 | jae .Lin_prologue | ||
300 | |||
301 | lea 40(%rax),%rax | ||
302 | |||
303 | mov -8(%rax),%rbp | ||
304 | mov -16(%rax),%rbx | ||
305 | mov -24(%rax),%r12 | ||
306 | mov -32(%rax),%r14 | ||
307 | mov -40(%rax),%r15 | ||
308 | mov %rbx,144($context) # restore context->Rbx | ||
309 | mov %rbp,160($context) # restore context->Rbp | ||
310 | mov %r12,216($context) # restore context->R12 | ||
311 | mov %r14,232($context) # restore context->R14 | ||
312 | mov %r15,240($context) # restore context->R15 | ||
313 | |||
314 | .Lin_prologue: | ||
315 | mov 8(%rax),%rdi | ||
316 | mov 16(%rax),%rsi | ||
317 | mov %rax,152($context) # restore context->Rsp | ||
318 | mov %rsi,168($context) # restore context->Rsi | ||
319 | mov %rdi,176($context) # restore context->Rdi | ||
320 | |||
321 | mov 40($disp),%rdi # disp->ContextRecord | ||
322 | mov $context,%rsi # context | ||
323 | mov \$154,%ecx # sizeof(CONTEXT) | ||
324 | .long 0xa548f3fc # cld; rep movsq | ||
325 | |||
326 | mov $disp,%rsi | ||
327 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
328 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
329 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
330 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
331 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
332 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
333 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
334 | mov %r10,32(%rsp) # arg5 | ||
335 | mov %r11,40(%rsp) # arg6 | ||
336 | mov %r12,48(%rsp) # arg7 | ||
337 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
338 | call *__imp_RtlVirtualUnwind(%rip) | ||
339 | |||
340 | mov \$1,%eax # ExceptionContinueSearch | ||
341 | add \$64,%rsp | ||
342 | popfq | ||
343 | pop %r15 | ||
344 | pop %r14 | ||
345 | pop %r13 | ||
346 | pop %r12 | ||
347 | pop %rbp | ||
348 | pop %rbx | ||
349 | pop %rdi | ||
350 | pop %rsi | ||
351 | ret | ||
352 | .size se_handler,.-se_handler | ||
353 | |||
354 | .section .pdata | ||
355 | .align 4 | ||
356 | .rva .LSEH_begin_md5_block_asm_data_order | ||
357 | .rva .LSEH_end_md5_block_asm_data_order | ||
358 | .rva .LSEH_info_md5_block_asm_data_order | ||
359 | |||
360 | .section .xdata | ||
361 | .align 8 | ||
362 | .LSEH_info_md5_block_asm_data_order: | ||
363 | .byte 9,0,0,0 | ||
364 | .rva se_handler | ||
365 | ___ | ||
366 | } | ||
367 | |||
368 | print $code; | 262 | print $code; |
369 | 263 | ||
370 | close STDOUT; | 264 | close STDOUT; |
diff --git a/src/lib/libssl/src/crypto/rc4/asm/rc4-md5-x86_64.pl b/src/lib/libssl/src/crypto/rc4/asm/rc4-md5-x86_64.pl index 272fa91e1a..501d9e936b 100644 --- a/src/lib/libssl/src/crypto/rc4/asm/rc4-md5-x86_64.pl +++ b/src/lib/libssl/src/crypto/rc4/asm/rc4-md5-x86_64.pl | |||
@@ -44,8 +44,6 @@ my $flavour = shift; | |||
44 | my $output = shift; | 44 | my $output = shift; |
45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
46 | 46 | ||
47 | my $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
48 | |||
49 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; | 47 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; |
50 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 48 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
51 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 49 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -505,111 +503,6 @@ RC4_options: | |||
505 | .size RC4_options,.-RC4_options | 503 | .size RC4_options,.-RC4_options |
506 | ___ | 504 | ___ |
507 | } | 505 | } |
508 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
509 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
510 | if ($win64) { | ||
511 | my $rec="%rcx"; | ||
512 | my $frame="%rdx"; | ||
513 | my $context="%r8"; | ||
514 | my $disp="%r9"; | ||
515 | |||
516 | $code.=<<___; | ||
517 | .extern __imp_RtlVirtualUnwind | ||
518 | .type se_handler,\@abi-omnipotent | ||
519 | .align 16 | ||
520 | se_handler: | ||
521 | push %rsi | ||
522 | push %rdi | ||
523 | push %rbx | ||
524 | push %rbp | ||
525 | push %r12 | ||
526 | push %r13 | ||
527 | push %r14 | ||
528 | push %r15 | ||
529 | pushfq | ||
530 | sub \$64,%rsp | ||
531 | |||
532 | mov 120($context),%rax # pull context->Rax | ||
533 | mov 248($context),%rbx # pull context->Rip | ||
534 | |||
535 | lea .Lbody(%rip),%r10 | ||
536 | cmp %r10,%rbx # context->Rip<.Lbody | ||
537 | jb .Lin_prologue | ||
538 | |||
539 | mov 152($context),%rax # pull context->Rsp | ||
540 | |||
541 | lea .Lepilogue(%rip),%r10 | ||
542 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
543 | jae .Lin_prologue | ||
544 | |||
545 | mov 40(%rax),%r15 | ||
546 | mov 48(%rax),%r14 | ||
547 | mov 56(%rax),%r13 | ||
548 | mov 64(%rax),%r12 | ||
549 | mov 72(%rax),%rbp | ||
550 | mov 80(%rax),%rbx | ||
551 | lea 88(%rax),%rax | ||
552 | |||
553 | mov %rbx,144($context) # restore context->Rbx | ||
554 | mov %rbp,160($context) # restore context->Rbp | ||
555 | mov %r12,216($context) # restore context->R12 | ||
556 | mov %r13,224($context) # restore context->R12 | ||
557 | mov %r14,232($context) # restore context->R14 | ||
558 | mov %r15,240($context) # restore context->R15 | ||
559 | |||
560 | .Lin_prologue: | ||
561 | mov 8(%rax),%rdi | ||
562 | mov 16(%rax),%rsi | ||
563 | mov %rax,152($context) # restore context->Rsp | ||
564 | mov %rsi,168($context) # restore context->Rsi | ||
565 | mov %rdi,176($context) # restore context->Rdi | ||
566 | |||
567 | mov 40($disp),%rdi # disp->ContextRecord | ||
568 | mov $context,%rsi # context | ||
569 | mov \$154,%ecx # sizeof(CONTEXT) | ||
570 | .long 0xa548f3fc # cld; rep movsq | ||
571 | |||
572 | mov $disp,%rsi | ||
573 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
574 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
575 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
576 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
577 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
578 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
579 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
580 | mov %r10,32(%rsp) # arg5 | ||
581 | mov %r11,40(%rsp) # arg6 | ||
582 | mov %r12,48(%rsp) # arg7 | ||
583 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
584 | call *__imp_RtlVirtualUnwind(%rip) | ||
585 | |||
586 | mov \$1,%eax # ExceptionContinueSearch | ||
587 | add \$64,%rsp | ||
588 | popfq | ||
589 | pop %r15 | ||
590 | pop %r14 | ||
591 | pop %r13 | ||
592 | pop %r12 | ||
593 | pop %rbp | ||
594 | pop %rbx | ||
595 | pop %rdi | ||
596 | pop %rsi | ||
597 | ret | ||
598 | .size se_handler,.-se_handler | ||
599 | |||
600 | .section .pdata | ||
601 | .align 4 | ||
602 | .rva .LSEH_begin_$func | ||
603 | .rva .LSEH_end_$func | ||
604 | .rva .LSEH_info_$func | ||
605 | |||
606 | .section .xdata | ||
607 | .align 8 | ||
608 | .LSEH_info_$func: | ||
609 | .byte 9,0,0,0 | ||
610 | .rva se_handler | ||
611 | ___ | ||
612 | } | ||
613 | 506 | ||
614 | sub reg_part { | 507 | sub reg_part { |
615 | my ($reg,$conv)=@_; | 508 | my ($reg,$conv)=@_; |
diff --git a/src/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl b/src/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl index 75750dbf33..2bed1e279f 100755 --- a/src/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl +++ b/src/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl | |||
@@ -105,8 +105,6 @@ $flavour = shift; | |||
105 | $output = shift; | 105 | $output = shift; |
106 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 106 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
107 | 107 | ||
108 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
109 | |||
110 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 108 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
111 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 109 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
112 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 110 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -528,138 +526,6 @@ RC4_options: | |||
528 | .size RC4_options,.-RC4_options | 526 | .size RC4_options,.-RC4_options |
529 | ___ | 527 | ___ |
530 | 528 | ||
531 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
532 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
533 | if ($win64) { | ||
534 | $rec="%rcx"; | ||
535 | $frame="%rdx"; | ||
536 | $context="%r8"; | ||
537 | $disp="%r9"; | ||
538 | |||
539 | $code.=<<___; | ||
540 | .extern __imp_RtlVirtualUnwind | ||
541 | .type stream_se_handler,\@abi-omnipotent | ||
542 | .align 16 | ||
543 | stream_se_handler: | ||
544 | push %rsi | ||
545 | push %rdi | ||
546 | push %rbx | ||
547 | push %rbp | ||
548 | push %r12 | ||
549 | push %r13 | ||
550 | push %r14 | ||
551 | push %r15 | ||
552 | pushfq | ||
553 | sub \$64,%rsp | ||
554 | |||
555 | mov 120($context),%rax # pull context->Rax | ||
556 | mov 248($context),%rbx # pull context->Rip | ||
557 | |||
558 | lea .Lprologue(%rip),%r10 | ||
559 | cmp %r10,%rbx # context->Rip<prologue label | ||
560 | jb .Lin_prologue | ||
561 | |||
562 | mov 152($context),%rax # pull context->Rsp | ||
563 | |||
564 | lea .Lepilogue(%rip),%r10 | ||
565 | cmp %r10,%rbx # context->Rip>=epilogue label | ||
566 | jae .Lin_prologue | ||
567 | |||
568 | lea 24(%rax),%rax | ||
569 | |||
570 | mov -8(%rax),%rbx | ||
571 | mov -16(%rax),%r12 | ||
572 | mov -24(%rax),%r13 | ||
573 | mov %rbx,144($context) # restore context->Rbx | ||
574 | mov %r12,216($context) # restore context->R12 | ||
575 | mov %r13,224($context) # restore context->R13 | ||
576 | |||
577 | .Lin_prologue: | ||
578 | mov 8(%rax),%rdi | ||
579 | mov 16(%rax),%rsi | ||
580 | mov %rax,152($context) # restore context->Rsp | ||
581 | mov %rsi,168($context) # restore context->Rsi | ||
582 | mov %rdi,176($context) # restore context->Rdi | ||
583 | |||
584 | jmp .Lcommon_seh_exit | ||
585 | .size stream_se_handler,.-stream_se_handler | ||
586 | |||
587 | .type key_se_handler,\@abi-omnipotent | ||
588 | .align 16 | ||
589 | key_se_handler: | ||
590 | push %rsi | ||
591 | push %rdi | ||
592 | push %rbx | ||
593 | push %rbp | ||
594 | push %r12 | ||
595 | push %r13 | ||
596 | push %r14 | ||
597 | push %r15 | ||
598 | pushfq | ||
599 | sub \$64,%rsp | ||
600 | |||
601 | mov 152($context),%rax # pull context->Rsp | ||
602 | mov 8(%rax),%rdi | ||
603 | mov 16(%rax),%rsi | ||
604 | mov %rsi,168($context) # restore context->Rsi | ||
605 | mov %rdi,176($context) # restore context->Rdi | ||
606 | |||
607 | .Lcommon_seh_exit: | ||
608 | |||
609 | mov 40($disp),%rdi # disp->ContextRecord | ||
610 | mov $context,%rsi # context | ||
611 | mov \$154,%ecx # sizeof(CONTEXT) | ||
612 | .long 0xa548f3fc # cld; rep movsq | ||
613 | |||
614 | mov $disp,%rsi | ||
615 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
616 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
617 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
618 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
619 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
620 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
621 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
622 | mov %r10,32(%rsp) # arg5 | ||
623 | mov %r11,40(%rsp) # arg6 | ||
624 | mov %r12,48(%rsp) # arg7 | ||
625 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
626 | call *__imp_RtlVirtualUnwind(%rip) | ||
627 | |||
628 | mov \$1,%eax # ExceptionContinueSearch | ||
629 | add \$64,%rsp | ||
630 | popfq | ||
631 | pop %r15 | ||
632 | pop %r14 | ||
633 | pop %r13 | ||
634 | pop %r12 | ||
635 | pop %rbp | ||
636 | pop %rbx | ||
637 | pop %rdi | ||
638 | pop %rsi | ||
639 | ret | ||
640 | .size key_se_handler,.-key_se_handler | ||
641 | |||
642 | .section .pdata | ||
643 | .align 4 | ||
644 | .rva .LSEH_begin_RC4 | ||
645 | .rva .LSEH_end_RC4 | ||
646 | .rva .LSEH_info_RC4 | ||
647 | |||
648 | .rva .LSEH_begin_private_RC4_set_key | ||
649 | .rva .LSEH_end_private_RC4_set_key | ||
650 | .rva .LSEH_info_private_RC4_set_key | ||
651 | |||
652 | .section .xdata | ||
653 | .align 8 | ||
654 | .LSEH_info_RC4: | ||
655 | .byte 9,0,0,0 | ||
656 | .rva stream_se_handler | ||
657 | .LSEH_info_private_RC4_set_key: | ||
658 | .byte 9,0,0,0 | ||
659 | .rva key_se_handler | ||
660 | ___ | ||
661 | } | ||
662 | |||
663 | sub reg_part { | 529 | sub reg_part { |
664 | my ($reg,$conv)=@_; | 530 | my ($reg,$conv)=@_; |
665 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } | 531 | if ($reg =~ /%r[0-9]+/) { $reg .= $conv; } |
diff --git a/src/lib/libssl/src/crypto/sha/asm/sha512-x86_64.pl b/src/lib/libssl/src/crypto/sha/asm/sha512-x86_64.pl index 8d51678557..feb0f9e776 100755 --- a/src/lib/libssl/src/crypto/sha/asm/sha512-x86_64.pl +++ b/src/lib/libssl/src/crypto/sha/asm/sha512-x86_64.pl | |||
@@ -44,8 +44,6 @@ $flavour = shift; | |||
44 | $output = shift; | 44 | $output = shift; |
45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 45 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
46 | 46 | ||
47 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
48 | |||
49 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 47 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
50 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 48 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
51 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 49 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -339,113 +337,6 @@ $TABLE: | |||
339 | ___ | 337 | ___ |
340 | } | 338 | } |
341 | 339 | ||
342 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
343 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
344 | if ($win64) { | ||
345 | $rec="%rcx"; | ||
346 | $frame="%rdx"; | ||
347 | $context="%r8"; | ||
348 | $disp="%r9"; | ||
349 | |||
350 | $code.=<<___; | ||
351 | .extern __imp_RtlVirtualUnwind | ||
352 | .type se_handler,\@abi-omnipotent | ||
353 | .align 16 | ||
354 | se_handler: | ||
355 | push %rsi | ||
356 | push %rdi | ||
357 | push %rbx | ||
358 | push %rbp | ||
359 | push %r12 | ||
360 | push %r13 | ||
361 | push %r14 | ||
362 | push %r15 | ||
363 | pushfq | ||
364 | sub \$64,%rsp | ||
365 | |||
366 | mov 120($context),%rax # pull context->Rax | ||
367 | mov 248($context),%rbx # pull context->Rip | ||
368 | |||
369 | lea .Lprologue(%rip),%r10 | ||
370 | cmp %r10,%rbx # context->Rip<.Lprologue | ||
371 | jb .Lin_prologue | ||
372 | |||
373 | mov 152($context),%rax # pull context->Rsp | ||
374 | |||
375 | lea .Lepilogue(%rip),%r10 | ||
376 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
377 | jae .Lin_prologue | ||
378 | |||
379 | mov 16*$SZ+3*8(%rax),%rax # pull $_rsp | ||
380 | lea 48(%rax),%rax | ||
381 | |||
382 | mov -8(%rax),%rbx | ||
383 | mov -16(%rax),%rbp | ||
384 | mov -24(%rax),%r12 | ||
385 | mov -32(%rax),%r13 | ||
386 | mov -40(%rax),%r14 | ||
387 | mov -48(%rax),%r15 | ||
388 | mov %rbx,144($context) # restore context->Rbx | ||
389 | mov %rbp,160($context) # restore context->Rbp | ||
390 | mov %r12,216($context) # restore context->R12 | ||
391 | mov %r13,224($context) # restore context->R13 | ||
392 | mov %r14,232($context) # restore context->R14 | ||
393 | mov %r15,240($context) # restore context->R15 | ||
394 | |||
395 | .Lin_prologue: | ||
396 | mov 8(%rax),%rdi | ||
397 | mov 16(%rax),%rsi | ||
398 | mov %rax,152($context) # restore context->Rsp | ||
399 | mov %rsi,168($context) # restore context->Rsi | ||
400 | mov %rdi,176($context) # restore context->Rdi | ||
401 | |||
402 | mov 40($disp),%rdi # disp->ContextRecord | ||
403 | mov $context,%rsi # context | ||
404 | mov \$154,%ecx # sizeof(CONTEXT) | ||
405 | .long 0xa548f3fc # cld; rep movsq | ||
406 | |||
407 | mov $disp,%rsi | ||
408 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
409 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
410 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
411 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
412 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
413 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
414 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
415 | mov %r10,32(%rsp) # arg5 | ||
416 | mov %r11,40(%rsp) # arg6 | ||
417 | mov %r12,48(%rsp) # arg7 | ||
418 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
419 | call *__imp_RtlVirtualUnwind(%rip) | ||
420 | |||
421 | mov \$1,%eax # ExceptionContinueSearch | ||
422 | add \$64,%rsp | ||
423 | popfq | ||
424 | pop %r15 | ||
425 | pop %r14 | ||
426 | pop %r13 | ||
427 | pop %r12 | ||
428 | pop %rbp | ||
429 | pop %rbx | ||
430 | pop %rdi | ||
431 | pop %rsi | ||
432 | ret | ||
433 | .size se_handler,.-se_handler | ||
434 | |||
435 | .section .pdata | ||
436 | .align 4 | ||
437 | .rva .LSEH_begin_$func | ||
438 | .rva .LSEH_end_$func | ||
439 | .rva .LSEH_info_$func | ||
440 | |||
441 | .section .xdata | ||
442 | .align 8 | ||
443 | .LSEH_info_$func: | ||
444 | .byte 9,0,0,0 | ||
445 | .rva se_handler | ||
446 | ___ | ||
447 | } | ||
448 | |||
449 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 340 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
450 | print $code; | 341 | print $code; |
451 | close STDOUT; | 342 | close STDOUT; |
diff --git a/src/lib/libssl/src/crypto/whrlpool/asm/wp-x86_64.pl b/src/lib/libssl/src/crypto/whrlpool/asm/wp-x86_64.pl index 24b2ff60c3..afadd5d2f1 100644 --- a/src/lib/libssl/src/crypto/whrlpool/asm/wp-x86_64.pl +++ b/src/lib/libssl/src/crypto/whrlpool/asm/wp-x86_64.pl | |||
@@ -34,8 +34,6 @@ $flavour = shift; | |||
34 | $output = shift; | 34 | $output = shift; |
35 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } | 35 | if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } |
36 | 36 | ||
37 | $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); | ||
38 | |||
39 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; | 37 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate; |
40 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or | 38 | ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or |
41 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 39 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
@@ -478,113 +476,6 @@ ___ | |||
478 | &L(0xfb,0xee,0x7c,0x66,0xdd,0x17,0x47,0x9e); | 476 | &L(0xfb,0xee,0x7c,0x66,0xdd,0x17,0x47,0x9e); |
479 | &L(0xca,0x2d,0xbf,0x07,0xad,0x5a,0x83,0x33); | 477 | &L(0xca,0x2d,0xbf,0x07,0xad,0x5a,0x83,0x33); |
480 | 478 | ||
481 | # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, | ||
482 | # CONTEXT *context,DISPATCHER_CONTEXT *disp) | ||
483 | if ($win64) { | ||
484 | $rec="%rcx"; | ||
485 | $frame="%rdx"; | ||
486 | $context="%r8"; | ||
487 | $disp="%r9"; | ||
488 | |||
489 | $code.=<<___; | ||
490 | .extern __imp_RtlVirtualUnwind | ||
491 | .type se_handler,\@abi-omnipotent | ||
492 | .align 16 | ||
493 | se_handler: | ||
494 | push %rsi | ||
495 | push %rdi | ||
496 | push %rbx | ||
497 | push %rbp | ||
498 | push %r12 | ||
499 | push %r13 | ||
500 | push %r14 | ||
501 | push %r15 | ||
502 | pushfq | ||
503 | sub \$64,%rsp | ||
504 | |||
505 | mov 120($context),%rax # pull context->Rax | ||
506 | mov 248($context),%rbx # pull context->Rip | ||
507 | |||
508 | lea .Lprologue(%rip),%r10 | ||
509 | cmp %r10,%rbx # context->Rip<.Lprologue | ||
510 | jb .Lin_prologue | ||
511 | |||
512 | mov 152($context),%rax # pull context->Rsp | ||
513 | |||
514 | lea .Lepilogue(%rip),%r10 | ||
515 | cmp %r10,%rbx # context->Rip>=.Lepilogue | ||
516 | jae .Lin_prologue | ||
517 | |||
518 | mov 128+32(%rax),%rax # pull saved stack pointer | ||
519 | lea 48(%rax),%rax | ||
520 | |||
521 | mov -8(%rax),%rbx | ||
522 | mov -16(%rax),%rbp | ||
523 | mov -24(%rax),%r12 | ||
524 | mov -32(%rax),%r13 | ||
525 | mov -40(%rax),%r14 | ||
526 | mov -48(%rax),%r15 | ||
527 | mov %rbx,144($context) # restore context->Rbx | ||
528 | mov %rbp,160($context) # restore context->Rbp | ||
529 | mov %r12,216($context) # restore context->R12 | ||
530 | mov %r13,224($context) # restore context->R13 | ||
531 | mov %r14,232($context) # restore context->R14 | ||
532 | mov %r15,240($context) # restore context->R15 | ||
533 | |||
534 | .Lin_prologue: | ||
535 | mov 8(%rax),%rdi | ||
536 | mov 16(%rax),%rsi | ||
537 | mov %rax,152($context) # restore context->Rsp | ||
538 | mov %rsi,168($context) # restore context->Rsi | ||
539 | mov %rdi,176($context) # restore context->Rdi | ||
540 | |||
541 | mov 40($disp),%rdi # disp->ContextRecord | ||
542 | mov $context,%rsi # context | ||
543 | mov \$154,%ecx # sizeof(CONTEXT) | ||
544 | .long 0xa548f3fc # cld; rep movsq | ||
545 | |||
546 | mov $disp,%rsi | ||
547 | xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER | ||
548 | mov 8(%rsi),%rdx # arg2, disp->ImageBase | ||
549 | mov 0(%rsi),%r8 # arg3, disp->ControlPc | ||
550 | mov 16(%rsi),%r9 # arg4, disp->FunctionEntry | ||
551 | mov 40(%rsi),%r10 # disp->ContextRecord | ||
552 | lea 56(%rsi),%r11 # &disp->HandlerData | ||
553 | lea 24(%rsi),%r12 # &disp->EstablisherFrame | ||
554 | mov %r10,32(%rsp) # arg5 | ||
555 | mov %r11,40(%rsp) # arg6 | ||
556 | mov %r12,48(%rsp) # arg7 | ||
557 | mov %rcx,56(%rsp) # arg8, (NULL) | ||
558 | call *__imp_RtlVirtualUnwind(%rip) | ||
559 | |||
560 | mov \$1,%eax # ExceptionContinueSearch | ||
561 | add \$64,%rsp | ||
562 | popfq | ||
563 | pop %r15 | ||
564 | pop %r14 | ||
565 | pop %r13 | ||
566 | pop %r12 | ||
567 | pop %rbp | ||
568 | pop %rbx | ||
569 | pop %rdi | ||
570 | pop %rsi | ||
571 | ret | ||
572 | .size se_handler,.-se_handler | ||
573 | |||
574 | .section .pdata | ||
575 | .align 4 | ||
576 | .rva .LSEH_begin_$func | ||
577 | .rva .LSEH_end_$func | ||
578 | .rva .LSEH_info_$func | ||
579 | |||
580 | .section .xdata | ||
581 | .align 8 | ||
582 | .LSEH_info_$func: | ||
583 | .byte 9,0,0,0 | ||
584 | .rva se_handler | ||
585 | ___ | ||
586 | } | ||
587 | |||
588 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 479 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
589 | print $code; | 480 | print $code; |
590 | close STDOUT; | 481 | close STDOUT; |