# HG changeset patch # User Mychaela Falconia # Date 1529685805 0 # Node ID a996d0429c5937b8199a3b0a2ba69296714ee6a8 # Parent f89439ce0d45ca2814e218834e560a2434e27550 OSL os_com_ir.c: system protect/unprotect are macros, not functions diff -r f89439ce0d45 -r a996d0429c59 src/gpf2/osl/os_com_ir.c --- a/src/gpf2/osl/os_com_ir.c Fri Jun 22 07:00:42 2018 +0000 +++ b/src/gpf2/osl/os_com_ir.c Fri Jun 22 16:43:25 2018 +0000 @@ -13,6 +13,14 @@ #include "os_types.h" #include "os_glob.h" +extern TC_PROTECT TCD_System_Protect; +extern VOID TCT_Protect(TC_PROTECT *protect); +extern VOID TCT_Unprotect(VOID); +extern VOID TCT_Unprotect_Specific(TC_PROTECT *protect); + +#define My_System_Protect() TCT_Protect(&TCD_System_Protect) +#define My_System_Unprotect() TCT_Unprotect_Specific(&TCD_System_Protect) + extern T_OS_COM_TABLE_ENTRY ComTable[]; extern unsigned os_tick_to_time_multiplier; @@ -40,7 +48,7 @@ ret = ObtainSemaphoreCB(CBPtr, Suspend, 1); if (ret == OS_ERROR || ret == OS_TIMEOUT) return(ret); - TCT_System_Protect(); + My_System_Protect(); elem = pTable->pFreeElement; pTable->pFreeElement = elem->pNext; memcpy(&elem->Data, Msg, sizeof(OS_QDATA)); @@ -51,7 +59,7 @@ watmark = pTable->Entries - CBPtr->sm_semaphore_count; if (pTable->MaxUsed < watmark) pTable->MaxUsed = watmark; - TCT_System_Unprotect(); + My_System_Unprotect(); ReleaseSemaphoreCB(&pTable->UsedSemCB); return(ret); } @@ -74,14 +82,14 @@ ret = ObtainSemaphoreCB(&pTable->UsedSemCB, Timeout, 0); if (ret == OS_ERROR || ret == OS_TIMEOUT) return(ret); - TCT_System_Protect(); + My_System_Protect(); for (i = OS_MAX_PRIORITY; i >= OS_MIN_PRIORITY; i--) { pQueue = &pTable->Queue[i - OS_MIN_PRIORITY]; if (pQueue->pWrite != pQueue->pRead) break; } if (i < OS_MIN_PRIORITY) { - TCT_System_Unprotect(); + My_System_Unprotect(); ReleaseSemaphoreCB(&pTable->FreeSemCB); return(OS_ERROR); } @@ -97,7 +105,7 @@ c_time = NU_Retrieve_Clock(); pTable->current_msg.time = SYSTEM_TICKS_TO_TIME(c_time); pTable->current_msg.ptr = Msg->ptr; - TCT_System_Unprotect(); + My_System_Unprotect(); ReleaseSemaphoreCB(&pTable->FreeSemCB); return(OS_OK); }