targets/Xenomai/plc_Xenomai_main.c
changeset 985 cd8dadcef426
parent 954 ab487d32ce9a
child 1428 e14003eb4d42
equal deleted inserted replaced
984:2d03056993f6 985:cd8dadcef426
    36 #define WAITPYTHON_PIPE_MINOR        2
    36 #define WAITPYTHON_PIPE_MINOR        2
    37 #define PYTHON_PIPE_DEVICE           "/dev/rtp3"
    37 #define PYTHON_PIPE_DEVICE           "/dev/rtp3"
    38 #define PYTHON_PIPE_MINOR            3
    38 #define PYTHON_PIPE_MINOR            3
    39 #define PIPE_SIZE                    1 
    39 #define PIPE_SIZE                    1 
    40 
    40 
    41 /* provided by POUS.C */
       
    42 extern unsigned long common_ticktime__;
       
    43 
    41 
    44 long AtomicCompareExchange(long* atomicvar,long compared, long exchange)
    42 long AtomicCompareExchange(long* atomicvar,long compared, long exchange)
    45 {
    43 {
    46     return __sync_val_compare_and_swap(atomicvar, compared, exchange);
    44     return __sync_val_compare_and_swap(atomicvar, compared, exchange);
    47 }
    45 }
   167 {
   165 {
   168     signal(SIGINT, catch_signal);
   166     signal(SIGINT, catch_signal);
   169 
   167 
   170     /* no memory swapping for that process */
   168     /* no memory swapping for that process */
   171     mlockall(MCL_CURRENT | MCL_FUTURE);
   169     mlockall(MCL_CURRENT | MCL_FUTURE);
   172 
       
   173     /* Define Ttick to 1ms if common_ticktime not defined */
       
   174     Ttick = common_ticktime__?common_ticktime__:1000000;
       
   175 
   170 
   176     PLC_shutdown = 0;
   171     PLC_shutdown = 0;
   177 
   172 
   178     /*** RT Pipes creation and opening ***/
   173     /*** RT Pipes creation and opening ***/
   179     /* create Debug_pipe */
   174     /* create Debug_pipe */