uplink-x86.pl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #! /usr/bin/env perl
  2. # Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the OpenSSL license (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
  9. push(@INC, "${dir}.", "${dir}../crypto/perlasm");
  10. require "x86asm.pl";
  11. require "uplink-common.pl";
  12. $output = pop;
  13. open STDOUT,">$output";
  14. &asm_init($ARGV[0]);
  15. &external_label("OPENSSL_Uplink");
  16. &public_label("OPENSSL_UplinkTable");
  17. for ($i=1;$i<=$N;$i++) {
  18. &function_begin_B("_\$lazy${i}");
  19. &lea ("eax",&DWP(&label("OPENSSL_UplinkTable")));
  20. &push ($i);
  21. &push ("eax");
  22. &call (&label("OPENSSL_Uplink"));
  23. &pop ("eax");
  24. &add ("esp",4);
  25. &jmp_ptr(&DWP(4*$i,"eax"));
  26. &function_end_B("_\$lazy${i}");
  27. }
  28. &dataseg();
  29. &align(4);
  30. &set_label("OPENSSL_UplinkTable");
  31. &data_word($N);
  32. for ($i=1;$i<=$N;$i++) {
  33. &data_word(&label("_\$lazy${i}"));
  34. }
  35. &asm_finish();
  36. close STDOUT;