|
Packit Service |
084de1 |
#! /usr/bin/env perl
|
|
Packit Service |
084de1 |
# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit Service |
084de1 |
#
|
|
Packit Service |
084de1 |
# Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit Service |
084de1 |
# this file except in compliance with the License. You can obtain a copy
|
|
Packit Service |
084de1 |
# in the file LICENSE in the source distribution or at
|
|
Packit Service |
084de1 |
# https://www.openssl.org/source/license.html
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
$output = pop;
|
|
Packit Service |
084de1 |
open STDOUT,">$output";
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
print <<'___';
|
|
Packit Service |
084de1 |
.text
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.set noat
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl OPENSSL_cpuid_setup
|
|
Packit Service |
084de1 |
.ent OPENSSL_cpuid_setup
|
|
Packit Service |
084de1 |
OPENSSL_cpuid_setup:
|
|
Packit Service |
084de1 |
.frame $30,0,$26
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
ret ($26)
|
|
Packit Service |
084de1 |
.end OPENSSL_cpuid_setup
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl OPENSSL_wipe_cpu
|
|
Packit Service |
084de1 |
.ent OPENSSL_wipe_cpu
|
|
Packit Service |
084de1 |
OPENSSL_wipe_cpu:
|
|
Packit Service |
084de1 |
.frame $30,0,$26
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
clr $1
|
|
Packit Service |
084de1 |
clr $2
|
|
Packit Service |
084de1 |
clr $3
|
|
Packit Service |
084de1 |
clr $4
|
|
Packit Service |
084de1 |
clr $5
|
|
Packit Service |
084de1 |
clr $6
|
|
Packit Service |
084de1 |
clr $7
|
|
Packit Service |
084de1 |
clr $8
|
|
Packit Service |
084de1 |
clr $16
|
|
Packit Service |
084de1 |
clr $17
|
|
Packit Service |
084de1 |
clr $18
|
|
Packit Service |
084de1 |
clr $19
|
|
Packit Service |
084de1 |
clr $20
|
|
Packit Service |
084de1 |
clr $21
|
|
Packit Service |
084de1 |
clr $22
|
|
Packit Service |
084de1 |
clr $23
|
|
Packit Service |
084de1 |
clr $24
|
|
Packit Service |
084de1 |
clr $25
|
|
Packit Service |
084de1 |
clr $27
|
|
Packit Service |
084de1 |
clr $at
|
|
Packit Service |
084de1 |
clr $29
|
|
Packit Service |
084de1 |
fclr $f0
|
|
Packit Service |
084de1 |
fclr $f1
|
|
Packit Service |
084de1 |
fclr $f10
|
|
Packit Service |
084de1 |
fclr $f11
|
|
Packit Service |
084de1 |
fclr $f12
|
|
Packit Service |
084de1 |
fclr $f13
|
|
Packit Service |
084de1 |
fclr $f14
|
|
Packit Service |
084de1 |
fclr $f15
|
|
Packit Service |
084de1 |
fclr $f16
|
|
Packit Service |
084de1 |
fclr $f17
|
|
Packit Service |
084de1 |
fclr $f18
|
|
Packit Service |
084de1 |
fclr $f19
|
|
Packit Service |
084de1 |
fclr $f20
|
|
Packit Service |
084de1 |
fclr $f21
|
|
Packit Service |
084de1 |
fclr $f22
|
|
Packit Service |
084de1 |
fclr $f23
|
|
Packit Service |
084de1 |
fclr $f24
|
|
Packit Service |
084de1 |
fclr $f25
|
|
Packit Service |
084de1 |
fclr $f26
|
|
Packit Service |
084de1 |
fclr $f27
|
|
Packit Service |
084de1 |
fclr $f28
|
|
Packit Service |
084de1 |
fclr $f29
|
|
Packit Service |
084de1 |
fclr $f30
|
|
Packit Service |
084de1 |
mov $sp,$0
|
|
Packit Service |
084de1 |
ret ($26)
|
|
Packit Service |
084de1 |
.end OPENSSL_wipe_cpu
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl OPENSSL_atomic_add
|
|
Packit Service |
084de1 |
.ent OPENSSL_atomic_add
|
|
Packit Service |
084de1 |
OPENSSL_atomic_add:
|
|
Packit Service |
084de1 |
.frame $30,0,$26
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
1: ldl_l $0,0($16)
|
|
Packit Service |
084de1 |
addl $0,$17,$1
|
|
Packit Service |
084de1 |
stl_c $1,0($16)
|
|
Packit Service |
084de1 |
beq $1,1b
|
|
Packit Service |
084de1 |
addl $0,$17,$0
|
|
Packit Service |
084de1 |
ret ($26)
|
|
Packit Service |
084de1 |
.end OPENSSL_atomic_add
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl OPENSSL_rdtsc
|
|
Packit Service |
084de1 |
.ent OPENSSL_rdtsc
|
|
Packit Service |
084de1 |
OPENSSL_rdtsc:
|
|
Packit Service |
084de1 |
.frame $30,0,$26
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
rpcc $0
|
|
Packit Service |
084de1 |
ret ($26)
|
|
Packit Service |
084de1 |
.end OPENSSL_rdtsc
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl OPENSSL_cleanse
|
|
Packit Service |
084de1 |
.ent OPENSSL_cleanse
|
|
Packit Service |
084de1 |
OPENSSL_cleanse:
|
|
Packit Service |
084de1 |
.frame $30,0,$26
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
beq $17,.Ldone
|
|
Packit Service |
084de1 |
and $16,7,$0
|
|
Packit Service |
084de1 |
bic $17,7,$at
|
|
Packit Service |
084de1 |
beq $at,.Little
|
|
Packit Service |
084de1 |
beq $0,.Laligned
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.Little:
|
|
Packit Service |
084de1 |
subq $0,8,$0
|
|
Packit Service |
084de1 |
ldq_u $1,0($16)
|
|
Packit Service |
084de1 |
mov $16,$2
|
|
Packit Service |
084de1 |
.Lalign:
|
|
Packit Service |
084de1 |
mskbl $1,$16,$1
|
|
Packit Service |
084de1 |
lda $16,1($16)
|
|
Packit Service |
084de1 |
subq $17,1,$17
|
|
Packit Service |
084de1 |
addq $0,1,$0
|
|
Packit Service |
084de1 |
beq $17,.Lout
|
|
Packit Service |
084de1 |
bne $0,.Lalign
|
|
Packit Service |
084de1 |
.Lout: stq_u $1,0($2)
|
|
Packit Service |
084de1 |
beq $17,.Ldone
|
|
Packit Service |
084de1 |
bic $17,7,$at
|
|
Packit Service |
084de1 |
beq $at,.Little
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.Laligned:
|
|
Packit Service |
084de1 |
stq $31,0($16)
|
|
Packit Service |
084de1 |
subq $17,8,$17
|
|
Packit Service |
084de1 |
lda $16,8($16)
|
|
Packit Service |
084de1 |
bic $17,7,$at
|
|
Packit Service |
084de1 |
bne $at,.Laligned
|
|
Packit Service |
084de1 |
bne $17,.Little
|
|
Packit Service |
084de1 |
.Ldone: ret ($26)
|
|
Packit Service |
084de1 |
.end OPENSSL_cleanse
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl CRYPTO_memcmp
|
|
Packit Service |
084de1 |
.ent CRYPTO_memcmp
|
|
Packit Service |
084de1 |
CRYPTO_memcmp:
|
|
Packit Service |
084de1 |
.frame $30,0,$26
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
xor $0,$0,$0
|
|
Packit Service |
084de1 |
beq $18,.Lno_data
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
xor $1,$1,$1
|
|
Packit Service |
084de1 |
nop
|
|
Packit Service |
084de1 |
.Loop_cmp:
|
|
Packit Service |
084de1 |
ldq_u $2,0($16)
|
|
Packit Service |
084de1 |
subq $18,1,$18
|
|
Packit Service |
084de1 |
ldq_u $3,0($17)
|
|
Packit Service |
084de1 |
extbl $2,$16,$2
|
|
Packit Service |
084de1 |
lda $16,1($16)
|
|
Packit Service |
084de1 |
extbl $3,$17,$3
|
|
Packit Service |
084de1 |
lda $17,1($17)
|
|
Packit Service |
084de1 |
xor $3,$2,$2
|
|
Packit Service |
084de1 |
or $2,$0,$0
|
|
Packit Service |
084de1 |
bne $18,.Loop_cmp
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
subq $31,$0,$0
|
|
Packit Service |
084de1 |
srl $0,63,$0
|
|
Packit Service |
084de1 |
.Lno_data:
|
|
Packit Service |
084de1 |
ret ($26)
|
|
Packit Service |
084de1 |
.end CRYPTO_memcmp
|
|
Packit Service |
084de1 |
___
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
my ($out,$cnt,$max)=("\$16","\$17","\$18");
|
|
Packit Service |
084de1 |
my ($tick,$lasttick)=("\$19","\$20");
|
|
Packit Service |
084de1 |
my ($diff,$lastdiff)=("\$21","\$22");
|
|
Packit Service |
084de1 |
my ($v0,$ra,$sp,$zero)=("\$0","\$26","\$30","\$31");
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
print <<___;
|
|
Packit Service |
084de1 |
.globl OPENSSL_instrument_bus
|
|
Packit Service |
084de1 |
.ent OPENSSL_instrument_bus
|
|
Packit Service |
084de1 |
OPENSSL_instrument_bus:
|
|
Packit Service |
084de1 |
.frame $sp,0,$ra
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
mov $cnt,$v0
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
rpcc $lasttick
|
|
Packit Service |
084de1 |
mov 0,$diff
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
ecb ($out)
|
|
Packit Service |
084de1 |
ldl_l $tick,0($out)
|
|
Packit Service |
084de1 |
addl $diff,$tick,$tick
|
|
Packit Service |
084de1 |
mov $tick,$diff
|
|
Packit Service |
084de1 |
stl_c $tick,0($out)
|
|
Packit Service |
084de1 |
stl $diff,0($out)
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.Loop: rpcc $tick
|
|
Packit Service |
084de1 |
subq $tick,$lasttick,$diff
|
|
Packit Service |
084de1 |
mov $tick,$lasttick
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
ecb ($out)
|
|
Packit Service |
084de1 |
ldl_l $tick,0($out)
|
|
Packit Service |
084de1 |
addl $diff,$tick,$tick
|
|
Packit Service |
084de1 |
mov $tick,$diff
|
|
Packit Service |
084de1 |
stl_c $tick,0($out)
|
|
Packit Service |
084de1 |
stl $diff,0($out)
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
subl $cnt,1,$cnt
|
|
Packit Service |
084de1 |
lda $out,4($out)
|
|
Packit Service |
084de1 |
bne $cnt,.Loop
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
ret ($ra)
|
|
Packit Service |
084de1 |
.end OPENSSL_instrument_bus
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.globl OPENSSL_instrument_bus2
|
|
Packit Service |
084de1 |
.ent OPENSSL_instrument_bus2
|
|
Packit Service |
084de1 |
OPENSSL_instrument_bus2:
|
|
Packit Service |
084de1 |
.frame $sp,0,$ra
|
|
Packit Service |
084de1 |
.prologue 0
|
|
Packit Service |
084de1 |
mov $cnt,$v0
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
rpcc $lasttick
|
|
Packit Service |
084de1 |
mov 0,$diff
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
ecb ($out)
|
|
Packit Service |
084de1 |
ldl_l $tick,0($out)
|
|
Packit Service |
084de1 |
addl $diff,$tick,$tick
|
|
Packit Service |
084de1 |
mov $tick,$diff
|
|
Packit Service |
084de1 |
stl_c $tick,0($out)
|
|
Packit Service |
084de1 |
stl $diff,0($out)
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
rpcc $tick
|
|
Packit Service |
084de1 |
subq $tick,$lasttick,$diff
|
|
Packit Service |
084de1 |
mov $tick,$lasttick
|
|
Packit Service |
084de1 |
mov $diff,$lastdiff
|
|
Packit Service |
084de1 |
.Loop2:
|
|
Packit Service |
084de1 |
ecb ($out)
|
|
Packit Service |
084de1 |
ldl_l $tick,0($out)
|
|
Packit Service |
084de1 |
addl $diff,$tick,$tick
|
|
Packit Service |
084de1 |
mov $tick,$diff
|
|
Packit Service |
084de1 |
stl_c $tick,0($out)
|
|
Packit Service |
084de1 |
stl $diff,0($out)
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
subl $max,1,$max
|
|
Packit Service |
084de1 |
beq $max,.Ldone2
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
rpcc $tick
|
|
Packit Service |
084de1 |
subq $tick,$lasttick,$diff
|
|
Packit Service |
084de1 |
mov $tick,$lasttick
|
|
Packit Service |
084de1 |
subq $lastdiff,$diff,$tick
|
|
Packit Service |
084de1 |
mov $diff,$lastdiff
|
|
Packit Service |
084de1 |
cmovne $tick,1,$tick
|
|
Packit Service |
084de1 |
subl $cnt,$tick,$cnt
|
|
Packit Service |
084de1 |
s4addq $tick,$out,$out
|
|
Packit Service |
084de1 |
bne $cnt,.Loop2
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
.Ldone2:
|
|
Packit Service |
084de1 |
subl $v0,$cnt,$v0
|
|
Packit Service |
084de1 |
ret ($ra)
|
|
Packit Service |
084de1 |
.end OPENSSL_instrument_bus2
|
|
Packit Service |
084de1 |
___
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
close STDOUT or die "error closing STDOUT: $!";
|