From: Jeremy Fitzhardinge Date: Mon, 19 Jan 2004 21:47:25 +0000 (+0000) Subject: Add some comments X-Git-Tag: svn/VALGRIND_2_1_1~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c56057c32cf40ae9abd1086092bed2fa23b039a;p=thirdparty%2Fvalgrind.git Add some comments git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2205 --- diff --git a/coregrind/x86/ume_go.c b/coregrind/x86/ume_go.c index 0f25f62ee5..038a27057b 100644 --- a/coregrind/x86/ume_go.c +++ b/coregrind/x86/ume_go.c @@ -26,11 +26,16 @@ #include "ume_arch.h" +/* + Jump to a particular EIP with a particular ESP. This is intended + to simulate the initial CPU state when the kernel starts an program + after exec; it therefore also clears all the other registers. + */ void ume_go(addr_t eip, addr_t esp) { - asm volatile ("movl %1, %%esp;" - "pushl %%eax;" - "xorl %%eax,%%eax;" + asm volatile ("movl %1, %%esp;" /* set esp */ + "pushl %%eax;" /* push esp */ + "xorl %%eax,%%eax;" /* clear registers */ "xorl %%ebx,%%ebx;" "xorl %%ecx,%%ecx;" "xorl %%edx,%%edx;" @@ -42,5 +47,5 @@ void ume_go(addr_t eip, addr_t esp) : : "a" (eip), "r" (esp)); /* we should never get here */ for(;;) - ; + asm volatile("ud2"); }