[Rpcemu] Improving CPU usage when idle

Jake Waskett jake at waskett.org
Wed Apr 8 10:05:49 EDT 2009

Okay, I've partly implemented my event queue idea.  Initial results
are promising: the system still works, and I have been able to
(slightly) improve the responsiveness when BASIC program "Sleep" is
running.  I haven't yet modified the nanosleep() call to make it
queue-aware, so this improvement was a little unexpected!

I wonder if anyone can help with the following questions.

What is the purpose of "mousehack"?  As far as I can tell, it seems to
bypass interrupts (in keyboard.c:pollmouse()), and instead implements
a SWI (in keyboard.c:getosmouse()).  Why?

Another question: in pollmouse(), the line "if (model) return;" can be
found.  As far as I can tell from grepping the sources, "model" is set
to 0 if emulating an ARM7500, so why do we have special treatment for

I found I got quite good results by initialising mousehackon to 0 in
rpc-linux.c:main(), and commenting out the test of model, but randomly
commenting out code makes me a little nervous!  I'd be grateful if
anyone can answer these questions.


More information about the Rpcemu mailing list