This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RE: Thread "program counter" for SPARC platform.


On Thu, 2004-05-06 at 13:45, Ottawa Guy wrote:
> Thanks Anthony for your quick response. I looked at
> the hal_thread_switch_context ealier. That function 
> saves all the current register of the SPARC platform.
> However I didnt see any program counter there. 

If you read the comments in hal/sparc/arch/current/include/hal_arch.h,
you'll see that the program counter is "hidden" in the register windows
which are saved in the context.  Refer to a SPARC programming manual
to see how to unwind and interpret that data.

>          thanks 
>                  Ottawa  
> 
> --- "amassa@san.rr.com" <amassa@san.rr.com> wrote:
> > 
> > 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/ .
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]