diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-07-17 16:47:14 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-07-17 16:47:14 +0200 |
commit | 16d2d9f1312653daa9cb8d4cdb3a113e53f432ca (patch) | |
tree | edc595d599965ce411c26145a2fe514bdad7ce77 /winsup/cygwin/exceptions.cc | |
parent | b3ccf998ccc7b45a3df442b8f5ca8989f5c874a6 (diff) | |
download | cygnal-16d2d9f1312653daa9cb8d4cdb3a113e53f432ca.tar.gz cygnal-16d2d9f1312653daa9cb8d4cdb3a113e53f432ca.tar.bz2 cygnal-16d2d9f1312653daa9cb8d4cdb3a113e53f432ca.zip |
Comment fixup
* exceptions.cc (getcontext/x86_64): Drop comment on RtlCaptureContext.
(swapcontext/x86_64): Fix comment yet again.
(getcontext/i686): Move comment from x86_64 getcontext, slightly
rearranged, to preceeding comment.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 7e10ba927..6e9890e32 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1886,11 +1886,6 @@ getcontext (ucontext_t *ucp) PCONTEXT ctx = (PCONTEXT) &ucp->uc_mcontext; ctx->ContextFlags = CONTEXT_FULL; RtlCaptureContext (ctx); - /* Amazing, but true: On 32 bit, RtlCaptureContext returns the context - matching the caller of getcontext, so all we have to do is call it. - On 64 bit, RtlCaptureContext returns the exact context of its own - caller, so we have to unwind virtually by a single frame to get the - context of the caller of getcontext. */ __unwind_single_frame (ctx); /* Successful getcontext is supposed to return 0. If we don't set rax to 0 here, there's a chance that code like this: @@ -1911,8 +1906,8 @@ swapcontext (ucontext_t *oucp, const ucontext_t *ucp) PCONTEXT ctx = (PCONTEXT) &oucp->uc_mcontext; ctx->ContextFlags = CONTEXT_FULL; RtlCaptureContext (ctx); - /* See comments in getcontext. */ __unwind_single_frame (ctx); + /* See comment in getcontext. */ oucp->uc_mcontext.rax = 0; oucp->uc_sigmask = oucp->uc_mcontext.oldmask = _my_tls.sigmask; return setcontext (ucp); @@ -1941,6 +1936,11 @@ __cont_link_context: \n\ the callee-saved registers, especially $ebx, are not changed by the calling function. If so, makecontext/__cont_link_context would be broken. + Amazing, but true: While on 64 bit RtlCaptureContext returns the exact + context of its own caller, as expected, on 32 bit RtlCaptureContext returns + the context of the callers caller. So while we have to unwind another frame + on 64 bit, we can skip this step on 32 bit. + Both functions are split into the first half in assembler, and the second half in C to allow easy access to _my_tls. */ |