From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id AA4893857C7D; Thu, 14 Jul 2022 18:09:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA4893857C7D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: fix or delete a few comments to drop 32 bit references X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 4ce1a1ddc489f13e45abaf563e601e4df1e1c21c X-Git-Newrev: 1f962581ffb5255121922cd93dec1fa9a06406d9 Message-Id: <20220714180917.AA4893857C7D@sourceware.org> Date: Thu, 14 Jul 2022 18:09:17 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2022 18:09:17 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D1f962581ffb= 5255121922cd93dec1fa9a06406d9 commit 1f962581ffb5255121922cd93dec1fa9a06406d9 Author: Corinna Vinschen Date: Thu Jul 14 18:32:53 2022 +0200 Cygwin: fix or delete a few comments to drop 32 bit references =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/autoload.cc | 5 ++--- winsup/cygwin/exceptions.cc | 9 ++++----- winsup/cygwin/fhandler.cc | 2 +- winsup/cygwin/heap.cc | 15 ++++++++------- winsup/cygwin/mmap.cc | 1 - winsup/cygwin/mtinfo.h | 5 ++--- winsup/cygwin/syscalls.cc | 4 ---- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 8ab42d3e5..60171e889 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -35,8 +35,7 @@ bool NO_COPY wsock_started; * the call. If this is an odd value then this * is a flag that non-existence of this function * is not a fatal error - * func addr (8 bytes) (64 bit ONLY!) - * Address of the actual Win32 function. For the + * func addr (8 bytes) Address of the actual Win32 function. For the * reason why this is necessary, see the below * description of the load_state. * func name (n bytes) asciz string containing the name of the function @@ -49,7 +48,7 @@ bool NO_COPY wsock_started; * gets the process's load address, changes the contents * here to point to the function address, and changes * the address argument of the initial jmp call. - * On 64 bit, the jmp is not tweaked directly. Rather, + * On x86_64, the jmp is not tweaked directly. Rather, * the address of the Win32 function is stored in the * aforementioned Win32 function address slot and fetched * there for a jmp *%rax call. This indirection is diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index dd4f0f075..5a154c35b 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1649,10 +1649,9 @@ _cygtls::call_signal_handler () NOTE: =20 We DO NOT change the TEB's stack addresses and we DO NOT move the - _cygtls area to the alternate stack. This seems to work fine on - 32 and 64 bit, but there may be Windows functions not working - correctly under these circumstances. Especially 32 bit exception - handling may be broken. + _cygtls area to the alternate stack. This seems to work fine, + but there may be Windows functions not working correctly under + these circumstances. =20 On the other hand, if a Windows function crashed and we're handling this here, moving the TEB stack addresses may be fatal. @@ -1752,7 +1751,7 @@ _cygtls::signal_debugger (siginfo_t& si) if (incyg) c._CX_instPtr =3D retaddr (); memcpy (&context.uc_mcontext, &c, sizeof (CONTEXT)); - /* Enough space for 32/64 bit addresses */ + /* Enough space for 64 bit addresses */ char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffffffffffff")]; __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %y %p", diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 5671fea3c..9d6d01858 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1504,7 +1504,7 @@ fhandler_dev_null::fhandler_dev_null () : ssize_t fhandler_dev_null::write (const void *ptr, size_t len) { - /* Shortcut. This also fixes a problem with the NUL device on 64 bit: + /* Shortcut. This also fixes a problem with the NUL device on x86_64: If you write > 4 GB in a single attempt, the bytes written returned from by is numBytes & 0xffffffff. */ return len; diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc index fbec7d499..14c42e45c 100644 --- a/winsup/cygwin/heap.cc +++ b/winsup/cygwin/heap.cc @@ -29,13 +29,14 @@ static ptrdiff_t page_const; static uintptr_t eval_start_address () { - /* On 64 bit, we choose a fixed address outside the 32 bit area. The - executable starts at 0x1:00400000L, the Cygwin DLL starts at - 0x1:80040000L, other rebased DLLs are located in the region from - 0x2:00000000L up to 0x4:00000000L, -auto-image-based DLLs are located - in the region from 0x4:00000000L up to 0x6:00000000L. Thread stacks - are located in the region from 0x6:00000000L up to 0x8:00000000L. - So the heap starts at 0x8:00000000L. */ + /* We choose a fixed address outside the low 32 bit arena, which is + exclusively used by the OS now: + - The executable starts at 0x1:00400000L + - The Cygwin DLL starts at 0x1:80040000L + - Rebased DLLs are located from 0x2:00000000L up to 0x4:00000000L + - auto-image-based DLLs are located from 0x4:00000000L up to 0x6:0000= 0000L + - Thread stacks are located from 0x6:00000000L up to 0x8:00000000L. + - So the heap starts at 0x8:00000000L. */ uintptr_t start_address =3D 0x800000000L; return start_address; } diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 0c70d66f0..4f383627a 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -284,7 +284,6 @@ class mmap_record LIST_ENTRY (mmap_record) mr_next; =20 private: - /* 4 byte on 32 bit, 8 byte on 64 bit */ HANDLE mapping_hdl; SIZE_T len; caddr_t base_address; diff --git a/winsup/cygwin/mtinfo.h b/winsup/cygwin/mtinfo.h index d99cd2ef2..03aabbfd0 100644 --- a/winsup/cygwin/mtinfo.h +++ b/winsup/cygwin/mtinfo.h @@ -63,9 +63,8 @@ class mtinfo_drive lock_state lock; TAPE_GET_DRIVE_PARAMETERS _dp; TAPE_GET_MEDIA_PARAMETERS _mp; - /* sizeof(OVERLAPPED) =3D=3D 20 on 32 bit, 32 on 64 bit. A drive is alw= ays - opened exclusively by a single process, though, so instead of the - OVERLAPPED structure, we just keep track of the pointer to the + /* A drive is always opened exclusively by a single process, so instead + of the OVERLAPPED structure, we just keep track of the pointer to the OVERLAPPED structure in the application's fhandler. */ LPOVERLAPPED ov; struct status_flags diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 4c7de57c3..da8779743 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -4175,10 +4175,6 @@ gethostid (void) { /* Fetch the globally unique MachineGuid value from HKLM/Software/Microsoft/Cryptography and hash it. */ - - /* Caution: sizeof long might become > 4 when we go 64 bit, but gethostid - is supposed to return a 32 bit value, despite the return type long. - That's why hostid is *not* long here. */ int32_t hostid =3D 0x40291372; /* Choose a nice start value */ WCHAR wguid[38];