Howto calling a function from rt-task without a context switch 
(each call causes a delay)

To test this i write a function (port 0x50 ledon , port 0x51 ledoff,
val=dummy)

int ml8_out8_port_ret(unsigned short port, unsigned char val);

that only toggle a led.

smodular_handler                 is a fast periodic rt-task 

ml8_out8_port_ret(0x51, 0x0)     is a driver-function for testing that
toggle a led 
                                 and returns fast to get the 
                                 context-switch-time ( fmax =
2*togglefreq )

This function contains the protokoll-layer in the future. Currently
toggle this funktion a led to get a fast return from call. The
led-port-voltage ist monitored with a oszilloscope.

---start snipp testfunction----


void * smodular_handler(void
*arg)                                              
{       int return_val1,
return_val2;                                           
        char out_byte,
in_byte;                                                 
                   
        struct sched_param
p;                                                   
                                                                                       
                                                   
        p . sched_priority =
1;                                                 
        pthread_setschedparam (pthread_self(), SCHED_FIFO,
&p);                 
                                                                                
        pthread_make_periodic_np (pthread_self(), gethrtime(),
200000);         
                                                                                
        while (1)
{                                                             
                                                                                       
        
#ifdef
EXTLED_TOGGLE                                                            
          if (ext_led==0)
{                                                     
          return_val1=ml8_out8_port_ret(0x50,
0x0);                             
         
ext_led=1;                                                            
         
}                                                                     
          else
{                                                                
          return_val1=ml8_out8_port_ret(0x51,
0x0);                             
         
ext_led=0;                                                            
         
}                                                                     
#endif //
EXTLED_TOGGLE                                                         
        pthread_wait_np
();                                                                                    
                                                                                       
 
       
}                                                                                      
         
                                                                                       
                 
        return
0;                                                                                     
  
}                                             

---end snipp
testfunction---                                               
                                                   
On a PIII/350Mhz the highest led-clock may 8..9kHz. The context
switch delay is 56us.

How can i call a fast and large driver-function as replace for
toggle_led() 
into rt_function without context switch delay. I can't wait each 56us
for
a each call and i can't #include the whole driver-function at the 
position of each functioncall - that's very dirty :-) I need a
lot of such functionscalls and each driver-function contains many 
floatingpoint-operations.
                         
-- 
www   : http://www.tu-chemnitz.de/~ukn/index.html
email : [EMAIL PROTECTED]
cbpr  : ch1uwe (mybbs cb0box@#chz.sax.deu.eu)
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to