The code in the template looks OK to me,
but I'm not an expert on gcc inline asm() stuff.
Did you try disassembling (dis) the binary
to see if the inline asm() code was correct?

For kernel code,
you probably don't want to use the C++ compiler (CC),
but rather the C compiler (cc).
The 5.8 compilers are from Studio 11,
and they probably don't handle the gcc style
inline asm() correctly.
The Studio 12 compilers should be able to handle it.
I think the Studio 12 compilers will build
a working kernel, but I have not verified this.
I know there is a project working to convert
OpenSolaris to use the Studio 12 compilers, though.

I'm not very familiar with kernel code
or the environment that it runs in,
but it is possible that %g1 or %g2 are
used for some special purpose,
and that changing the values
in those registers could cause problems.
You might want to ask about that
in some forum that deals with kernel issues.
(I don't see a kernel discussion forum, unfortunately).

Peter.
--
This message posted from opensolaris.org

Reply via email to