Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-05-15 23:04:41 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-05-15 23:04:41 +0400
commitdaa69fff5b50519992d98bb30891eb309f3dd243 (patch)
treed41811264a894804515c14aa9133b6375a31f790 /winsup/cygwin/miscfuncs.cc
parent7afc14c0033dc2b10a0968bf99feeb0615448c49 (diff)
* miscfuncs.cc (thread_wrapper): Add comments to assembler code.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 0e2945125..73dec4c1a 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -421,15 +421,16 @@ thread_wrapper (VOID *arg)
+ wrapper_arg.stacksize
- sizeof (PVOID));
__asm__ ("\n\
- movl %[WRAPPER_ARG], %%ebx \n\
- movl (%%ebx), %%eax \n\
- movl 4(%%ebx), %%ecx \n\
- movl 8(%%ebx), %%edx \n\
- xorl %%ebp, %%ebp \n\
- movl %%edx, %%esp \n\
- pushl %%ecx \n\
- pushl %%eax \n\
- jmp *%%eax \n" : : [WRAPPER_ARG] "r" (&wrapper_arg));
+ movl %[WRAPPER_ARG], %%ebx # Load &wrapper_arg into ebx \n\
+ movl (%%ebx), %%eax # Load thread func into eax \n\
+ movl 4(%%ebx), %%ecx # Load thread arg into ecx \n\
+ movl 8(%%ebx), %%edx # Load stackbase into edx \n\
+ xorl %%ebp, %%ebp # Set ebp to 0 \n\
+ movl %%edx, %%esp # Set esp to stackbase \n\
+ pushl %%ecx # Push thread arg onto stack \n\
+ pushl %%eax # Push thread func onto stack \n\
+ jmp *%%eax # Jump to thread func \n"
+ : : [WRAPPER_ARG] "r" (&wrapper_arg));
}
if (wrapper_arg.guardsize)
@@ -446,12 +447,13 @@ thread_wrapper (VOID *arg)
system_printf ("VirtualAlloc, %E");
}
__asm__ ("\n\
- movl %[WRAPPER_ARG], %%ebx \n\
- movl (%%ebx), %%eax \n\
- movl 4(%%ebx), %%ecx \n\
- pushl %%ecx \n\
- pushl %%eax \n\
- jmp *%%eax \n" : : [WRAPPER_ARG] "r" (&wrapper_arg));
+ movl %[WRAPPER_ARG], %%ebx # Load &wrapper_arg into ebx \n\
+ movl (%%ebx), %%eax # Load thread func into eax \n\
+ movl 4(%%ebx), %%ecx # Load thread arg into ecx \n\
+ pushl %%ecx # Push thread arg onto stack \n\
+ pushl %%eax # Push thread func onto stack \n\
+ jmp *%%eax # Jump to thread func \n"
+ : : [WRAPPER_ARG] "r" (&wrapper_arg));
/* Never reached. */
return ERROR_INVALID_FUNCTION;
}