diff options
| author | beck <> | 2001-06-22 00:03:44 +0000 |
|---|---|---|
| committer | beck <> | 2001-06-22 00:03:44 +0000 |
| commit | 38b6ff9e5294811c57541ad47940f8f8f41dc114 (patch) | |
| tree | 402699541cee3cf3f2943b0384dbda7de534de70 /src/lib/libcrypto/rand/rand_win.c | |
| parent | afae624d63e4e717c5bae8c7842a4712309f728f (diff) | |
| download | openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.gz openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.bz2 openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.zip | |
openssl-engine-0.9.6a merge
Diffstat (limited to 'src/lib/libcrypto/rand/rand_win.c')
| -rw-r--r-- | src/lib/libcrypto/rand/rand_win.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rand/rand_win.c b/src/lib/libcrypto/rand/rand_win.c index 9f2dcff9a9..3d137badd0 100644 --- a/src/lib/libcrypto/rand/rand_win.c +++ b/src/lib/libcrypto/rand/rand_win.c | |||
| @@ -570,14 +570,15 @@ static void readtimer(void) | |||
| 570 | DWORD w; | 570 | DWORD w; |
| 571 | LARGE_INTEGER l; | 571 | LARGE_INTEGER l; |
| 572 | static int have_perfc = 1; | 572 | static int have_perfc = 1; |
| 573 | #ifndef __GNUC__ | 573 | #ifdef _MSC_VER |
| 574 | static int have_tsc = 1; | 574 | static int have_tsc = 1; |
| 575 | DWORD cyclecount; | 575 | DWORD cyclecount; |
| 576 | 576 | ||
| 577 | if (have_tsc) { | 577 | if (have_tsc) { |
| 578 | __try { | 578 | __try { |
| 579 | __asm { | 579 | __asm { |
| 580 | rdtsc | 580 | _emit 0x0f |
| 581 | _emit 0x31 | ||
| 581 | mov cyclecount, eax | 582 | mov cyclecount, eax |
| 582 | } | 583 | } |
| 583 | RAND_add(&cyclecount, sizeof(cyclecount), 1); | 584 | RAND_add(&cyclecount, sizeof(cyclecount), 1); |
| @@ -725,8 +726,9 @@ int RAND_poll(void) | |||
| 725 | 726 | ||
| 726 | #ifdef DEVRANDOM | 727 | #ifdef DEVRANDOM |
| 727 | return 1; | 728 | return 1; |
| 728 | #endif | 729 | #else |
| 729 | return 0; | 730 | return 0; |
| 731 | #endif | ||
| 730 | } | 732 | } |
| 731 | 733 | ||
| 732 | #endif | 734 | #endif |
