lib/sw_apps/zynqmp_pmufw/src/pm_system.c
static void PmSystemCheckTcm(void)
{
	u32 i;

	for (i = 0U; i < ARRAY_SIZE(pmSystemTcmSlaves); i++) {
		PmSlave* slave = &pmSystemTcmSlaves[i]->sram.slv;
		PmRequirement* req = slave->reqs;
		bool save = false;

		/* Check if TCM slave has requirement different from 0 */
		while (NULL != req) {
			PmMaster* master = req->master;
			if (NULL != master) {
				if (PmMasterIsSuspended(master)) {
					if (0U != req->currReq) {
						save = true;
						break;
					}
				} else if (PmMasterIsSuspending(master)) {
					if (0U != req->nextReq) {
						save = true;
						break;
					}
				} else {
				}
			}
			req = req->nextMaster;
		}

		if (true == save) {
			PmSystemSetPosRequirement(slave, PM_CAP_ACCESS);
			PmSystemTcmSetSave(pmSystemTcmSlaves[i]->base,
					   TCM_SAVE_MEMORY);
		} else {
			PmSystemSetPosRequirement(slave, 0U);
			PmSystemTcmSetSave(pmSystemTcmSlaves[i]->base,
					   TCM_SKIP_MEMORY);
		}
	}
}
/**
 * PmSystemCheckTcm() - Mark TCM memory regions that needs to be saved/restored
 * 			during Power Off Suspend
 */
Mark TCM memory regions that needs to be saved/restored
during Power Off Suspend
Mark TCM memory regions that needs to be saved / restored during Power Off Suspend
static void PmSystemCheckTcm(void)
{
	u32 i;
	for (i = 0U; i < ARRAY_SIZE(pmSystemTcmSlaves); i++) {
		PmSlave* slave = &pmSystemTcmSlaves[i]->sram.slv;
		PmRequirement* req = slave->reqs;
		bool save = false;
		while (NULL != req) {
			PmMaster* master = req->master;
			if (NULL != master) {
				if (PmMasterIsSuspended(master)) {
					if (0U != req->currReq) {
						save = true;
						break;
					}
				} else if (PmMasterIsSuspending(master)) {
					if (0U != req->nextReq) {
						save = true;
						break;
					}
				} else {
				}
			}
			req = req->nextMaster;
		}
		if (true == save) {
			PmSystemSetPosRequirement(slave, PM_CAP_ACCESS);
			PmSystemTcmSetSave(pmSystemTcmSlaves[i]->base,
					   TCM_SAVE_MEMORY);
		} else {
			PmSystemSetPosRequirement(slave, 0U);
			PmSystemTcmSetSave(pmSystemTcmSlaves[i]->base,
					   TCM_SKIP_MEMORY);
		}
	}
}
static void PmSystemCheckTcm ( void ) { u32 i ; for ( i = 0U ; i < ARRAY_SIZE ( pmSystemTcmSlaves ) ; i ++ ) { PmSlave * slave = & pmSystemTcmSlaves [ i ] -> sram . slv ; PmRequirement * req = slave -> reqs ; bool save = false ; while ( NULL != req ) { PmMaster * master = req -> master ; if ( NULL != master ) { if ( PmMasterIsSuspended ( master ) ) { if ( 0U != req -> currReq ) { save = true ; break ; } } else if ( PmMasterIsSuspending ( master ) ) { if ( 0U != req -> nextReq ) { save = true ; break ; } } else { } } req = req -> nextMaster ; } if ( true == save ) { PmSystemSetPosRequirement ( slave , PM_CAP_ACCESS ) ; PmSystemTcmSetSave ( pmSystemTcmSlaves [ i ] -> base , TCM_SAVE_MEMORY ) ; } else { PmSystemSetPosRequirement ( slave , 0U ) ; PmSystemTcmSetSave ( pmSystemTcmSlaves [ i ] -> base , TCM_SKIP_MEMORY ) ; } } }
PmSystemCheckTcm() - Mark TCM memory regions that needs to be saved/restored
                      during Power Off Suspend
PmSystemCheckTcm () - Mark TCM memory regions that needs to be saved / restored during Power Off Suspend
/* Check if TCM slave has requirement different from 0 */