This is the mail archive of the ecos-discuss@sourceware.org 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]

get context on the synthetic target


Hi,
I need to get the context of the current thread at anytime (important CPU registers, like esp, ebp, ebx, esi,...) on the synthetic target
I find the HAL_SavedRegisters and I find some discussions on the mailing list giving explanations about its members and how
it doesn't contain all x86 registers. But i don't find anything interesting for me.
So, can I get the CPU registers with an ecos macro or do I need to write a little macro like that

#define __get_thread_context(__context__){\
		asm(    "mov %%edi,%0 \n\t"\
   				"mov %%esi,%1 \n\t"\
	            "mov %%ebp,%2 \n\t"\
	            "mov %%esp,%3 \n\t"\
	            "mov %%ebx,%4 \n\t"\
	        : "=m" (__context__[S_REG_EDI]),"=m" (__context__[S_REG_ESI]),\
	        "=m" (__context__[S_REG_EBP]),"=m" (__context__[S_REG_ESP]),\
	        "=m" (__context__[S_REG_EBX]));\
	}

Thanks for your future reply.
Best regards, jjp
_________________________________________________________________
Sur Windows Live Ideas, découvrez en exclusivité de nouveaux services en ligne... si nouveaux qu'ils ne sont pas encore sortis officiellement sur le marché !
http://ideas.live.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


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