xref: /freebsd/crypto/openssl/ms/uplink-ia64.pl (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1*e0c4386eSCy Schubert#! /usr/bin/env perl
2*e0c4386eSCy Schubert# Copyright 2008-2016 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$output = pop and open STDOUT,">$output";
10*e0c4386eSCy Schubert
11*e0c4386eSCy Schubert$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
12*e0c4386eSCy Schubertpush(@INC,"${dir}.");
13*e0c4386eSCy Schubert
14*e0c4386eSCy Schubertrequire "uplink-common.pl";
15*e0c4386eSCy Schubert
16*e0c4386eSCy Schubertlocal $V=8;	# max number of args uplink functions may accept...
17*e0c4386eSCy Schubertmy $loc0 = "r".(32+$V);
18*e0c4386eSCy Schubertprint <<___;
19*e0c4386eSCy Schubert.text
20*e0c4386eSCy Schubert.global	OPENSSL_Uplink#
21*e0c4386eSCy Schubert.type	OPENSSL_Uplink#,\@function
22*e0c4386eSCy Schubert
23*e0c4386eSCy Schubert___
24*e0c4386eSCy Schubertfor ($i=1;$i<=$N;$i++) {
25*e0c4386eSCy Schubertprint <<___;
26*e0c4386eSCy Schubert.proc	lazy$i#
27*e0c4386eSCy Schubertlazy$i:
28*e0c4386eSCy Schubert	.prologue
29*e0c4386eSCy Schubert{ .mii;	.save	ar.pfs,$loc0
30*e0c4386eSCy Schubert	alloc	loc0=ar.pfs,$V,3,2,0
31*e0c4386eSCy Schubert	.save	b0,loc1
32*e0c4386eSCy Schubert	mov	loc1=b0
33*e0c4386eSCy Schubert	addl	loc2=\@ltoff(OPENSSL_UplinkTable#),gp	};;
34*e0c4386eSCy Schubert	.body
35*e0c4386eSCy Schubert{ .mmi;	ld8	out0=[loc2]
36*e0c4386eSCy Schubert	mov	out1=$i					};;
37*e0c4386eSCy Schubert{ .mib;	add	loc2=8*$i,out0
38*e0c4386eSCy Schubert	br.call.sptk.many	b0=OPENSSL_Uplink#	};;
39*e0c4386eSCy Schubert{ .mmi;	ld8	r31=[loc2];;
40*e0c4386eSCy Schubert	ld8	r30=[r31],8				};;
41*e0c4386eSCy Schubert{ .mii;	ld8	gp=[r31]
42*e0c4386eSCy Schubert	mov	b6=r30
43*e0c4386eSCy Schubert	mov	b0=loc1					};;
44*e0c4386eSCy Schubert{ .mib;	mov	ar.pfs=loc0
45*e0c4386eSCy Schubert	br.many	b6					};;
46*e0c4386eSCy Schubert.endp	lazy$i#
47*e0c4386eSCy Schubert
48*e0c4386eSCy Schubert___
49*e0c4386eSCy Schubert}
50*e0c4386eSCy Schubertprint <<___;
51*e0c4386eSCy Schubert.data
52*e0c4386eSCy Schubert.global OPENSSL_UplinkTable#
53*e0c4386eSCy SchubertOPENSSL_UplinkTable:    data8   $N      // amount of following entries
54*e0c4386eSCy Schubert___
55*e0c4386eSCy Schubertfor ($i=1;$i<=$N;$i++) {   print "      data8   \@fptr(lazy$i#)\n";   }
56*e0c4386eSCy Schubertprint <<___;
57*e0c4386eSCy Schubert.size   OPENSSL_UplinkTable,.-OPENSSL_UplinkTable#
58*e0c4386eSCy Schubert___
59*e0c4386eSCy Schubert
60*e0c4386eSCy Schubertclose STDOUT;
61