int __init omap3_gpt_clocksource_init(u32 gpt_num, physical_addr_t prm_pa) { int rc; struct omap3_gpt_clocksource *cs; if ((rc = omap3_gpt_instance_init(gpt_num, prm_pa, NULL))) { return rc; } omap3_gpt_continuous(gpt_num); cs = vmm_zalloc(sizeof(struct omap3_gpt_clocksource)); if (!cs) { return VMM_EFAIL; } cs->gpt_num = gpt_num; cs->clksrc.name = omap3_gpt_config[gpt_num].name; cs->clksrc.rating = 200; cs->clksrc.read = &omap3_gpt_clocksource_read; cs->clksrc.mask = 0xFFFFFFFF; cs->clksrc.mult = vmm_clocksource_khz2mult((omap3_gpt_config[gpt_num].clk_hz)/1000, 24); cs->clksrc.shift = 24; cs->clksrc.priv = cs; return vmm_clocksource_register(&cs->clksrc); }
int arch_clocksource_init(void) { int rc; /* Register clocksource */ hpet_cs.mult = vmm_clocksource_khz2mult(1000, 20); if ((rc = vmm_clocksource_register(&hpet_cs))) { return rc; } return VMM_OK; }