Use static strings for epicsInterruptContextMessage()
The callbackRequest() routine was passing a stack-allocated string to epicsInterruptContextMessage() but on RTEMS the pointer is queued without copying the string. This fix uses static strings for the 3 messages instead. Fixes LP: #1705219
This commit is contained in:
@@ -60,6 +60,10 @@ static void *exitCallback;
|
||||
static char *threadName[NUM_CALLBACK_PRIORITIES] = {
|
||||
"cbLow", "cbMedium", "cbHigh"
|
||||
};
|
||||
#define FULL_MSG(name) "callbackRequest: " name " ring buffer full\n"
|
||||
static char *fullMessage[NUM_CALLBACK_PRIORITIES] = {
|
||||
FULL_MSG("cbLow"), FULL_MSG("cbMedium"), FULL_MSG("cbHigh")
|
||||
};
|
||||
static unsigned int threadPriority[NUM_CALLBACK_PRIORITIES] = {
|
||||
epicsThreadPriorityScanLow - 1,
|
||||
epicsThreadPriorityScanLow + 4,
|
||||
@@ -168,11 +172,7 @@ void callbackRequest(CALLBACK *pcallback)
|
||||
epicsInterruptUnlock(lockKey);
|
||||
|
||||
if (!pushOK) {
|
||||
char msg[48] = "callbackRequest: ";
|
||||
|
||||
strcat(msg, threadName[priority]);
|
||||
strcat(msg, " ring buffer full\n");
|
||||
epicsInterruptContextMessage(msg);
|
||||
epicsInterruptContextMessage(fullMessage[priority]);
|
||||
ringOverflow[priority] = TRUE;
|
||||
}
|
||||
epicsEventSignal(callbackSem[priority]);
|
||||
|
||||
Reference in New Issue
Block a user