x86cpuid.pl (238405) | x86cpuid.pl (246772) |
---|---|
1#!/usr/bin/env perl 2 3$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; 4push(@INC, "${dir}perlasm", "perlasm"); 5require "x86asm.pl"; 6 7&asm_init($ARGV[0],"x86cpuid"); 8 --- 151 unchanged lines hidden (view full) --- 160 &bt (&DWP(0,"ecx"),4); 161 &jnc (&label("nohalt")); # no TSC 162 163 &data_word(0x9058900e); # push %cs; pop %eax 164 &and ("eax",3); 165 &jnz (&label("nohalt")); # not enough privileges 166 167 &pushf (); | 1#!/usr/bin/env perl 2 3$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; 4push(@INC, "${dir}perlasm", "perlasm"); 5require "x86asm.pl"; 6 7&asm_init($ARGV[0],"x86cpuid"); 8 --- 151 unchanged lines hidden (view full) --- 160 &bt (&DWP(0,"ecx"),4); 161 &jnc (&label("nohalt")); # no TSC 162 163 &data_word(0x9058900e); # push %cs; pop %eax 164 &and ("eax",3); 165 &jnz (&label("nohalt")); # not enough privileges 166 167 &pushf (); |
168 &pop ("eax") | 168 &pop ("eax"); |
169 &bt ("eax",9); 170 &jnc (&label("nohalt")); # interrupts are disabled 171 172 &rdtsc (); 173 &push ("edx"); 174 &push ("eax"); 175 &halt (); 176 &rdtsc (); --- 98 unchanged lines hidden (view full) --- 275# ... 276# OPENSSL_indirect_call(func,[up to $max arguments]); 277#endif 278# 279# (*) it's designed to work even for __fastcall if number of 280# arguments is 1 or 2! 281&function_begin_B("OPENSSL_indirect_call"); 282 { | 169 &bt ("eax",9); 170 &jnc (&label("nohalt")); # interrupts are disabled 171 172 &rdtsc (); 173 &push ("edx"); 174 &push ("eax"); 175 &halt (); 176 &rdtsc (); --- 98 unchanged lines hidden (view full) --- 275# ... 276# OPENSSL_indirect_call(func,[up to $max arguments]); 277#endif 278# 279# (*) it's designed to work even for __fastcall if number of 280# arguments is 1 or 2! 281&function_begin_B("OPENSSL_indirect_call"); 282 { |
283 my $i,$max=7; # $max has to be chosen as 4*n-1 | 283 my ($max,$i)=(7,); # $max has to be chosen as 4*n-1 |
284 # in order to preserve eventual 285 # stack alignment 286 &push ("ebp"); 287 &mov ("ebp","esp"); 288 &sub ("esp",$max*4); 289 &mov ("ecx",&DWP(12,"ebp")); 290 &mov (&DWP(0,"esp"),"ecx"); 291 &mov ("edx",&DWP(16,"ebp")); --- 65 unchanged lines hidden --- | 284 # in order to preserve eventual 285 # stack alignment 286 &push ("ebp"); 287 &mov ("ebp","esp"); 288 &sub ("esp",$max*4); 289 &mov ("ecx",&DWP(12,"ebp")); 290 &mov (&DWP(0,"esp"),"ecx"); 291 &mov ("edx",&DWP(16,"ebp")); --- 65 unchanged lines hidden --- |