void cfe_timer_init(void) { cfe_clocks_per_tick = CFE_CLOCKSPERTICK; cfe_clocks_per_usec = CFE_CLOCKSPERUSEC; if (cfe_clocks_per_usec == 0) cfe_clocks_per_usec = 1; /* for the simulator */ cfe_oldcount = _getticks(); /* get current COUNT register */ cfe_ticks = 0; if (!cfe_timer_initflg) { cfe_bg_add(cfe_timer_task,NULL); /* add task for background polling */ cfe_timer_initflg = 1; } }
int ui_init_tempsensorcmds(void) { #if (defined(TEMPSENSOR_SMBUS_DEV) && defined(TEMPSENSOR_SMBUS_CHAN)) cmd_addcmd("show temp", ui_cmd_showtemp, NULL, "Display CPU temperature", "show temp", "-continuous;Poll for temperature changes|" "-stop;Stop polling for temperature changes"); cfe_bg_add(temp_timer_proc,NULL); #endif return 0; }
int ui_init_swarmcmds(void) { cmd_addcmd("show temp", ui_cmd_showtemp, NULL, "Display CPU temperature", "show temp", "-continuous;Poll for temperature changes|" "-stop;Stop polling for temperature changes"); cmd_addcmd("reset", ui_cmd_reset, NULL, "Reset the system.", "reset [-yes] -softreset|-cpu|-unicpu1|-unicpu0|-sysreset", "-yes;Don't ask for confirmation|" "-softreset;Soft reset of the entire chip|" "-cpu;Reset the CPUs|" "-unicpu1;Reset to uniprocessor using CPU1|" "-unicpu0;Reset to uniprocessor using CPU0|" "-sysreset;Full system reset"); #ifdef _FLASHPROG_ cmd_addcmd("flashop", ui_cmd_flashop, NULL, "Perform flash operations on a single flash device", "flashop [options] [flashdevice]\n\n" "Erases, protects, or unprotects sectors on a flash memory device.\n" "", "-erase;Erase an address range of flash, no load|" "-protect;Protect an address range of flash, no load|" "-unprotect;Unprotect an address range of flash, no load|" "-startaddr=*;Start address of erase or protect|" "-endaddr=*;End address of erase or protect|" "-all;Perform operation on entire flash" ); #endif cfe_bg_add(temp_timer_proc,NULL); return 0; }
void cfe_main(int a,int b) { /* * By the time this routine is called, the following things have * already been done: * * 1. The processor(s) is(are) initialized. * 2. The caches are initialized. * 3. The memory controller is initialized. * 4. BSS has been zeroed. * 5. The data has been moved to R/W space. * 6. The "C" Stack has been initialized. */ cfe_bg_init(); /* init background processing */ cfe_attach_init(); cfe_timer_init(); /* Timer process */ cfe_bg_add(cfe_device_poll,NULL); /* * Initialize the memory allocator */ SETLEDS("KMEM"); KMEMINIT((unsigned char *) (uintptr_t) mem_heapstart, ((CFG_HEAP_SIZE)*1024)); /* * Initialize the console. It is done before the other devices * get turned on. The console init also sets the variable that * contains the CPU speed. */ SETLEDS("CONS"); board_console_init(); /* * Set up the exception vectors */ cfe_setup_exceptions(); /* * Say hello. */ SETLEDS("CIOK"); cfe_say_hello(); /* * Initialize the other devices. */ SETLEDS("AREN"); #if CFG_XIP xprintf("CFE XIP\n"); #endif xprintf("Init Arena\n"); cfe_arena_init(); #if CFG_PCI if (cfe_startflags & CFE_INIT_PCI) { pci_flags_t flags = PCI_FLG_NORMAL | PCI_FLG_LDT_PREFETCH; #ifndef EB332 char *str; extern cons_t pci_optnames[]; flags = PCI_FLG_NORMAL | PCI_FLG_LDT_PREFETCH; #if CFG_LDT_REV_017 flags |= PCI_FLG_LDT_REV_017; #endif str = env_getenv("PCI_OPTIONS"); setoptions(pci_optnames,str,&flags); xprintf("Initializing PCI. [%s]\n",str ? str : "normal"); #endif pci_configure(flags); } #endif SETLEDS("DEVI"); xprintf("Init Devs.\n"); board_device_init(); cfe_startup_info(); SETLEDS("ENVI"); cfe_setup_default_env(); xprintf("\n"); cfe_init_ui(); board_final_init(); cfe_autostart(); cfe_command_loop(); }