/* * ======== SERVICES_Exit ======== * Purpose: * Discontinue usage of module; free resources when reference count * reaches 0. */ void SERVICES_Exit(void) { DBC_Require(cRefs > 0); GT_1trace(SERVICES_debugMask, GT_5CLASS, "SERVICES_Exit: cRefs 0x%x\n", cRefs); cRefs--; if (cRefs == 0) { /* Uninitialize all SERVICES modules here */ NTFY_Exit(); SYNC_Exit(); CLK_Exit(); REG_Exit(); LST_Exit(); KFILE_Exit(); DPC_Exit(); DBG_Exit(); CSL_Exit(); CFG_Exit(); MEM_Exit(); GT_exit(); } DBC_Ensure(cRefs >= 0); }
/* * ======== RMM_init ======== */ bool RMM_init(void) { bool retVal = true; DBC_Require(cRefs >= 0); if (cRefs == 0) { DBC_Assert(!RMM_debugMask.flags); GT_create(&RMM_debugMask, "RM"); /* "RM" for RMm */ retVal = MEM_Init(); if (!retVal) MEM_Exit(); } if (retVal) cRefs++; GT_1trace(RMM_debugMask, GT_5CLASS, "RMM_init(), ref count: 0x%x\n", cRefs); DBC_Ensure((retVal && (cRefs > 0)) || (!retVal && (cRefs >= 0))); return retVal; }
/* * ======== DBLL_init ======== */ bool DBLL_init(void) { bool retVal = true; DBC_Require(cRefs >= 0); if (cRefs == 0) { DBC_Assert(!DBLL_debugMask.flags); GT_create(&DBLL_debugMask, "DL"); /* "DL" for dbDL */ GH_init(); retVal = MEM_Init(); if (!retVal) MEM_Exit(); } if (retVal) cRefs++; GT_1trace(DBLL_debugMask, GT_5CLASS, "DBLL_init(), ref count: 0x%x\n", cRefs); DBC_Ensure((retVal && (cRefs > 0)) || (!retVal && (cRefs >= 0))); return retVal; }
/* * ======== SERVICES_Exit ======== * Purpose: * Discontinue usage of module; free resources when reference count * reaches 0. */ void SERVICES_Exit(void) { /* Uninitialize all SERVICES modules here */ NTFY_Exit(); SYNC_Exit(); CLK_Exit(); REG_Exit(); DBG_Exit(); CFG_Exit(); MEM_Exit(); GT_exit(); }
/* * ======== RMM_exit ======== */ void RMM_exit(void) { DBC_Require(cRefs > 0); cRefs--; GT_1trace(RMM_debugMask, GT_5CLASS, "RMM_exit() ref count: 0x%x\n", cRefs); if (cRefs == 0) MEM_Exit(); DBC_Ensure(cRefs >= 0); }
/* * ======== SERVICES_Init ======== * Purpose: * Initializes SERVICES modules. */ bool SERVICES_Init(void) { bool fInit = true; bool fCFG, fDBG, fMEM; bool fREG, fSYNC, fCLK, fNTFY; GT_init(); GT_create(&SERVICES_debugMask, "OS"); /* OS for OSal */ /* Perform required initialization of SERVICES modules. */ fMEM = MEM_Init(); fSYNC = SYNC_Init(); fREG = REG_Init(); fCFG = CFG_Init(); fDBG = DBG_Init(); fCLK = CLK_Init(); fNTFY = NTFY_Init(); fInit = fCFG && fDBG && fMEM && fREG && fSYNC && fCLK; if (!fInit) { if (fNTFY) NTFY_Exit(); if (fSYNC) SYNC_Exit(); if (fCLK) CLK_Exit(); if (fREG) REG_Exit(); if (fDBG) DBG_Exit(); if (fCFG) CFG_Exit(); if (fMEM) MEM_Exit(); } return fInit; }
/* * ======== DBLL_exit ======== * Discontinue usage of DBL module. */ void DBLL_exit(void) { DBC_Require(cRefs > 0); cRefs--; GT_1trace(DBLL_debugMask, GT_5CLASS, "DBLL_exit() ref count: 0x%x\n", cRefs); if (cRefs == 0) { MEM_Exit(); GH_exit(); #if GT_TRACE DBLL_debugMask.flags = NULL; #endif } DBC_Ensure(cRefs >= 0); }
/* * ======== GS_exit ======== * purpose: * Discontinue the usage of the GS module. */ void GS_exit(void) { MEM_Exit(); }
/* * ======== SERVICES_Init ======== * Purpose: * Initializes SERVICES modules. */ bool SERVICES_Init(void) { bool fInit = true; bool fCFG, fCSL, fDBG, fDPC, fKFILE, fLST, fMEM; bool fREG, fSYNC, fCLK, fNTFY; DBC_Require(cRefs >= 0); if (cRefs == 0) { GT_init(); GT_create(&SERVICES_debugMask, "OS"); /* OS for OSal */ GT_0trace(SERVICES_debugMask, GT_ENTER, "SERVICES_Init: entered\n"); /* Perform required initialization of SERVICES modules. */ fMEM = MEM_Init(); fREG = REG_Init(); fCFG = CFG_Init(); fCSL = CSL_Init(); fDBG = DBG_Init(); fDPC = DPC_Init(); fKFILE = KFILE_Init(); fLST = LST_Init(); fSYNC = SYNC_Init(); fCLK = CLK_Init(); fNTFY = NTFY_Init(); fInit = fCFG && fCSL && fDBG && fDPC && fKFILE && fLST && fMEM && fREG && fSYNC && fCLK; if (!fInit) { if (fNTFY) NTFY_Exit(); if (fSYNC) SYNC_Exit(); if (fCLK) CLK_Exit(); if (fREG) REG_Exit(); if (fLST) LST_Exit(); if (fKFILE) KFILE_Exit(); if (fDPC) DPC_Exit(); if (fDBG) DBG_Exit(); if (fCSL) CSL_Exit(); if (fCFG) CFG_Exit(); if (fMEM) MEM_Exit(); } } if (fInit) cRefs++; GT_1trace(SERVICES_debugMask, GT_5CLASS, "SERVICES_Init: cRefs 0x%x\n", cRefs); DBC_Ensure((fInit && (cRefs > 0)) || (!fInit && (cRefs >= 0))); return fInit; }