All of lore.kernel.org
 help / color / mirror / Atom feed
* quick question on 64-bit values with 32-bit inline assembly
@ 2008-01-21 18:09 Chris Friesen
  2008-01-22 17:57 ` Ralf Baechle
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Friesen @ 2008-01-21 18:09 UTC (permalink / raw)
  To: linux-mips

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-01-29 10:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 18:09 quick question on 64-bit values with 32-bit inline assembly Chris Friesen
2008-01-22 17:57 ` 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

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.