Re: kernel space

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

 



Florin Malita wrote:

On Thu, 22 Sep 2005 10:48:24 -0300
sauro <sauro@xxxxxxxxxxx> wrote:
I would like to get, from userland, the results of a function that is only avaiable from kernel space. (get_cycles, to be exact)
What is the easiest way to do it? Maybe an ioctl?

Why would you want to use the kernel get_cycles()? It's trivial to
define your own function/macro based on rdtsc:
http://lxr.linux.no/source/include/asm-i386/msr.h#L41

#define rdtscll(val) \
           __asm__ __volatile__ ("rdtsc" : "=A" (val))

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?


--
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