4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-22 16:49:45 +08:00

Cygwin: fix or delete a few comments to drop 32 bit references

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-07-14 18:32:53 +02:00
parent 4ce1a1ddc4
commit 1f962581ff
7 changed files with 17 additions and 24 deletions

View File

@ -35,8 +35,7 @@ bool NO_COPY wsock_started;
* the call. If this is an odd value then this * the call. If this is an odd value then this
* is a flag that non-existence of this function * is a flag that non-existence of this function
* is not a fatal error * is not a fatal error
* func addr (8 bytes) (64 bit ONLY!) * func addr (8 bytes) Address of the actual Win32 function. For the
* Address of the actual Win32 function. For the
* reason why this is necessary, see the below * reason why this is necessary, see the below
* description of the load_state. * description of the load_state.
* func name (n bytes) asciz string containing the name of the function * 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 * gets the process's load address, changes the contents
* here to point to the function address, and changes * here to point to the function address, and changes
* the address argument of the initial jmp call. * 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 * the address of the Win32 function is stored in the
* aforementioned Win32 function address slot and fetched * aforementioned Win32 function address slot and fetched
* there for a jmp *%rax call. This indirection is * there for a jmp *%rax call. This indirection is

View File

@ -1649,10 +1649,9 @@ _cygtls::call_signal_handler ()
NOTE: NOTE:
We DO NOT change the TEB's stack addresses and we DO NOT move the 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 _cygtls area to the alternate stack. This seems to work fine,
32 and 64 bit, but there may be Windows functions not working but there may be Windows functions not working correctly under
correctly under these circumstances. Especially 32 bit exception these circumstances.
handling may be broken.
On the other hand, if a Windows function crashed and we're handling On the other hand, if a Windows function crashed and we're handling
this here, moving the TEB stack addresses may be fatal. this here, moving the TEB stack addresses may be fatal.
@ -1752,7 +1751,7 @@ _cygtls::signal_debugger (siginfo_t& si)
if (incyg) if (incyg)
c._CX_instPtr = retaddr (); c._CX_instPtr = retaddr ();
memcpy (&context.uc_mcontext, &c, sizeof (CONTEXT)); 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 char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING
" ffffffff ffffffffffffffff")]; " ffffffff ffffffffffffffff")];
__small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %y %p", __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %y %p",

View File

@ -1504,7 +1504,7 @@ fhandler_dev_null::fhandler_dev_null () :
ssize_t ssize_t
fhandler_dev_null::write (const void *ptr, size_t len) 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 If you write > 4 GB in a single attempt, the bytes written returned
from by is numBytes & 0xffffffff. */ from by is numBytes & 0xffffffff. */
return len; return len;

View File

@ -29,13 +29,14 @@ static ptrdiff_t page_const;
static uintptr_t static uintptr_t
eval_start_address () eval_start_address ()
{ {
/* On 64 bit, we choose a fixed address outside the 32 bit area. The /* We choose a fixed address outside the low 32 bit arena, which is
executable starts at 0x1:00400000L, the Cygwin DLL starts at exclusively used by the OS now:
0x1:80040000L, other rebased DLLs are located in the region from - The executable starts at 0x1:00400000L
0x2:00000000L up to 0x4:00000000L, -auto-image-based DLLs are located - The Cygwin DLL starts at 0x1:80040000L
in the region from 0x4:00000000L up to 0x6:00000000L. Thread stacks - Rebased DLLs are located from 0x2:00000000L up to 0x4:00000000L
are located in the region from 0x6:00000000L up to 0x8:00000000L. - auto-image-based DLLs are located from 0x4:00000000L up to 0x6:00000000L
So the heap starts at 0x8:00000000L. */ - Thread stacks are located from 0x6:00000000L up to 0x8:00000000L.
- So the heap starts at 0x8:00000000L. */
uintptr_t start_address = 0x800000000L; uintptr_t start_address = 0x800000000L;
return start_address; return start_address;
} }

View File

@ -284,7 +284,6 @@ class mmap_record
LIST_ENTRY (mmap_record) mr_next; LIST_ENTRY (mmap_record) mr_next;
private: private:
/* 4 byte on 32 bit, 8 byte on 64 bit */
HANDLE mapping_hdl; HANDLE mapping_hdl;
SIZE_T len; SIZE_T len;
caddr_t base_address; caddr_t base_address;

View File

@ -63,9 +63,8 @@ class mtinfo_drive
lock_state lock; lock_state lock;
TAPE_GET_DRIVE_PARAMETERS _dp; TAPE_GET_DRIVE_PARAMETERS _dp;
TAPE_GET_MEDIA_PARAMETERS _mp; TAPE_GET_MEDIA_PARAMETERS _mp;
/* sizeof(OVERLAPPED) == 20 on 32 bit, 32 on 64 bit. A drive is always /* A drive is always opened exclusively by a single process, so instead
opened exclusively by a single process, though, so instead of the of the OVERLAPPED structure, we just keep track of the pointer to the
OVERLAPPED structure, we just keep track of the pointer to the
OVERLAPPED structure in the application's fhandler. */ OVERLAPPED structure in the application's fhandler. */
LPOVERLAPPED ov; LPOVERLAPPED ov;
struct status_flags struct status_flags

View File

@ -4175,10 +4175,6 @@ gethostid (void)
{ {
/* Fetch the globally unique MachineGuid value from /* Fetch the globally unique MachineGuid value from
HKLM/Software/Microsoft/Cryptography and hash it. */ 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 = 0x40291372; /* Choose a nice start value */ int32_t hostid = 0x40291372; /* Choose a nice start value */
WCHAR wguid[38]; WCHAR wguid[38];