void alt_load (void) { /* * Copy the .rwdata section. */ alt_load_section (&__flash_rwdata_start, &__ram_rwdata_start, &__ram_rwdata_end); /* * Copy the exception handler. */ alt_load_section (&__flash_exceptions_start, &__ram_exceptions_start, &__ram_exceptions_end); /* * Copy the .rodata section. */ alt_load_section (&__flash_rodata_start, &__ram_rodata_start, &__ram_rodata_end); /* * Now ensure that the caches are in synch. */ alt_dcache_flush_all(); alt_icache_flush_all(); }
int main(void) { int i=0; alt_icache_flush_all(); alt_dcache_flush_all(); printf("NIOS II is running...\n"); printf("starting openPowerlink application...\n\n"); while (1) { if (openPowerlink() != 0) { printf("openPowerlink was shut down because of an error\n"); break; } else { printf("openPowerlink was shut down, restart...\n\n"); } for (i=0; i<1000000; i++); } printf("shut down NIOS II...\n%c", 4); return 0; }