summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mpi/amd64/mpi-asm-defs.h4
-rw-r--r--random/rndhw.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/mpi/amd64/mpi-asm-defs.h b/mpi/amd64/mpi-asm-defs.h
new file mode 100644
index 00000000..65190653
--- /dev/null
+++ b/mpi/amd64/mpi-asm-defs.h
@@ -0,0 +1,4 @@
+/* This file defines some basic constants for the MPI machinery. We
+ * need to define the types on a per-CPU basis, so it is done with
+ * this file here. */
+#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG_LONG)
diff --git a/random/rndhw.c b/random/rndhw.c
index ca99c5f8..e625512d 100644
--- a/random/rndhw.c
+++ b/random/rndhw.c
@@ -69,7 +69,7 @@ poll_padlock (void (*add)(const void*, size_t, enum random_origins),
nbytes = 0;
while (nbytes < 64)
{
-#ifdef __x86_64__
+#if defined(__x86_64__) && defined(__LP64__)
asm volatile
("movq %1, %%rdi\n\t" /* Set buffer. */
"xorq %%rdx, %%rdx\n\t" /* Request up to 8 bytes. */
@@ -123,7 +123,7 @@ poll_padlock (void (*add)(const void*, size_t, enum random_origins),
#ifdef USE_DRNG
# define RDRAND_RETRY_LOOPS 10
# define RDRAND_INT ".byte 0x0f,0xc7,0xf0"
-# ifdef __x86_64__
+# if defined(__x86_64__) && defined(__LP64__)
# define RDRAND_LONG ".byte 0x48,0x0f,0xc7,0xf0"
# else
# define RDRAND_LONG RDRAND_INT