summaryrefslogtreecommitdiff
path: root/random/rndhw.c
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/rndhw.c
parent72cf93388c0aedc50e66dc2ece236a919d4eaf42 (diff)
downloadlibgcrypt-ab9ff33b9b55db3077af87bf321937e3fd9826c8.tar.gz
Get more in sync to the Fedora version.
Diffstat (limited to 'random/rndhw.c')
-rw-r--r--random/rndhw.c9
1 files changed, 4 insertions, 5 deletions
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;