On 06/06/14 11:15, BALATON Zoltan wrote:
On Fri, 6 Jun 2014, Mark Cave-Ayland wrote:
SPARC64 and PPC. I guess something in arch/ppc must try and redefine the milliseconds word somewhere - if you could locate the duplicate definition (and even better submit a patch to remove it), that would be a great help. As you can see, I'm a bit short on time at the moment...
I've found these:
arch/ppc/briq/methods.c:ciface_milliseconds( unsigned long args[], unsigned long ret[] ) arch/ppc/briq/methods.c: { "milliseconds", ciface_milliseconds }, arch/ppc/mol/methods.c:ciface_milliseconds( unsigned long args[], unsigned long ret[] ) arch/ppc/mol/methods.c: { "milliseconds", ciface_milliseconds }, arch/ppc/pearpc/methods.c:ciface_milliseconds( unsigned long args[], unsigned long ret[] ) arch/ppc/pearpc/methods.c: { "milliseconds", ciface_milliseconds }, arch/ppc/qemu/methods.c:ciface_milliseconds( unsigned long args[], unsigned long ret[] ) arch/ppc/qemu/methods.c: { "milliseconds", ciface_milliseconds },
Should these all be removed? They all seem to be different. Is the default (dummy) implementation now better instead of these?
Heh well that's the first time I've noticed that code. It's completely wrong - for starters, it uses a fixed TB instead of using the one from QEMU so it's not going to measure time accurately anyhow.
The correct thing to do is similar to SPARC in that you create a 100Hz interrupt (possibly using the PPC decrementer?) that should increment a variable representing the number of ms elapsed. All you need to do is then point the new code towards that variable and it will handle get-msecs and milliseconds automatically.
The interrupt routine is probably do-able in about 20 lines or less of PPC asm but it's beyond my current PPC-fu. It would be a good project for you though, and would probably fix the incorrect timing CIF milliseconds with -M mac99 :)
ATB,
Mark.