Port-arm archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
setstatclockrate()
Hi,
having both a9tmr and gtmr in the same (GENERIC) kernel was not possible
because both defined setstatclockrate() (as a dummy, BTW).
Looking around, I re-used a trick from a couple other ARM ports which
define a local xxxsetstatclockrate() and weak alias it with
setstatclockrate(). That's... not nice. You can see it at the end of
sys/arch/arm/cortex/a9tmr.c.
The same problem was actually solved for cpu_initclocks() in
sys/arch/arm/fdt/arm_fdt.c by providing a unique cpu_initclocks() and a
arm_fdt_timer_register() function to register each xxxcpu_initclocks().
I'm solliciting feedback for a nice solution. Should we add another
register function, add another parameter to the existing one, switch to
a structure of function pointers, or something else entirely?
Keeping the registration of these functions close makes a lot of sense
because they are semantically linked anyway. (setstatclockrate() is
useful only if cpu_initclocks() offers two different clock rates to play
with)
FWIW, throughout MD code, setstatclockrate() is very seldom defined to
do something useful, i.e. a specific clock rate for gathering statistics
is rarely used among ports.
Regards,
Aymeric
Home |
Main Index |
Thread Index |
Old Index