]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add some comments
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Mon, 19 Jan 2004 21:47:25 +0000 (21:47 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Mon, 19 Jan 2004 21:47:25 +0000 (21:47 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2205

coregrind/x86/ume_go.c

index 0f25f62ee5c617e48a6e37229d99dd7825c9659f..038a27057b54e3f543ca0028046785d186a1378c 100644 (file)
 
 #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");
 }