Apart from initialization there is only one function to be registerd: clocksource_read(). This function returns the current value of a free running counter. Other functions like udelay() and get_time_ns() are derived from this function. The only thing you have to implement is a clocksource driver and to register it at runtime.
static uint64_t mycpu_clocksource_read(void) { TODO } static struct clocksource cs = { .read = mycpu_clocksource_read, .mask = 0xffffffff, .shift = 10, }; .... init_clock(&cs); ....
See arch/arm/mach-imx/clocksource.c for an example. clocksource drivers from the Linux Kernel can be used nearly 1:1, except for the register accesses.
Note: For clocksources the __lshrdi3 symbol is needed. You can find the function for your architecture in the Linux Kernel or a libc of your choice.
1.5.6