--- bios_DGmmap.c 1999/07/19 11:46:43 1.1.2.2 +++ xc/programs/Xserver/hw/xfree86/os-support/dgux/bios_DGmmap.c 2000/02/11 21:26:16 @@ -51,7 +51,7 @@ return(-1); } psize = sysconf(_SC_PAGESIZE); - mlen = (Offset + Len + psize -1) & ~psize; + mlen = (Offset + Len + psize -1) & ~(psize - 1); ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ, MAP_SHARED, fd, (off_t)Base); if ((int)ptr == -1) --- lynx_mmap.c 1996/09/29 13:38:29 3.2 +++ xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_mmap.c 2000/02/11 21:26:28 @@ -44,7 +44,7 @@ char *p; int mlen; - mlen = (Offset + Len + 4095) & ~4096; + mlen = (Offset + Len + 4095) & ~4095; p = smem_create("BIOS-probe", (char *)Base, mlen, SM_READ); if (p == NULL) { --- solx86_mmap.c 2000/02/08 20:32:10 3.1.2.1 +++ xc/programs/Xserver/hw/xfree86/os-support/solx86/solx86_mmap.c 2000/02/11 21:26:40 @@ -59,7 +59,7 @@ strerror(errno)); return(-1); } - mlen = (Offset + Len + psize - 1) & ~psize; + mlen = (Offset + Len + psize - 1) & ~(psize - 1); ptr = mmap((caddr_t)0, mlen, PROT_READ, MAP_SHARED, fd, (off_t)Base); if ((int)ptr == -1) { --- bios_V4mmap.c 2000/02/08 20:32:11 3.4.2.1 +++ xc/programs/Xserver/hw/xfree86/os-support/sysv/bios_V4mmap.c 2000/02/11 21:26:47 @@ -51,7 +51,7 @@ strerror(errno)); return(-1); } - mlen = (Offset + Len + psize - 1) & ~psize; + mlen = (Offset + Len + psize - 1) & ~(psize - 1); ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ, MAP_SHARED, fd, (off_t)Base); if ((int)ptr == -1)