# HG changeset patch # User Edouard Tisserant # Date 1316983911 -7200 # Node ID b9271faec96e796178dc192e12d2525603ed3d81 # Parent 72bc3e53a1fac21bfc447e1bb8c4919b899276bf Xenomai Fix : runs, but still fail in debug diff -r 72bc3e53a1fa -r b9271faec96e targets/Xenomai/plc_Xenomai_main.c --- a/targets/Xenomai/plc_Xenomai_main.c Thu Sep 22 17:35:29 2011 +0200 +++ b/targets/Xenomai/plc_Xenomai_main.c Sun Sep 25 22:51:51 2011 +0200 @@ -186,7 +186,7 @@ PLC_state |= PLC_STATE_PYTHON_FILE_OPENED; /* create WaitDebug_pipe */ - if(rt_pipe_create(&WaitDebug_pipe, "Debug_pipe", WAITDEBUG_PIPE_MINOR, PIPE_SIZE)) + if(rt_pipe_create(&WaitDebug_pipe, "WaitDebug_pipe", WAITDEBUG_PIPE_MINOR, PIPE_SIZE)) goto error; PLC_state |= PLC_STATE_WAITDEBUG_PIPE_CREATED; @@ -195,7 +195,7 @@ PLC_state |= PLC_STATE_WAITDEBUG_FILE_OPENED; /* create WaitPython_pipe */ - if(rt_pipe_create(&WaitPython_pipe, "Python_pipe", WAITPYTHON_PIPE_MINOR, PIPE_SIZE)) + if(rt_pipe_create(&WaitPython_pipe, "WaitPython_pipe", WAITPYTHON_PIPE_MINOR, PIPE_SIZE)) goto error; PLC_state |= PLC_STATE_WAITPYTHON_PIPE_CREATED; @@ -215,6 +215,7 @@ return 0; error: + PLC_cleanup_all(); return 1; } @@ -225,11 +226,16 @@ int TryEnterDebugSection(void) { - long old_debug_state = AtomicCompareExchange( + if(AtomicCompareExchange( &debug_state, DEBUG_FREE, - DEBUG_BUSY); - return old_debug_state == DEBUG_FREE; + DEBUG_BUSY) == DEBUG_FREE){ + if(__DEBUG){ + return 1; + } + AtomicCompareExchange( &debug_state, DEBUG_BUSY, DEBUG_FREE); + } + return 0; } #define DEBUG_UNLOCK 1 @@ -277,7 +283,7 @@ DEBUG_FREE, DEBUG_BUSY) != DEBUG_FREE && cmd == DEBUG_UNLOCK){ - if(read(Debug_pipe_fd, &cmd, sizeof(cmd)) == sizeof(cmd)){ + if(read(Debug_pipe_fd, &cmd, sizeof(cmd)) != sizeof(cmd)){ return -1; } } @@ -347,3 +353,24 @@ } /* as plc does not wait for lock. */ } +int CheckRetainBuffer(void) +{ + return 1; +} + +void ValidateRetainBuffer(void) +{ +} + +void InValidateRetainBuffer(void) +{ +} + +void Retain(unsigned int offset, unsigned int count, void *p) +{ +} + +void Remind(unsigned int offset, unsigned int count, void *p) +{ +} +