Hi,
In uts/sun4u/os/mach_startup.c, there is a function
mach_cpu_halt_idle() which is called from startup_end() in
uts/sun4u/os/startup.c
This function has the following contents:
385 void
386 mach_cpu_halt_idle()
387 {
388 if (enable_halt_idle_cpus) {
389 if (&cpu_halt_cpu) {
390 idle_cpu = cpu_halt;
391 disp_enq_thread = cpu_wakeup;
392 }
393 }
394 }
The cpu_halt_cpu() function is only defined for some platforms, in
sun4u the only one I find is "olympus".
In my research project we are using a full system simulator in which
OpenSolaris runs. I would like to make OpenSolaris believe that
halting is possible by providing my own cpu_halt_cpu() function.
If I provide such a function in a kernel module, can I then re-call
mach_cpu_halt_idle() in order to overwrite the idle_cpu() and
disp_enq_thread() pointers? Or will this result in panic or incorrect
behavior?
If this is not possible from a module, I would like to statically add
this cpu_halt_cpu() to the correct file in uts/sun4u/cpu/ so it is
seen at startup. I don't know which one this would be however. I am
simulating a serengeti machine, but there are no serengeti-specific
files in this directory. Shall I then simply put the code in the
us3_common files?
Just to be sure: this halt_cpu mechanism will overwrite the idle loop
so as to halt upon idling, and wakeup when some task has to run,
right? This halting can enable energy savings.
Thanks, Thomas