diff options
author | Ken Brown <kbrown@cornell.edu> | 2022-06-09 18:42:03 -0400 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2022-06-10 16:38:34 -0400 |
commit | bbfe79fb725a1f8833143416f10db822e04f902b (patch) | |
tree | d3a8baa648fd836298525f5203dccb820b9ab468 /winsup/cygwin/miscfuncs.cc | |
parent | b0cb9f85ca3626e0e68fd451c3090d253ceb4300 (diff) | |
download | newlib-bbfe79fb725a1f8833143416f10db822e04f902b.zip newlib-bbfe79fb725a1f8833143416f10db822e04f902b.tar.gz newlib-bbfe79fb725a1f8833143416f10db822e04f902b.tar.bz2 |
Cygwin: restore '#ifdef __x86_64__' for CPU-specific code
Commit e1ce752a1d, "Cygwin: remove miscellaneous 32-bit code", removed
most occurrences of '#ifdef __x86_64__'. Restore those occurrences
that guarded code specific to the AMD64 processor, and #error out if
the processor is different. This will make it easier to find
AMD64-specific code if we ever want to add support for a different
64-bit processor (e.g., ARM64).
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r-- | winsup/cygwin/miscfuncs.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index d9caf9b..c6d564a 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -413,6 +413,7 @@ pthread_wrapper (PVOID arg) /* Initialize new _cygtls. */ _my_tls.init_thread (wrapper_arg.stackbase - __CYGTLS_PADSIZE__, (DWORD (*)(void*, void*)) wrapper_arg.func); +#ifdef __x86_64__ __asm__ ("\n\ leaq %[WRAPPER_ARG], %%rbx # Load &wrapper_arg into rbx \n\ movq (%%rbx), %%r12 # Load thread func into r12 \n\ @@ -436,6 +437,9 @@ pthread_wrapper (PVOID arg) call *%%r12 # Call thread func \n" : : [WRAPPER_ARG] "o" (wrapper_arg), [CYGTLS] "i" (__CYGTLS_PADSIZE__)); +#else +#error unimplemented for this target +#endif /* pthread::thread_init_wrapper calls pthread::exit, which in turn calls ExitThread, so we should never arrive here. */ api_fatal ("Dumb thinko in pthread handling. Whip the developer."); @@ -698,6 +702,7 @@ err: return thread; } +#ifdef __x86_64__ /* These functions are almost verbatim FreeBSD code (even if the header of one file mentiones NetBSD), just wrapped in the minimum required code to make them work with the MS AMD64 ABI. @@ -900,6 +905,10 @@ wmempcpy: \n\ .seh_endproc \n\ "); +#else +#error unimplemented for this target +#endif + /* Signal the thread name to any attached debugger (See "How to: Set a Thread Name in Native Code" |