All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Rosenfeld Rosas <lbocseg@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai@xenomai.org
Subject: [Xenomai-help] Re: RTDM and udelay
Date: Thu, 26 Jan 2006 08:49:26 -0200	[thread overview]
Message-ID: <43D8A936.3010500@domain.hid> (raw)
In-Reply-To: <43D8891D.7000405@domain.hid>


>>>>Is there any alternative to udelay on RTDM?
>>>>
>>>>Or should I do something like:
>>>>
>>>>void rt_udelay(unsigned int usec) {
>>>> uint64_t timeout = rtdm_clock_read () + usec;
>>>> while (rtdm_clock_read () < timeout);
>>>>}
>>>>  
>>>>        
>>>>
>>>You mean something like this: =:)
>>>
>>>http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/skins/rtdm/drvlib.c?v=SVN-trunk#L366
>>>      
>>>
>>Yes, but it seemed too complex for me, since it disables IRQ and I do
>>not need this feature. It will no problem if, instead of waiting 2us, I
>>    
>>
>Are we talking about the same function??? Don't think so.
>  
>
Is there any related function that do not disable IRQ? I know it is not 
a big deal and I'll use the suggested function if there is no 
alternative, but I would prefer using some delay function that will not 
disable interrupts when delaying.

>>have to wait 100us because some interrupt has occurred. After I write to
>>the board i2c registers, I need to wait *at least*, say, 2us before
>>writing another i2c cycle.
>>    
>>
>
>Then this is the perfect choice for you.
>
>  
>
>>One more thing: although the name of the function has the word "task", I
>>think it is not task specific. Documentation even says it can be called
>>from initialization/cleanup code. But it doesn't say if it can be called
>>from an ioctl handler or any other context, although I see no problem
>>when reviewing the code. Thus, I think a better name would be something
>>like rtdm_busy_sleep() or rtdm_ns_delay(). Just a suggestion.
>>    
>>
>
>The idea is to put most functions into some related group. As
>rtdm_task_busy_sleep() is an alternative to rtdm_task_sleep(), I placed
>them close to each other in the doc, i.e. in the same group (rtdm_task_xxx).
>
>Note that an ioctl handler (just like any device operation handler) has
>no separate context. Depending on if we are talking about the _rt or the
>_nrt handler, it either executes in a RT task or in non-RT context,
>invoked by a user space or kernel space caller. All this is covered by
>the environments listed for rtdm_task_busy_sleep.
>  
>
Thanks for clarifying. One more doubt. Suppose my driver has only the 
non-RT close handler. If the user close the file descriptor from a 
RT-context, it will call the non-RT close handler? If yes, will that 
handler be called in a RT-context? If not, could I use the same handler 
(function) for both RT and non-RT handlers?

Thank you again,

Rodrigo.


	

	
		
_______________________________________________________ 
Yahoo! doce lar. Faça do Yahoo! sua homepage. 
http://br.yahoo.com/homepageset.html 




  reply	other threads:[~2006-01-26 10:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-25 17:52 [Xenomai-help] RTDM and udelay Rodrigo Rosenfeld Rosas
2006-01-25 19:56 ` [Xenomai-help] " Jan Kiszka
2006-01-26  0:42   ` Rodrigo Rosenfeld Rosas
2006-01-26  8:32     ` Jan Kiszka
2006-01-26 10:49       ` Rodrigo Rosenfeld Rosas [this message]
2006-01-26 15:17         ` Jan Kiszka
2006-01-27  9:41           ` Rodrigo Rosenfeld Rosas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43D8A936.3010500@domain.hid \
    --to=lbocseg@domain.hid \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.