void time_init(void) { /* install scheduling interrupt handler */ setup_irq(IRQ_CPU_TIMER0, &timer_irq); time_divisor_init(); }
static int try_set_cm(int new_cm) { unsigned long flags, clkc; if (new_cm < 0 || new_cm > 1) return -EINVAL; local_irq_save(flags); __set_PSR(flags & ~PSR_ET); frv_dma_pause_all(); clkc = __get_CLKC(); clkc &= ~CLKC_CM; clkc |= new_cm; __set_CLKC(clkc); determine_clocks(0); time_divisor_init(); #if 1 //def DEBUG determine_clocks(1); #endif frv_dma_resume_all(); local_irq_restore(flags); return 0; }
static int try_set_cmode(int new_cmode) { if (new_cmode > 15) return -EINVAL; if (!(clock_cmodes_permitted & (1<<new_cmode))) return -EINVAL; /* tell all the drivers we're suspending */ pm_send_all(PM_SUSPEND, (void *)3); /* now change cmode */ local_irq_disable(); frv_dma_pause_all(); frv_change_cmode(new_cmode); determine_clocks(0); time_divisor_init(); #ifdef DEBUG determine_clocks(1); #endif frv_dma_resume_all(); local_irq_enable(); /* tell all the drivers we're resuming */ pm_send_all(PM_RESUME, (void *)0); return 0; }
void time_init(void) { unsigned int year, mon, day, hour, min, sec; extern void arch_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); /* FIX by dqg : Set to zero for platforms that don't have tod */ /* without this time is undefined and can overflow time_t, causing */ /* very strange errors */ year = 1980; mon = day = 1; hour = min = sec = 0; arch_gettod (&year, &mon, &day, &hour, &min, &sec); if ((year += 1900) < 1970) year += 100; xtime.tv_sec = mktime(year, mon, day, hour, min, sec); xtime.tv_nsec = 0; /* install scheduling interrupt handler */ setup_irq(IRQ_CPU_TIMER0, &timer_irq); time_divisor_init(); }
static int try_set_cmode(int new_cmode) { if (new_cmode > 15) return -EINVAL; if (!(clock_cmodes_permitted & (1<<new_cmode))) return -EINVAL; /* now change cmode */ local_irq_disable(); frv_dma_pause_all(); frv_change_cmode(new_cmode); determine_clocks(0); time_divisor_init(); #ifdef DEBUG determine_clocks(1); #endif frv_dma_resume_all(); local_irq_enable(); return 0; }