|
From: Jeremy F. <je...@go...> - 2004-01-19 21:47:58
|
CVS commit by fitzhardinge:
Add some comments
M +9 -4 ume_go.c 1.3
--- valgrind/coregrind/x86/ume_go.c #1.2:1.3
@@ -27,9 +27,14 @@
#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;"
@@ -43,4 +48,4 @@ void ume_go(addr_t eip, addr_t esp)
/* we should never get here */
for(;;)
- ;
+ asm volatile("ud2");
}
|