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