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/lib/libcrypto/whrlpool | |
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/lib/libcrypto/whrlpool')
-rw-r--r-- | src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl | 109 |
1 files changed, 0 insertions, 109 deletions
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; |