summaryrefslogtreecommitdiff
path: root/sys
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
parent5d1e919f595c95a96b8b11889a5f68e5f8e4477f (diff)
Simplify things slightly by using four byte indexing.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/stand/libsa/random_i386.S9
-rw-r--r--sys/arch/i386/stand/libsa/random_i386.S9
2 files changed, 8 insertions, 10 deletions
diff --git a/sys/arch/amd64/stand/libsa/random_i386.S b/sys/arch/amd64/stand/libsa/random_i386.S
index 03c2f21a3be..568c8bb4daf 100644
--- a/sys/arch/amd64/stand/libsa/random_i386.S
+++ b/sys/arch/amd64/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
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