Hi, I am facing difficulties with some kernel code on SPARC v9. Specifically, most of the times it seems that the altername %g5 register contains a pointer to the current kthread_t struct in kernel memory. Following some exceptions, for example 0x8C (spill 3 normal), %g5 is wiped out. Where can I find this pointer then?
I know that a more proper way to do this might be, beginning from the "cpu" (as shown by mdb) array and doing cpu[<cpu_id>]->cpu_thread, but this does not seem to produce correct results, as it always points to a thread of the "sched" process. I also know that the normal %g7 register is supposed to hold a pointer to the current kthread_t. After all, in the whole kernel code "curthread" is #defined as "threadp()" and "threadp()" returns the contents of %g7. However, this %g7 seems not to reside in kernel memory, and I really should not access user memory in solving this problem. In summary, I need to know where can I find a corrent pointer to the kthread_t that is actually executing. Thanks -- This message posted from opensolaris.org _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
