summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2009-01-05 01:16:09 +0000
committerpooka <pooka@NetBSD.org>2009-01-05 01:16:09 +0000
commitcbd549e79b4ecbbd2eae099fcad90901cefbe980 (patch)
treebc74610a1df2d7f6f5c96fae0c3ec48a781932cb /sys/lib
parentaa5e6ee4e28b109d4e693cbf9bbfbba2e428f2f5 (diff)
Fix previous. I have no idea what crack I was on when I "tested" them.
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libkern/arch/sparc/random.S14
-rw-r--r--sys/lib/libkern/arch/sparc64/random.S14
2 files changed, 16 insertions, 12 deletions
diff --git a/sys/lib/libkern/arch/sparc/random.S b/sys/lib/libkern/arch/sparc/random.S
index 3b47a9330ca..d4d2bcc91da 100644
--- a/sys/lib/libkern/arch/sparc/random.S
+++ b/sys/lib/libkern/arch/sparc/random.S
@@ -1,4 +1,4 @@
-/* $NetBSD: random.S,v 1.2 2009/01/04 17:10:46 pooka Exp $ */
+/* $NetBSD: random.S,v 1.3 2009/01/05 01:16:09 pooka Exp $ */
/*
* Copyright (c) 1990,1993 The Regents of the University of California.
@@ -45,14 +45,16 @@
.data
randseed:
.long 1
+
.text
ENTRY(random)
sethi %hi(16807), %o1
wr %o1, %lo(16807), %y
#ifdef PIC
- PIC_PROLOGUE(%g1, %g2)
- set randseed, %g2
- ld [%g1 + %g2], %o0
+ PIC_PROLOGUE(%o5, %o2)
+ set randseed, %g1
+ ld [%o5 + %g1], %g1
+ ld [%g1], %o0
#else
sethi %hi(randseed), %g1
ld [%g1 + %lo(randseed)], %o0
@@ -86,7 +88,7 @@ ENTRY(random)
sethi %hi(0x7fffffff), %o1
retl
#ifdef PIC
- st %o0, [%g1 + %g2]
+ st %o0, [%g1]
#else
st %o0, [%g1 + %lo(randseed)]
#endif
@@ -96,7 +98,7 @@ ENTRY(random)
and %o1, %o0, %o0
retl
#ifdef PIC
- st %o0, [%g1 + %g2]
+ st %o0, [%g1]
#else
st %o0, [%g1 + %lo(randseed)]
#endif
diff --git a/sys/lib/libkern/arch/sparc64/random.S b/sys/lib/libkern/arch/sparc64/random.S
index d52f738b030..86aeeb359f2 100644
--- a/sys/lib/libkern/arch/sparc64/random.S
+++ b/sys/lib/libkern/arch/sparc64/random.S
@@ -1,4 +1,4 @@
-/* $NetBSD: random.S,v 1.2 2009/01/04 17:10:47 pooka Exp $ */
+/* $NetBSD: random.S,v 1.3 2009/01/05 01:16:09 pooka Exp $ */
/*
* Copyright (c) 1990,1993 The Regents of the University of California.
@@ -45,14 +45,16 @@
.data
randseed:
.long 1
+
.text
ENTRY(random)
sethi %hi(16807), %o1
wr %o1, %lo(16807), %y
#ifdef PIC
- PIC_PROLOGUE(%g1, %g2)
- set randseed, %g2
- ld [%g1 + %g2], %o0
+ PIC_PROLOGUE(%o5, %o2)
+ set randseed, %g1
+ ldx [%o5 + %g1], %g1
+ ld [%g1], %o0
#else
sethi %hi(randseed), %g1
ld [%g1 + %lo(randseed)], %o0
@@ -86,7 +88,7 @@ ENTRY(random)
sethi %hi(0x7fffffff), %o1
retl
#ifdef PIC
- st %o0, [%g1 + %g2]
+ st %o0, [%g1]
#else
st %o0, [%g1 + %lo(randseed)]
#endif
@@ -96,7 +98,7 @@ ENTRY(random)
and %o1, %o0, %o0
retl
#ifdef PIC
- st %o0, [%g1 + %g2]
+ st %o0, [%g1]
#else
st %o0, [%g1 + %lo(randseed)]
#endif