[ECOS] RE: Thread "program counter" for SPARC platform.
amassa@san.rr.com
amassa@san.rr.com
Thu May 6 19:34:00 GMT 2004
You can see what is being stored during a context switch in
/packages/hal/sparc/arch/current/src/context.S in the function
hal_thread_switch_context.
You can parse through here and get the current location saved for the
current thread.
--Anthony
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Hello,
I am using ECOS in a SPARC platform.
I am trying to implement something that would give the
PC of every task running in the system.
I can walk through the list of all task then print
information about every task. I print the stack_ptr by
calling get_saved_context(). I assumed the all
registers are saved into stack during the context Can
anyone suggest how I could figure out the PC and nPc
from stack. Following is the example .
Cyg_Thread *t = Cyg_Thread::get_list_head();
printf("\nThreads:\n\n");
while( NULL != t )
{
printf( "%20s stack base = %08x ptr = %08x size =
%08x\n",
"",
t->get_stack_base(),
t->get_saved_context(),
t->get_stack_size()
);
t = t->get_list_next();
}
Thanks
Ottawa
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list