linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to link to hrtimers in the kernel
@ 2008-10-06 15:41 George Nychis
  2008-10-06 16:33 ` [patch] " Randy.Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: George Nychis @ 2008-10-06 15:41 UTC (permalink / raw)
  To: linux-kernel

Hi all,

I have modified drivers/usb/core/devio.c to use hrtimer_nanosleep(), and 
have included linux/hrtimer.h with it.

But now I am having trouble linking, I get:
ERROR: "hrtimer_nanosleep" [drivers/usb/core/usbcore.ko] undefined!

How do I properly link to the hrtimer library?

Thanks!
George

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

* [patch] Re: how to link to hrtimers in the kernel
  2008-10-06 15:41 how to link to hrtimers in the kernel George Nychis
@ 2008-10-06 16:33 ` Randy.Dunlap
  2008-10-06 16:51   ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Randy.Dunlap @ 2008-10-06 16:33 UTC (permalink / raw)
  To: George Nychis; +Cc: linux-kernel, tglx

On Mon, 6 Oct 2008, George Nychis wrote:

> Hi all,
> 
> I have modified drivers/usb/core/devio.c to use hrtimer_nanosleep(), and have
> included linux/hrtimer.h with it.
> 
> But now I am having trouble linking, I get:
> ERROR: "hrtimer_nanosleep" [drivers/usb/core/usbcore.ko] undefined!
> 
> How do I properly link to the hrtimer library?

Hi,
That function needs to be exported in its source file.
Patch below should fix it for you.



From: Randy Dunlap <randy.dunlap@oracle.com>

Export hrtimer_nanosleep() for module use.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 kernel/hrtimer.c |    1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.27-rc8-git5.orig/kernel/hrtimer.c
+++ linux-2.6.27-rc8-git5/kernel/hrtimer.c
@@ -1559,6 +1559,7 @@ out:
 	destroy_hrtimer_on_stack(&t.timer);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(hrtimer_nanosleep);
 
 asmlinkage long
 sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)

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

* Re: [patch] Re: how to link to hrtimers in the kernel
  2008-10-06 16:33 ` [patch] " Randy.Dunlap
@ 2008-10-06 16:51   ` Thomas Gleixner
  2008-10-06 17:16     ` George Nychis
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2008-10-06 16:51 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: George Nychis, linux-kernel

On Mon, 6 Oct 2008, Randy.Dunlap wrote:
> On Mon, 6 Oct 2008, George Nychis wrote:
> 
> > Hi all,
> > 
> > I have modified drivers/usb/core/devio.c to use hrtimer_nanosleep(), and have
> > included linux/hrtimer.h with it.

Please do not use hrtimer_nanosleep() in drivers. That's
wrong.

What do you want to achieve ?
 
> Export hrtimer_nanosleep() for module use.

NAK, hrtimer_nanosleep is part of the user space interfaces.

> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  kernel/hrtimer.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- linux-2.6.27-rc8-git5.orig/kernel/hrtimer.c
> +++ linux-2.6.27-rc8-git5/kernel/hrtimer.c
> @@ -1559,6 +1559,7 @@ out:
>  	destroy_hrtimer_on_stack(&t.timer);
>  	return ret;
>  }
> +EXPORT_SYMBOL_GPL(hrtimer_nanosleep);
>  
>  asmlinkage long
>  sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
> 

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

* Re: [patch] Re: how to link to hrtimers in the kernel
  2008-10-06 16:51   ` Thomas Gleixner
@ 2008-10-06 17:16     ` George Nychis
  2008-10-07 14:55       ` Brian Pomerantz
  0 siblings, 1 reply; 5+ messages in thread
From: George Nychis @ 2008-10-06 17:16 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Randy.Dunlap, linux-kernel



Thomas Gleixner wrote:
> On Mon, 6 Oct 2008, Randy.Dunlap wrote:
>> On Mon, 6 Oct 2008, George Nychis wrote:
>>
>>> Hi all,
>>>
>>> I have modified drivers/usb/core/devio.c to use hrtimer_nanosleep(), and have
>>> included linux/hrtimer.h with it.
> 
> Please do not use hrtimer_nanosleep() in drivers. That's
> wrong.
> 
> What do you want to achieve ?
>  

I am trying to sleep at the microsecond level, which ssleep and msleep 
cannot provide.  I couldn't find any other nanosleep method in the kernel.

I found information by searching the net on using jiffies to accomplish 
sleep periods, but that is not high enough in resolution.

I'd greatly appreciate any feedback.

Thanks!
George

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

* Re: [patch] Re: how to link to hrtimers in the kernel
  2008-10-06 17:16     ` George Nychis
@ 2008-10-07 14:55       ` Brian Pomerantz
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Pomerantz @ 2008-10-07 14:55 UTC (permalink / raw)
  To: George Nychis; +Cc: Thomas Gleixner, Randy.Dunlap, linux-kernel

On Mon, Oct 06, 2008 at 01:16:15PM -0400, George Nychis wrote:
> 
> I am trying to sleep at the microsecond level, which ssleep and msleep 
> cannot provide.  I couldn't find any other nanosleep method in the kernel.
> 
> I found information by searching the net on using jiffies to accomplish 
> sleep periods, but that is not high enough in resolution.
> 
> I'd greatly appreciate any feedback.
> 

Is there any reason you can't use udelay()/ndelay()?


BAPper

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

end of thread, other threads:[~2008-10-07 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-06 15:41 how to link to hrtimers in the kernel George Nychis
2008-10-06 16:33 ` [patch] " Randy.Dunlap
2008-10-06 16:51   ` Thomas Gleixner
2008-10-06 17:16     ` George Nychis
2008-10-07 14:55       ` Brian Pomerantz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).