diff options
author | Andy Polyakov <appro@openssl.org> | 2011-06-04 12:20:45 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2011-06-04 12:20:45 +0000 |
commit | 301799b803fc9f3e2adaad32b1ccace736bbe7cc (patch) | |
tree | 0edc73d8425ac47b5124104760cb0294c53b214f /crypto/x86cpuid.pl | |
parent | 8d515259e2a4631a5b42f1a072b0ff6f8eba189c (diff) |
x86[_64]cpuid.pl: add function accessing rdrand instruction.
Diffstat (limited to 'crypto/x86cpuid.pl')
-rw-r--r-- | crypto/x86cpuid.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl index 70c8a2d671..6595ff35fc 100644 --- a/crypto/x86cpuid.pl +++ b/crypto/x86cpuid.pl @@ -442,6 +442,18 @@ my $max = "ebp"; &function_end("OPENSSL_instrument_bus2"); } +&function_begin_B("OPENSSL_ia32_rdrand"); + &mov ("ecx",8); +&set_label("loop"); + &rdrand ("eax"); + &jc (&label("break")); + &loop (&label("loop")); +&set_label("break"); + &cmp ("eax",0); + &cmove ("eax","ecx"); + &ret (); +&function_end_B("OPENSSL_ia32_rdrand"); + &initseg("OPENSSL_cpuid_setup"); &asm_finish(); |