summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-01-02 04:39:57 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-01-02 04:39:57 +0000
commit9cfb17f6fef764ad78060f0dd052291ff9ca99c3 (patch)
treee3f34aec18027f2a50a37d75b9bcea1ac74072d0 /sys/arch/i386/stand
parent5d1e919f595c95a96b8b11889a5f68e5f8e4477f (diff)
Simplify things slightly by using four byte indexing.
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r--sys/arch/i386/stand/libsa/random_i386.S9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/arch/i386/stand/libsa/random_i386.S b/sys/arch/i386/stand/libsa/random_i386.S
index 03c2f21a3be..568c8bb4daf 100644
--- a/sys/arch/i386/stand/libsa/random_i386.S
+++ b/sys/arch/i386/stand/libsa/random_i386.S
@@ -55,7 +55,6 @@ ENTRY(mdrandom)
movl 36(%esp), %ebx
movl 40(%esp), %edx
shrl $2, %edx
- shll $2, %edx
xorl %edi, %edi
andl $CPUIDECX_RDRAND, %ecx // See if we have rdrand.
@@ -66,8 +65,8 @@ ENTRY(mdrandom)
userand:
rdrand %eax
- xorl %eax, 0(%edi,%ebx)
- addl $4, %edi
+ xorl %eax, (%ebx,%edi,4)
+ incl %edi
cmpl %edi, %edx
jne userand
jmp done
@@ -75,8 +74,8 @@ userand:
usetsc:
rdtsc // Populates edx:eax.
mull %edx
- xorl %eax, 0(%edi,%ebx)
- addl $4, %edi
+ xorl %eax, (%ebx,%edi,4)
+ incl %edi
cmpl %edi, %ecx
jne usetsc
jmp done