/* * for HUP. */ void restart_system(int sig) { signal(SIGHUP, SIG_IGN); signal(SIGTERM, SIG_IGN); kill_procs(); start_system(); signal(SIGHUP, restart_system); signal(SIGTERM, kill_system); }
void dsp_c_entry(void ) { #if 0 while(stop); #ifndef __ARC600__ if(DSP_RD(DSP_STATUS)==DSP_STATUS_RUNING) {/*halt the dsp */ printk("audio dsp halted now\n"); dsp_flush_printk_data(); DSP_WD(DSP_STATUS,DSP_STATUS_HALT); arch_halt(); } else #endif { DSP_WD(DSP_STATUS,DSP_STATUS_RUNING); } printk("DSP version=%s,dsp clock %d\n",firmware_version,get_system_clk()); #if defined(ENABLE_EFUSE) || defined(ENABLE_FIRMWARE_ENCRYPT) /*add by jeff begin*/ add_data(); #endif DSP_WD(DSP_JIFFIES,0); dsp_memory_init(); #endif dsp_irq_init(); #if 0 dsp_timer_init(); dsp_cache_init(1); dsp_mailbox_init(); #endif dsp_irq_enable(); #if 0 init_device(); #endif start_system(); while(1) { //arch_sleep(); //test_arc_run++; dsp_main(); } }
static int menu_main_bkg_system (void) { nsave_t *ns; int n; const char *sys; Planet *pnt; double cx, cy; /* Clean pilots. */ pilots_cleanAll(); sys = NULL; /* Refresh saves. */ load_refresh(); /* Get start position. */ ns = load_getList( &n ); if ((n > 0) && (planet_exists( ns[0].planet ))) { pnt = planet_get( ns[0].planet ); if (pnt != NULL) { sys = planet_getSystem( ns[0].planet ); if (sys != NULL) { cx = pnt->pos.x; cy = pnt->pos.y; cx += 300; cy += 200; } } } /* Fallback if necessary. */ if (sys == NULL) { sys = start_system(); start_position( &cx, &cy ); } /* Initialize. */ space_init( sys ); cam_setTargetPos( cx, cy, 0 ); cam_setZoom( conf.zoom_far ); pause_setSpeed( 1. ); sound_setSpeed( 1. ); return 0; }
/* * Initial task */ EXPORT void init_task(void) { INT fin; #if USE_SYSDEPEND_PATCH1 /* System-dependent processes (before start_system) */ sysdepend_patch1(); #endif /* Start system */ start_system(); #if USE_SYSDEPEND_PATCH2 /* System-dependent processes (after start_system) */ sysdepend_patch2(); #endif /* Initial task main */ fin = init_task_main(); /* Stop System */ shutdown_system(fin); /* Never return */ }
int main(int argc, char *argv[]) { /* * Check for error conditions that would * prevent us from working correctly */ if (argc < 4) { /* So we don't get debug output from dk_errx */ fprintf(stderr, "Usage: %s path hostname ip [host ip]\n", argv[0]); exit(1); } if (geteuid() != 0) { dk_errx("This program must be run as root"); } if (getpid() == 1) { dk_errx("This program will not function as a regular init(8)"); } /* This breaks sometimes.... if (check_ip_exists(argv[3]) == 0) { dk_errx("The ip specified: %s, does not appear to exist on this system", argv[3]); } */ /* * The ever-important process title change: * Set the title of the process (us) to the hostname * of the jail we are to become. */ setproctitle(argv[2]); /* Setup signal handlers */ init_signal_handlers(); /* Oh yeah, throw ourselves in that cold wet concrete cell with bubba */ start_jail(argv[1], argv[2], argv[3]); /* Make us go into ye-ole bg */ daemonize(); /* actually start the "virtual" machine. */ start_system(); /* Go into accept loop */ if (argc == 5) { network_start(argv[4]); } else { for ( ; ; ) sleep(100000); } return -1; }
int main(void) { XPeriph *PeriphPtr; XVprocSs *VpssPtr; vpssVidio *thisCase; int status, cnt; u32 Timeout; static int Lock = FALSE; /* Bind instance pointer with definition */ PeriphPtr = &PeriphInst; VpssPtr = &VprocInst; /* Initialize ICache */ Xil_ICacheInvalidate(); Xil_ICacheEnable(); /* Initialize DCache */ Xil_DCacheInvalidate(); Xil_DCacheEnable(); xil_printf("\r\n--------------------------------------------------------\r\n"); xil_printf(" Video Processing Subsystem Example Design %s\r\n", XVPROCSS_SW_VER); xil_printf(" (c) 2015, 2016 by Xilinx Inc.\r\n"); status = XSys_Init(PeriphPtr, VpssPtr); if(status != XST_SUCCESS) { xil_printf("CRITICAL ERR:: System Init Failed. Cannot recover from this error. Check HW\n\r"); } /* Based on the customized Video Processing Subsystem functionality * the video input and output formats are chosen. */ cnt = 0; while (cnt < USECASE_COUNT) { xil_printf("--------------------------------------------------------\r\n"); printf("Topology is %s, case %d\r\n",topo_name[VpssPtr->Config.Topology],cnt+1); thisCase = &useCase[VpssPtr->Config.Topology][cnt]; switch (VpssPtr->Config.Topology) { case XVPROCSS_TOPOLOGY_SCALER_ONLY: // In Scaler-only mode only the picture size may change // Choose video format based on the "422 Enabled" option // Video In: 720P Video Out: 1080P thisCase->Cformat_in = XV_HscalerIs422Enabled(VpssPtr->HscalerPtr)? XVIDC_CSF_YCRCB_422: XVIDC_CSF_YCRCB_444; thisCase->Cformat_out = thisCase->Cformat_in; break; case XVPROCSS_TOPOLOGY_FULL_FLEDGED: // Full Fledged mode may deinterlace, change picture size and/or color format. // In the Full Fledged configuration, the presence of a sub-core // is indicated by a non-NULL pointer to the sub-core driver instance. // If there is no Deinterlacer AND 420 input is supported (Vcr present), // choose progressive 420 input format if ((VpssPtr->DeintPtr == NULL) && (VpssPtr->VcrsmplrInPtr != NULL)) { // Video In: 720P 420 Video Out: 1080P RGB thisCase->width_in = 1280; thisCase->height_in = 720; thisCase->Cformat_in = XVIDC_CSF_YCRCB_420; thisCase->IsInterlaced = FALSE; // If the Deinterlacer is present, // choose 480i interlaced input 422 (Hcr present) or 444 (Hcr absent) } else { if (VpssPtr->DeintPtr != NULL) { // Video In: 480i YUV Video Out: 1080P RGB thisCase->width_in = 720; thisCase->height_in = 240; thisCase->Cformat_in = (VpssPtr->HcrsmplrPtr != NULL)? XVIDC_CSF_YCRCB_422 : XVIDC_CSF_YCRCB_444; thisCase->IsInterlaced = TRUE; } } break; default: break; } printf ("Set up Video Input and Output streams.\r\n"); setup_video_io(PeriphPtr, VpssPtr, thisCase); printf ("Start VPSS.\r\n"); status = start_system(PeriphPtr, VpssPtr); //Query video processing subsystem configuration XVprocSs_ReportSubsystemConfig(VpssPtr); if(status == XST_SUCCESS) { //Configure and start VTC with output timing printf ("Start VTC.\r\n"); XPeriph_ConfigVtc(PeriphPtr, &VpssPtr->VidOut, VprocInst.Config.PixPerClock); //Configure and start the TPG printf ("Start TPG.\r\n"); XPeriph_ConfigTpg(PeriphPtr); /* check for output lock */ xil_printf("Waiting for lock... "); Timeout = VIDEO_MONITOR_LOCK_TIMEOUT; while(!Lock && Timeout) { if(XPeriph_IsVideoLocked(PeriphPtr)) { xil_printf("Locked.\r\n"); Lock = TRUE; } --Timeout; } if(!Timeout) { xil_printf("\r\nTEST FAILED\r\n"); } else { xil_printf("\r\nTEST PASSED\r\n\r\n"); } xil_printf("Stop... "); XVprocSs_Stop(VpssPtr); // In the Deint-only configuration, it is necessary to allow // some time for aximm traffic to stop, and the core to become idle if (XVprocSs_IsConfigModeDeinterlaceOnly(VpssPtr)) { if (XV_DeintWaitForIdle(VpssPtr->DeintPtr) == XST_SUCCESS) xil_printf ("Deint subcore IDLE.\r\n"); else xil_printf ("Error: Deint subcore NOT IDLE.\r\n"); } } else { xil_printf("\r\nERR:: VProcss Configuration Failed. \r\n"); xil_printf("\r\nTEST FAILED\r\n"); } #if VERBOSE_MODE XVprocSs_LogDisplay(VpssPtr); #endif xil_printf ("End testing this use case.\r\n"); Lock = FALSE; cnt++; } while(1) { //NOP } return 0; }