Re: kernel space

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

 



Florin Malita wrote:

On Thu, 22 Sep 2005 11:19:37 -0300
sauro <sauro@xxxxxxxxxxx> wrote:
I am actually working on an MPC5200 (Freescale PowerPC) with Denx embedded linux distribution, and there is no rdtsc avaiable... :( And we are getting problems with gettimeofday, because of timer desynchronization with the time server... and jiffies can't get the desired precision in our application.
So that's why I am trying to use get_cycles. Was it a bad idea?

It's just not worth the trouble. What I'm suggesting is just copy
get_cycles() from your architecture-specific implementation in your
application. I assume it's not based on any kernel-specific mechanism
as most architectures have dedicated registers for this kind of stuff.

Just pick your architecture from the list and dig into the get_cycles()
code: http://lxr.linux.no/ident?i=get_cycles

It's probably this one?
http://lxr.linux.no/source/include/asm-ppc/timex.h#L24

Florin



It worked just perfect! Thank you very much!  :)
You are right, the inline code has no depencies upon any kernel stuff, so it was just a matter of putting some assembly into my C app, no prob at all. (the code was that one you pointed out, I had just found it on my kernel tree by the same time)

Sauro

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux