quick question on 64-bit values with 32-bit inline assembly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux