summaryrefslogtreecommitdiff
path: root/random
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-07-02 14:12:44 +0000
committerWerner Koch <wk@gnupg.org>2009-07-02 14:12:44 +0000
commitab9ff33b9b55db3077af87bf321937e3fd9826c8 (patch)
treef31e7adbb9cd16e69a9bba96cd85ace324394186 /random
parent72cf93388c0aedc50e66dc2ece236a919d4eaf42 (diff)
downloadlibgcrypt-ab9ff33b9b55db3077af87bf321937e3fd9826c8.tar.gz
Get more in sync to the Fedora version.
Diffstat (limited to 'random')
-rw-r--r--random/ChangeLog6
-rw-r--r--random/rndhw.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/random/ChangeLog b/random/ChangeLog
index c3bcb584..c64671c4 100644
--- a/random/ChangeLog
+++ b/random/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-02 Werner Koch <wk@g10code.com>
+
+ * rndhw.c (poll_padlock): Asm change from Fedora.
+
2009-01-22 Werner Koch <wk@g10code.com>
* random.c (_gcry_random_deinit_external_test): Do not return a
@@ -125,4 +129,4 @@
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- \ No newline at end of file
+
diff --git a/random/rndhw.c b/random/rndhw.c
index 2c78b47c..0961d106 100644
--- a/random/rndhw.c
+++ b/random/rndhw.c
@@ -41,8 +41,8 @@ static size_t
poll_padlock (void (*add)(const void*, size_t, enum random_origins),
enum random_origins origin, int fast)
{
- char buffer[64+8] __attribute__ ((aligned (8)));
- char *p;
+ volatile char buffer[64+8] __attribute__ ((aligned (8)));
+ volatile char *p;
unsigned int nbytes, status;
/* Peter Gutmann's cryptlib tests again whether the RNG is enabled
@@ -59,8 +59,7 @@ poll_padlock (void (*add)(const void*, size_t, enum random_origins),
("movl %1, %%edi\n\t" /* Set buffer. */
"xorl %%edx, %%edx\n\t" /* Request up to 8 bytes. */
".byte 0x0f, 0xa7, 0xc0\n\t" /* XSTORE RNG. */
- "movl %%eax, %0\n" /* Return the status. */
- : "=g" (status)
+ : "=a" (status)
: "g" (p)
: "%edx", "%edi", "cc"
);
@@ -88,7 +87,7 @@ poll_padlock (void (*add)(const void*, size_t, enum random_origins),
if (nbytes)
{
- (*add) (buffer, nbytes, origin);
+ (*add) ((void*)buffer, nbytes, origin);
wipememory (buffer, nbytes);
}
return nbytes;