From: "Chris Friesen" <cfriesen@nortel.com>
To: linux-mips@linux-mips.org
Subject: quick question on 64-bit values with 32-bit inline assembly
Date: Mon, 21 Jan 2008 12:09:37 -0600 [thread overview]
Message-ID: <4794DFE1.5040805@nortel.com> (raw)
Hi all,
We're running a 64-bit kernel and 32-bit userspace. We've got some code
that is trying to get a 64-bit timestamp in userspace.
The following code seems to work fine in the kernel but in userspace it
appears to be swapping the two words in the result.
gethrtime(void)
{
unsigned long long result;
asm volatile ("rdhwr %0,$31" : "=r" (result));
return result;
}
Do I need to do something special because userspace is 32-bit? If so,
can someone point me to a reference?
Thanks,
Chris Friesen
next reply other threads:[~2008-01-21 18:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-21 18:09 Chris Friesen [this message]
2008-01-22 17:57 ` quick question on 64-bit values with 32-bit inline assembly Ralf Baechle
2008-01-22 18:02 ` Geert Uytterhoeven
2008-01-22 18:26 ` Ralf Baechle
2008-01-22 18:55 ` Chris Friesen
2008-01-22 20:07 ` Ralf Baechle
2008-01-28 21:02 ` M. Warner Losh
2008-01-28 21:18 ` Ralf Baechle
2008-01-28 21:26 ` M. Warner Losh
2008-01-29 10:16 ` Maciej W. Rozycki
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=4794DFE1.5040805@nortel.com \
--to=cfriesen@nortel.com \
--cc=linux-mips@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox