29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
|
diff -up libgcrypt-1.4.4/random/rndhw.c.padlock libgcrypt-1.4.4/random/rndhw.c
|
||
|
--- libgcrypt-1.4.4/random/rndhw.c.padlock 2008-09-03 12:04:43.000000000 +0200
|
||
|
+++ libgcrypt-1.4.4/random/rndhw.c 2009-06-17 20:11:42.000000000 +0200
|
||
|
@@ -41,7 +41,7 @@ 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)));
|
||
|
+ volatile char buffer[64+8] __attribute__ ((aligned (8)));
|
||
|
char *p;
|
||
|
unsigned int nbytes, status;
|
||
|
|
||
|
@@ -55,12 +55,11 @@ poll_padlock (void (*add)(const void*, s
|
||
|
nbytes = 0;
|
||
|
while (nbytes < 64)
|
||
|
{
|
||
|
- asm volatile
|
||
|
+ asm volatile
|
||
|
("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)
|
||
|
+ ".byte 0x0f, 0xa7, 0xc0\n" /* XSTORE RNG. */
|
||
|
+ : "=a" (status)
|
||
|
: "g" (p)
|
||
|
: "%edx", "%edi", "cc"
|
||
|
);
|