uplink-x86.pl 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! /usr/bin/env perl
  2. # Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (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 and open STDOUT,">$output";
  13. &asm_init($ARGV[0]);
  14. &external_label("OPENSSL_Uplink");
  15. &public_label("OPENSSL_UplinkTable");
  16. for ($i=1;$i<=$N;$i++) {
  17. &function_begin_B("_\$lazy${i}");
  18. &lea ("eax",&DWP(&label("OPENSSL_UplinkTable")));
  19. &push ($i);
  20. &push ("eax");
  21. &call (&label("OPENSSL_Uplink"));
  22. &pop ("eax");
  23. &add ("esp",4);
  24. &jmp_ptr(&DWP(4*$i,"eax"));
  25. &function_end_B("_\$lazy${i}");
  26. }
  27. &dataseg();
  28. &align(4);
  29. &set_label("OPENSSL_UplinkTable");
  30. &data_word($N);
  31. for ($i=1;$i<=$N;$i++) {
  32. &data_word(&label("_\$lazy${i}"));
  33. }
  34. &asm_finish();
  35. close STDOUT;