All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: sparclinux@vger.kernel.org
Subject: Re: /dev/random lacks entropy on sparc64
Date: Mon, 09 Aug 2004 23:20:57 +0000	[thread overview]
Message-ID: <20040809162057.7a7d2ddb.davem@redhat.com> (raw)
In-Reply-To: <1092092360.7938.50.camel@duncow>

On Mon, 09 Aug 2004 23:59:20 +0100
Richard Mortimer <richm@oldelvet.org.uk> wrote:

> I suspect that the patch needs some more work (probably shouldn't use
> assembly directly in drivers/char/random.c). I'm not sure whether we
> should really be calling something like tick_ops->get_tick().

I think we should.  Also, you forgot to shift down the
high bits before xor'ing it into 'num'.

I would use this patch.

=== drivers/char/random.c 1.19 vs edited ==--- 1.19/drivers/char/random.c	2003-12-12 07:18:03 -08:00
+++ edited/drivers/char/random.c	2004-08-09 16:04:44 -07:00
@@ -750,6 +750,11 @@
 	__u32 high;
 	rdtsc(time, high);
 	num ^= high;
+#elif defined (__sparc_v9__)
+	unsigned long tick = tick_ops->get_tick();
+
+	time = (unsigned int) tick;
+	num ^= (tick >> 32UL);
 #else
 	time = jiffies;
 #endif

  reply	other threads:[~2004-08-09 23:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 22:59 /dev/random lacks entropy on sparc64 Richard Mortimer
2004-08-09 23:20 ` David S. Miller [this message]
2004-08-10  0:06 ` Richard Mortimer
2004-08-10  0:28 ` David S. Miller
2004-08-10 16:23 ` Anton Blanchard
2004-08-10 17:55 ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040809162057.7a7d2ddb.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.