Compare commits

..

1 Commits

2 changed files with 5 additions and 5 deletions

View File

@ -114,7 +114,7 @@ x_err_t PmpClearRegion(void *task_pmp, x_ubase addr)
if (!IsDoubleLinkListEmpty(&pmp->tor_list)) {
DOUBLE_LINKLIST_FOR_EACH(link, &pmp->tor_list) {
tor_node = CONTAINER_OF(link, struct PmpRegionTor, link);
if ( addr == tor_node->start ){
if ( addr = tor_node->start ){
pmp->count = pmp->count -2;
goto __free ;
}
@ -123,7 +123,7 @@ x_err_t PmpClearRegion(void *task_pmp, x_ubase addr)
if (!IsDoubleLinkListEmpty(&pmp->tor_swap_list)) {
DOUBLE_LINKLIST_FOR_EACH(link, &pmp->tor_swap_list) {
tor_node = CONTAINER_OF(link, struct PmpRegionTor, link);
if ( addr == tor_node->start ) {
if ( addr = tor_node->start ) {
goto __free;
}
}
@ -327,7 +327,7 @@ x_bool PmpAccessFaultHandle(void *task_pmp, x_ubase addr)
__swap:
if ( region_type == PMP_TOR ) {
if ( region_type = PMP_TOR ) {
if( pmp->count < PMP_MAX_ENTRY_NUMBER - 2) {
DoubleLinkListRmNode(&(tor_node->link));
DoubleLinkListInsertNodeBefore(&pmp->tor_list, &tor_node->link);

View File

@ -180,7 +180,7 @@ static x_err_t _MsgQueueUrgentSend(struct MsgQueue *mq, const void *buffer, x_si
if (mq->index < 0)
mq->index += mq->max_msgs;
msg = mq->msg_buf + ( ( mq->index + mq->num_msgs ) % mq->max_msgs ) * mq->each_len ;
msg = mq->msg_buf + (mq->index % mq->max_msgs) * mq->each_len;
memcpy(msg , buffer, size);
mq->num_msgs ++;
if (!IsDoubleLinkListEmpty(&mq->send_pend_list)) {
@ -214,7 +214,7 @@ static x_err_t _MsgQueueRecv(struct MsgQueue* mq,
timeout = CalculateTickFromTimeMs(msec);
lock = CriticalAreaLock();
if (mq->index == 0 && timeout == 0) {
if (timeout == 0 && mq->num_msgs <= 0) {
CriticalAreaUnLock(lock);
return -ETIMEOUT;
}