>The %g7 register is setup by the trap code.  On sun4u, user_trap()
>determines the CPU->cpu_thread, stashes it in %l6 and calls utl0().  The
>code in utl0() moves %l6 to THREAD_REG which is defined as %g7.  In the
>syscall case, the utl0() code then invokes the sycall_trap handler.
>utl0, unless I'm mistaken, vectors to the TL0 trap table.

This is somewhat strange because in sun4u the kernel's %g7 isn't
the same as userland's %g7 (there are trap globals and other
globals)

>Outbound, the proces is reversed in user_rtt().
>
>Parenthetically, the SysV ABI for SPARC lists the %g registers as
>reserved for system software.  code which is ABI compliant shouldn't be
>setting the %g7 register.  However, the kernel obviously doesn't trust
>the value of %g7 from userland and, as mentioned above, generates the
>correct value when a trap is taken.

The userland thread point is therefor also safely kept in %g7; if user
code uses it, it will soon explode in S10 (but works in unthreaded code
in S9 and earlier)

Casper
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to