Hi Lucas,
Will reply inline.
As a matter of syntax, there are quite some places with functions
without parameters defined as `f()` instead of `f(void)`.
Sure. Good catch.
+ if (tc == NULL || tk_user < 1 || tk_user > TC_LAST)
Shouldn't you check for >= TC_LAST in here? Otherwise you'll be reading
and invoking dragons in the following lines.
*Unless*, the semantic meaning of TC_LAST is to indicate the last valid
index of get_tc[]. In that case, TC_LAST is defined to 3 in amd64,
instead of 2.
You are correct. It should be >= TC_LAST. Fixed locally.
As a note. This bit will be removed when I commit this. Here it is just
for showing how we can support multiple clocks. On amd64 (at least for
now) we will only have TSC support so all the functions above will also
go away and tc_get_timecount will contain the rdtsc() code.
The sparc64 bits that will follow this commit will have the correct idiom.