lib/sw_services/xilpm/examples/xilpm_selfsuspend_example.c
static void RestoreContext(void)
{
	u8 *MemPtr;
	u8 *StartAddr;
	u8 *EndAddr;
	u8 *ContextMemPtr = (u8 *)CONTEXT_MEM_BASE;

#if defined (__GNUC__)
	StartAddr = &__data_start;
	EndAddr = &__data_end;
#elif defined (__ICCARM__)
	StartAddr = __section_begin(".data");
	EndAddr = __section_end(".data");
#endif
	for (MemPtr = StartAddr; MemPtr < EndAddr; MemPtr++, ContextMemPtr++) {
		*MemPtr = *ContextMemPtr;
	}

#if defined (__GNUC__)
	StartAddr = &__bss_start__;
	EndAddr = &__bss_end__;
#elif defined (__ICCARM__)
	StartAddr = __section_begin(".bss");
	EndAddr = __section_end(".bss");
#endif
	for (MemPtr = StartAddr; MemPtr < EndAddr; MemPtr++, ContextMemPtr++) {
		*MemPtr = *ContextMemPtr;
	}

	pm_dbg("Restored context (tick_count = %d)\n", TickCount);
}
/**
 * RestoreContext() - called to restore context of bss and data sections from OCM
 */
called to restore context of bss and data sections from OCM
called to restore context of bss and data sections from OCM
static void RestoreContext(void)
{
	u8 *MemPtr;
	u8 *StartAddr;
	u8 *EndAddr;
	u8 *ContextMemPtr = (u8 *)CONTEXT_MEM_BASE;
#if defined (__GNUC__)
	StartAddr = &__data_start;
	EndAddr = &__data_end;
#elif defined (__ICCARM__)
	StartAddr = __section_begin(".data");
	EndAddr = __section_end(".data");
#endif
	for (MemPtr = StartAddr; MemPtr < EndAddr; MemPtr++, ContextMemPtr++) {
		*MemPtr = *ContextMemPtr;
	}
#if defined (__GNUC__)
	StartAddr = &__bss_start__;
	EndAddr = &__bss_end__;
#elif defined (__ICCARM__)
	StartAddr = __section_begin(".bss");
	EndAddr = __section_end(".bss");
#endif
	for (MemPtr = StartAddr; MemPtr < EndAddr; MemPtr++, ContextMemPtr++) {
		*MemPtr = *ContextMemPtr;
	}
	pm_dbg("Restored context (tick_count = %d)\n", TickCount);
}
static void RestoreContext ( void ) { u8 * MemPtr ; u8 * StartAddr ; u8 * EndAddr ; u8 * ContextMemPtr = ( u8 * ) CONTEXT_MEM_BASE ; #if defined ( __GNUC__ ) StartAddr = & __data_start ; EndAddr = & __data_end ; #elif defined ( __ICCARM__ ) StartAddr = __section_begin ( " " ) ; EndAddr = __section_end ( " " ) ; #endif for ( MemPtr = StartAddr ; MemPtr < EndAddr ; MemPtr ++ , ContextMemPtr ++ ) { * MemPtr = * ContextMemPtr ; } #if defined ( __GNUC__ ) StartAddr = & __bss_start__ ; EndAddr = & __bss_end__ ; #elif defined ( __ICCARM__ ) StartAddr = __section_begin ( " " ) ; EndAddr = __section_end ( " " ) ; #endif for ( MemPtr = StartAddr ; MemPtr < EndAddr ; MemPtr ++ , ContextMemPtr ++ ) { * MemPtr = * ContextMemPtr ; } pm_dbg ( " \n " , TickCount ) ; }
RestoreContext() - called to restore context of bss and data sections from OCM
RestoreContext () - called to restore context of bss and data sections from OCM