Hi,
I am confused by the following piece of code from
uts/sun4u/serengeti/os/serengeti.c :
237 /*ARGSUSED*/
238 int
239 plat_cpu_poweroff(struct cpu *cp)
240 {
241 int (*serengeti_cpu_poweroff)(struct cpu *) = NULL;
242
243 serengeti_cpu_poweroff =
244 (int (*)(struct cpu *))modgetsymvalue("sbdp_cpu_poweroff", 0);
245
246 if (serengeti_cpu_poweroff == NULL)
247 return (ENOTSUP);
248 else
249 return ((serengeti_cpu_poweroff)(cp));
250 }
If I understand correctly, the modgetsymvalue() function will look
throughout the kernel and attached modules for a symbol called
"sbdp_cpu_poweroff". When something is found, it is executed,
otherwise ENOTSUP is returned. Is this correct?
When I execute cpu_poweroff() which in turn calls this
plat_cpu_poweroff() function, it returns with ENOTSUP, so it seems the
sbdp_cpu_poweroff function does not exist.
However, using the source browser, there seems to be a
sbdp_cpu_poweroff() function in uts/sun4u/serengeti/io/sbdp_cpu.c. If
I understand correctly, this is part of some sbdp module for
serengeti, which does not seem to be loaded and isn't in my /kernel
directory either. My question is therefore: why is this module not
compiled, even though it is part of the ON source tree. Is there
something I need to do?
A third question: when I write a module that also supplies a
sbdp_cpu_poweroff() function, will it automatically be found by
modgetsymvalue()? Is there some precedence mechanism I should check?
Is there some documentation about which steps this function should
necessarily do?
And a final small question, what does the acronym sbdp stand for?
Thanks, thomas
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code