On Sat, 5 Jul 2008, [EMAIL PROTECTED] wrote:

> Hi,
> [EMAIL PROTECTED] wrote:
>> On Fri, 4 Jul 2008, Siegfried Schmidt wrote:
>>
>>
>>> Hi,
>>>
>>> I have written a driver for a special PCI Card on Solaris 10, Dual Core 2,4 
>>> GHz.
>>> The application uses the driver via ioctl to get one byte from the PCI Card.
>>> I use ddi_getxx to read the registers of the PCI Card, locked with 
>>> mutex_enter
>>> and mutex_exit.
>>> Between ioctl_entry and ioctl_return (within my ioctl-function) the
>>> driver must run without interruptions (the PCI Card itself don't use
>>> interrupts) by other threads, process, interrupts, timers or other
>>> kernel code.
>>> How can I do this? (runtime of the ioctl function is about 3-4 microseconds)
>>>
>>
>> The only way I see to achieve all of this is to:
>>
>>      - use a dedicated CPU
>>      - use a dedicated handler thread
>>
>> Using a dedicated handler thread bound to a dedicated CPU means:
>>      - that CPU will not participate in interrupt handling
>>      - no other process/thread/timer will be scheduled
>>
>> But more practically, disable kernel preemption, kpreempt_disable(), and
>> temporarily disable interrupts, cli().
>>
> ddi_enter_critical(9f)/ddi_exit_critical(9f) is the ddi way to do this.
> max


Thanks, the thought went through my mind that there actually was a DDI 
func for this but hmm, just couldn't remember what it was and my usual 
method of grep'ing /usr/share/man/man9f/ didn't come up with it either.

Thx Max !
FrankH.



>
>> I don't understand why, if the only thing you need to do is a single
>> ddi_getXX call, you need to have the entire thing locked. Can you explain
>> ?
>>
>> FrankH.
>>
>>
>>> Any ideas are welcome...
>>>
>>> sigi
>>>
>>>
>>> This message posted from opensolaris.org
>>> _______________________________________________
>>> opensolaris-discuss mailing list
>>> [email protected]
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> No good can come from selling your freedom, not for all the gold in the 
>> world,
>> for the value of this heavenly gift far exceeds that of any fortune on earth.
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> opensolaris-discuss mailing list
>> [email protected]
>>
>>
>
> _______________________________________________
> opensolaris-discuss mailing list
> [email protected]
>

------------------------------------------------------------------------------
No good can come from selling your freedom, not for all the gold in the world,
for the value of this heavenly gift far exceeds that of any fortune on earth.
------------------------------------------------------------------------------
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to