Thomas De Schampheleire wrote:
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?
I think that's right.
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.
The kernel module that defines that function probably isn't loaded.
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?
The sbdp module lives under /platform/SUNW,Sun-Fire/kernel/misc/sparcv9/
The kernel modules that live under there are platform specific, and will
be brought
into the picture depending on what your "uname -i" string is. uname -i
on your system
should either be SUNW,Sun-Fire, or something which in the /platform
directory is a symlink
to SUNW,Sun-Fire.
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?
This i'm not sure about, but I would expect so once the module is loaded.
Perhaps someone else on the list can comment here.
And a final small question, what does the acronym sbdp stand for?
Good question. I think "sbd" refers to "system board". I'm not sure what
the "p" is for though.
-Eric
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code