mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 00:40:31 +00:00
2002-10-01 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/dd/floppy/floppy.c: Changed PAGESIZE to PAGE_SIZE. * drivers/fs/cdfs/fcb.c: Ditto. * drivers/fs/cdfs/fsctl.c: Ditto. * drivers/fs/cdfs/rw.c: Ditto. * drivers/fs/ext2/dir.c: Ditto. * drivers/fs/ext2/inode.c: Ditto. * drivers/fs/ext2/rw.c: Ditto. * drivers/fs/ext2/super.c: Ditto. * drivers/fs/minix/blockdev.c: Ditto. * drivers/fs/minix/cache.c: Ditto. * drivers/fs/minix/inode.c: Ditto. * drivers/fs/minix/rw.c: Ditto. * drivers/fs/ntfs/fcb.c: Ditto. * drivers/fs/ntfs/ntfs.h: Ditto. * drivers/fs/vfat/create.c: Ditto. * drivers/fs/vfat/direntry.c: Ditto. * drivers/fs/vfat/dirwr.c: Ditto. * drivers/fs/vfat/fat.c: Ditto. * drivers/fs/vfat/fcb.c: Ditto. * drivers/fs/vfat/fsctl.c: Ditto. * drivers/fs/vfat/rw.c: Ditto. * drivers/storage/class2/class2.c: Ditto. * drivers/storage/scsiport/scsiport.c: Ditto. * hal/halx86/adapter.c: Ditto. * hal/halx86/mp.c: Ditto. * include/ddk/mmfuncs.h: Ditto. * include/ddk/mmtypes.h: Ditto. * include/ddk/i386/pagesize.h: Ditto. * include/ntdll/pagesize.h: Ditto. * lib/kernel32/process/create.c: Ditto. * lib/kernel32/thread/thread.c: Ditto. * lib/ntdll/ldr/utils.c: Ditto. * lib/ntdll/rtl/env.c: Ditto. * lib/ntdll/rtl/heap.c: Ditto. * lib/ntdll/rtl/ppb.c: Ditto. * lib/ntdll/rtl/process.c: Ditto. * lib/ntdll/rtl/thread.c: Ditto. * ntoskrnl/cc/copy.c: Ditto. * ntoskrnl/cc/view.c: Ditto. * ntoskrnl/ex/sysinfo.c: Ditto. * ntoskrnl/include/internal/i386/mm.h: Ditto. * ntoskrnl/io/mdl.c: Ditto. * ntoskrnl/ke/kthread.c: Ditto. * ntoskrnl/ke/i386/kernel.c: Ditto. * ntoskrnl/ldr/init.c: Ditto. * ntoskrnl/ldr/loader.c: Ditto. * ntoskrnl/mm/anonmem.c: Ditto. * ntoskrnl/mm/cont.c: Ditto. * ntoskrnl/mm/freelist.c: Ditto. * ntoskrnl/mm/iospace.c: Ditto. * ntoskrnl/mm/kmap.c: Ditto. * ntoskrnl/mm/marea.c: Ditto. * ntoskrnl/mm/mdl.c: Ditto. * ntoskrnl/mm/mminit.c: Ditto. * ntoskrnl/mm/ncache.c: Ditto. * ntoskrnl/mm/npool.c: Ditto. * ntoskrnl/mm/pagefile.c: Ditto. * ntoskrnl/mm/pageop.c: Ditto. * ntoskrnl/mm/section.c: Ditto. * ntoskrnl/mm/slab.c: Ditto. * ntoskrnl/mm/i386/page.c: Ditto. * ntoskrnl/ob/handle.c: Ditto. * ntoskrnl/ps/create.c: Ditto. * ntoskrnl/ps/process.c: Ditto. * ntoskrnl/ps/w32call.c: Ditto. * subsys/win32k/include/object.h: Ditto. svn path=/trunk/; revision=3594
This commit is contained in:
parent
e10af6e59e
commit
1e847489e4
67 changed files with 414 additions and 345 deletions
|
@ -1,3 +1,72 @@
|
|||
2002-10-01 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
|
||||
* drivers/dd/floppy/floppy.c: Changed PAGESIZE to PAGE_SIZE.
|
||||
* drivers/fs/cdfs/fcb.c: Ditto.
|
||||
* drivers/fs/cdfs/fsctl.c: Ditto.
|
||||
* drivers/fs/cdfs/rw.c: Ditto.
|
||||
* drivers/fs/ext2/dir.c: Ditto.
|
||||
* drivers/fs/ext2/inode.c: Ditto.
|
||||
* drivers/fs/ext2/rw.c: Ditto.
|
||||
* drivers/fs/ext2/super.c: Ditto.
|
||||
* drivers/fs/minix/blockdev.c: Ditto.
|
||||
* drivers/fs/minix/cache.c: Ditto.
|
||||
* drivers/fs/minix/inode.c: Ditto.
|
||||
* drivers/fs/minix/rw.c: Ditto.
|
||||
* drivers/fs/ntfs/fcb.c: Ditto.
|
||||
* drivers/fs/ntfs/ntfs.h: Ditto.
|
||||
* drivers/fs/vfat/create.c: Ditto.
|
||||
* drivers/fs/vfat/direntry.c: Ditto.
|
||||
* drivers/fs/vfat/dirwr.c: Ditto.
|
||||
* drivers/fs/vfat/fat.c: Ditto.
|
||||
* drivers/fs/vfat/fcb.c: Ditto.
|
||||
* drivers/fs/vfat/fsctl.c: Ditto.
|
||||
* drivers/fs/vfat/rw.c: Ditto.
|
||||
* drivers/storage/class2/class2.c: Ditto.
|
||||
* drivers/storage/scsiport/scsiport.c: Ditto.
|
||||
* hal/halx86/adapter.c: Ditto.
|
||||
* hal/halx86/mp.c: Ditto.
|
||||
* include/ddk/mmfuncs.h: Ditto.
|
||||
* include/ddk/mmtypes.h: Ditto.
|
||||
* include/ddk/i386/pagesize.h: Ditto.
|
||||
* include/ntdll/pagesize.h: Ditto.
|
||||
* lib/kernel32/process/create.c: Ditto.
|
||||
* lib/kernel32/thread/thread.c: Ditto.
|
||||
* lib/ntdll/ldr/utils.c: Ditto.
|
||||
* lib/ntdll/rtl/env.c: Ditto.
|
||||
* lib/ntdll/rtl/heap.c: Ditto.
|
||||
* lib/ntdll/rtl/ppb.c: Ditto.
|
||||
* lib/ntdll/rtl/process.c: Ditto.
|
||||
* lib/ntdll/rtl/thread.c: Ditto.
|
||||
* ntoskrnl/cc/copy.c: Ditto.
|
||||
* ntoskrnl/cc/view.c: Ditto.
|
||||
* ntoskrnl/ex/sysinfo.c: Ditto.
|
||||
* ntoskrnl/include/internal/i386/mm.h: Ditto.
|
||||
* ntoskrnl/io/mdl.c: Ditto.
|
||||
* ntoskrnl/ke/kthread.c: Ditto.
|
||||
* ntoskrnl/ke/i386/kernel.c: Ditto.
|
||||
* ntoskrnl/ldr/init.c: Ditto.
|
||||
* ntoskrnl/ldr/loader.c: Ditto.
|
||||
* ntoskrnl/mm/anonmem.c: Ditto.
|
||||
* ntoskrnl/mm/cont.c: Ditto.
|
||||
* ntoskrnl/mm/freelist.c: Ditto.
|
||||
* ntoskrnl/mm/iospace.c: Ditto.
|
||||
* ntoskrnl/mm/kmap.c: Ditto.
|
||||
* ntoskrnl/mm/marea.c: Ditto.
|
||||
* ntoskrnl/mm/mdl.c: Ditto.
|
||||
* ntoskrnl/mm/mminit.c: Ditto.
|
||||
* ntoskrnl/mm/ncache.c: Ditto.
|
||||
* ntoskrnl/mm/npool.c: Ditto.
|
||||
* ntoskrnl/mm/pagefile.c: Ditto.
|
||||
* ntoskrnl/mm/pageop.c: Ditto.
|
||||
* ntoskrnl/mm/section.c: Ditto.
|
||||
* ntoskrnl/mm/slab.c: Ditto.
|
||||
* ntoskrnl/mm/i386/page.c: Ditto.
|
||||
* ntoskrnl/ob/handle.c: Ditto.
|
||||
* ntoskrnl/ps/create.c: Ditto.
|
||||
* ntoskrnl/ps/process.c: Ditto.
|
||||
* ntoskrnl/ps/w32call.c: Ditto.
|
||||
* subsys/win32k/include/object.h: Ditto.
|
||||
|
||||
2002-10-01 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
|
||||
* lib/ntdll/string/ctype.c: Undefine __MSVCRT__ to not have mingw
|
||||
|
|
|
@ -216,7 +216,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
|
|||
CHECKPOINT;
|
||||
Status = IoAllocateAdapterChannel( ControllerExtension->AdapterObject,
|
||||
DeviceObject,
|
||||
0x3000/PAGESIZE, // max track size is 12k
|
||||
0x3000/PAGE_SIZE, // max track size is 12k
|
||||
FloppyAdapterControl,
|
||||
ControllerExtension );
|
||||
if( !NT_SUCCESS( Status ) )
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: fcb.c,v 1.10 2002/09/09 17:26:24 hbirr Exp $
|
||||
/* $Id: fcb.c,v 1.11 2002/10/01 19:27:16 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -246,7 +246,7 @@ CdfsFCBInitializeCache(PVCB Vcb,
|
|||
|
||||
Status = CcRosInitializeFileCache(FileObject,
|
||||
&Fcb->RFCB.Bcb,
|
||||
PAGESIZE);
|
||||
PAGE_SIZE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("CcRosInitializeFileCache failed\n");
|
||||
|
@ -427,7 +427,7 @@ CdfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb,
|
|||
{
|
||||
Status = CcRosInitializeFileCache(FileObject,
|
||||
&Fcb->RFCB.Bcb,
|
||||
PAGESIZE);
|
||||
PAGE_SIZE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("CcRosInitializeFileCache failed\n");
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: fsctl.c,v 1.11 2002/09/17 20:42:59 hbirr Exp $
|
||||
/* $Id: fsctl.c,v 1.12 2002/10/01 19:27:16 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -399,7 +399,7 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
|
|||
|
||||
Status = CcRosInitializeFileCache(DeviceExt->StreamFileObject,
|
||||
&Fcb->RFCB.Bcb,
|
||||
PAGESIZE);
|
||||
PAGE_SIZE);
|
||||
if (!NT_SUCCESS (Status))
|
||||
{
|
||||
DbgPrint("CcRosInitializeFileCache failed\n");
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: rw.c,v 1.6 2002/09/15 22:26:52 hbirr Exp $
|
||||
/* $Id: rw.c,v 1.7 2002/10/01 19:27:16 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -88,7 +88,7 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
|
||||
if (FileObject->PrivateCacheMap == NULL)
|
||||
{
|
||||
CcRosInitializeFileCache(FileObject, &Fcb->RFCB.Bcb, PAGESIZE);
|
||||
CcRosInitializeFileCache(FileObject, &Fcb->RFCB.Bcb, PAGE_SIZE);
|
||||
}
|
||||
|
||||
FileOffset.QuadPart = (LONGLONG)ReadOffset;
|
||||
|
|
|
@ -311,7 +311,7 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
|||
DPRINT("Found file\n");
|
||||
|
||||
Fcb->inode = current_inode;
|
||||
CcRosInitializeFileCache(FileObject, &Fcb->Bcb, PAGESIZE*3);
|
||||
CcRosInitializeFileCache(FileObject, &Fcb->Bcb, PAGE_SIZE*3);
|
||||
FileObject->FsContext = Fcb;
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
|
|
|
@ -44,7 +44,7 @@ struct ext2_group_desc* Ext2LoadGroupDesc(PDEVICE_EXTENSION DeviceExt,
|
|||
|
||||
}
|
||||
|
||||
#define INODES_PER_PAGE (PAGESIZE / sizeof(struct ext2_inode))
|
||||
#define INODES_PER_PAGE (PAGE_SIZE / sizeof(struct ext2_inode))
|
||||
#define INODES_PER_BLOCK (BLOCKSIZE / sizeof(struct ext2_inode))
|
||||
|
||||
VOID Ext2LoadInode(PDEVICE_EXTENSION DeviceExt,
|
||||
|
|
|
@ -73,9 +73,9 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
Ext2ReleaseInode(DeviceExt,
|
||||
&Fcb->i);
|
||||
|
||||
if ((Offset % PAGESIZE) != 0)
|
||||
if ((Offset % PAGE_SIZE) != 0)
|
||||
{
|
||||
Delta = min(PAGESIZE - (Offset % PAGESIZE),Length);
|
||||
Delta = min(PAGE_SIZE - (Offset % PAGE_SIZE),Length);
|
||||
CcRequestCachePage(Fcb->Bcb,
|
||||
Offset,
|
||||
&BaseAddress,
|
||||
|
@ -88,7 +88,7 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
BaseAddress,
|
||||
Offset / BLOCKSIZE);
|
||||
}
|
||||
memcpy(Buffer, BaseAddress + (Offset % PAGESIZE), Delta);
|
||||
memcpy(Buffer, BaseAddress + (Offset % PAGE_SIZE), Delta);
|
||||
CcReleaseCachePage(Fcb->Bcb,
|
||||
CacheSeg,
|
||||
TRUE);
|
||||
|
@ -97,7 +97,7 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
Buffer = Buffer + Delta;
|
||||
}
|
||||
CHECKPOINT;
|
||||
for (i=0; i<(Length/PAGESIZE); i++)
|
||||
for (i=0; i<(Length/PAGE_SIZE); i++)
|
||||
{
|
||||
CcRequestCachePage(Fcb->Bcb,
|
||||
Offset,
|
||||
|
@ -111,16 +111,16 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
BaseAddress,
|
||||
(Offset / BLOCKSIZE));
|
||||
}
|
||||
memcpy(Buffer, BaseAddress, PAGESIZE);
|
||||
memcpy(Buffer, BaseAddress, PAGE_SIZE);
|
||||
CcReleaseCachePage(Fcb->Bcb,
|
||||
CacheSeg,
|
||||
TRUE);
|
||||
Length = Length - PAGESIZE;
|
||||
Offset = Offset + PAGESIZE;
|
||||
Buffer = Buffer + PAGESIZE;
|
||||
Length = Length - PAGE_SIZE;
|
||||
Offset = Offset + PAGE_SIZE;
|
||||
Buffer = Buffer + PAGE_SIZE;
|
||||
}
|
||||
CHECKPOINT;
|
||||
if ((Length % PAGESIZE) != 0)
|
||||
if ((Length % PAGE_SIZE) != 0)
|
||||
{
|
||||
CcRequestCachePage(Fcb->Bcb,
|
||||
Offset,
|
||||
|
|
|
@ -117,7 +117,7 @@ NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount)
|
|||
DeviceExt->superblock = superblock;
|
||||
CcRosInitializeFileCache(DeviceExt->FileObject,
|
||||
&DeviceExt->Bcb,
|
||||
PAGESIZE * 3);
|
||||
PAGE_SIZE * 3);
|
||||
|
||||
DPRINT("Ext2Mount() = STATUS_SUCCESS\n");
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ BOOLEAN MinixReadPage(PDEVICE_OBJECT DeviceObject,
|
|||
for (i=0; i<4; i++)
|
||||
{
|
||||
Result = MinixReadSector(DeviceObject,
|
||||
(Offset + (i * PAGESIZE)) / BLOCKSIZE,
|
||||
(Buffer + (i * PAGESIZE)));
|
||||
(Offset + (i * PAGE_SIZE)) / BLOCKSIZE,
|
||||
(Buffer + (i * PAGE_SIZE)));
|
||||
if (!Result)
|
||||
{
|
||||
return(Result);
|
||||
|
|
|
@ -38,7 +38,7 @@ NTSTATUS MinixRequestCacheBlock(PDEVICE_OBJECT DeviceObject,
|
|||
PAGE_ROUND_DOWN(FileOffset),
|
||||
BaseAddress);
|
||||
}
|
||||
BaseAddress = BaseAddress + (FileOffset % PAGESIZE);
|
||||
BaseAddress = BaseAddress + (FileOffset % PAGE_SIZE);
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ NTSTATUS MinixReadInode(PDEVICE_OBJECT DeviceObject,
|
|||
DPRINT("Reading block %x offset %x\n",block,block*BLOCKSIZE);
|
||||
DPRINT("Index %x\n",(ino-1)%MINIX_INODES_PER_BLOCK);
|
||||
|
||||
BaseAddress = ExAllocatePool(NonPagedPool, PAGESIZE);
|
||||
BaseAddress = ExAllocatePool(NonPagedPool, PAGE_SIZE);
|
||||
|
||||
MinixReadPage(DeviceObject,
|
||||
block,
|
||||
|
|
|
@ -94,9 +94,9 @@ MinixRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
Length = FsContext->inode.i_size - Offset;
|
||||
}
|
||||
|
||||
if ((Offset%PAGESIZE)!=0)
|
||||
if ((Offset%PAGE_SIZE)!=0)
|
||||
{
|
||||
CurrentOffset = Offset - (Offset%PAGESIZE);
|
||||
CurrentOffset = Offset - (Offset%PAGE_SIZE);
|
||||
|
||||
MinixReadFilePage(DeviceObject,
|
||||
DeviceExt,
|
||||
|
@ -105,21 +105,21 @@ MinixRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
&DiskBuffer);
|
||||
|
||||
memcpy(Buffer,
|
||||
DiskBuffer+(Offset%PAGESIZE),
|
||||
min(PAGESIZE - (Offset%PAGESIZE),Length));
|
||||
DiskBuffer+(Offset%PAGE_SIZE),
|
||||
min(PAGE_SIZE - (Offset%PAGE_SIZE),Length));
|
||||
|
||||
ExFreePool(DiskBuffer);
|
||||
|
||||
DPRINT("(BLOCKSIZE - (Offset%BLOCKSIZE)) %d\n",
|
||||
(BLOCKSIZE - (Offset%BLOCKSIZE)));
|
||||
DPRINT("Length %d\n",Length);
|
||||
CurrentOffset = CurrentOffset + PAGESIZE;
|
||||
Buffer = Buffer + PAGESIZE - (Offset%PAGESIZE);
|
||||
Length = Length - min(PAGESIZE - (Offset%PAGESIZE),Length);
|
||||
CurrentOffset = CurrentOffset + PAGE_SIZE;
|
||||
Buffer = Buffer + PAGE_SIZE - (Offset%PAGE_SIZE);
|
||||
Length = Length - min(PAGE_SIZE - (Offset%PAGE_SIZE),Length);
|
||||
DPRINT("CurrentOffset %d Buffer %x Length %d\n",CurrentOffset,Buffer,
|
||||
Length);
|
||||
}
|
||||
for (i=0;i<(Length/PAGESIZE);i++)
|
||||
for (i=0;i<(Length/PAGE_SIZE);i++)
|
||||
{
|
||||
CHECKPOINT;
|
||||
|
||||
|
@ -130,18 +130,18 @@ MinixRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
FsContext,
|
||||
CurrentOffset,
|
||||
&DiskBuffer);
|
||||
memcpy(Buffer, DiskBuffer, PAGESIZE);
|
||||
memcpy(Buffer, DiskBuffer, PAGE_SIZE);
|
||||
|
||||
ExFreePool(DiskBuffer);
|
||||
|
||||
CurrentOffset = CurrentOffset + PAGESIZE;
|
||||
Buffer = Buffer + PAGESIZE;
|
||||
CurrentOffset = CurrentOffset + PAGE_SIZE;
|
||||
Buffer = Buffer + PAGE_SIZE;
|
||||
}
|
||||
if ((Length%PAGESIZE) > 0)
|
||||
if ((Length%PAGE_SIZE) > 0)
|
||||
{
|
||||
CHECKPOINT;
|
||||
|
||||
DPRINT("Length %x Buffer %x\n",(Length%PAGESIZE),Buffer);
|
||||
DPRINT("Length %x Buffer %x\n",(Length%PAGE_SIZE),Buffer);
|
||||
|
||||
MinixReadFilePage(DeviceObject,
|
||||
DeviceExt,
|
||||
|
@ -149,7 +149,7 @@ MinixRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
CurrentOffset,
|
||||
&DiskBuffer);
|
||||
|
||||
memcpy(Buffer, DiskBuffer, (Length%PAGESIZE));
|
||||
memcpy(Buffer, DiskBuffer, (Length%PAGE_SIZE));
|
||||
|
||||
ExFreePool(DiskBuffer);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: fcb.c,v 1.3 2002/09/08 10:22:11 chorns Exp $
|
||||
/* $Id: fcb.c,v 1.4 2002/10/01 19:27:17 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -273,9 +273,9 @@ NtfsMakeRootFCB(PDEVICE_EXTENSION Vcb)
|
|||
// Fcb->Entry.FileFlags = 0x02; // FILE_ATTRIBUTE_DIRECTORY;
|
||||
Fcb->RefCount = 1;
|
||||
Fcb->DirIndex = 0;
|
||||
Fcb->RFCB.FileSize.QuadPart = PAGESIZE;//Vcb->CdInfo.RootSize;
|
||||
Fcb->RFCB.ValidDataLength.QuadPart = PAGESIZE;//Vcb->CdInfo.RootSize;
|
||||
Fcb->RFCB.AllocationSize.QuadPart = PAGESIZE;//Vcb->CdInfo.RootSize;
|
||||
Fcb->RFCB.FileSize.QuadPart = PAGE_SIZE;//Vcb->CdInfo.RootSize;
|
||||
Fcb->RFCB.ValidDataLength.QuadPart = PAGE_SIZE;//Vcb->CdInfo.RootSize;
|
||||
Fcb->RFCB.AllocationSize.QuadPart = PAGE_SIZE;//Vcb->CdInfo.RootSize;
|
||||
|
||||
NtfsFCBInitializeCache(Vcb, Fcb);
|
||||
NtfsAddFCBToTable(Vcb, Fcb);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
|
||||
#define CACHEPAGESIZE(pDeviceExt) \
|
||||
((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGESIZE ? \
|
||||
(pDeviceExt)->NtfsInfo.BytesPerCluster : PAGESIZE)
|
||||
((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGE_SIZE ? \
|
||||
(pDeviceExt)->NtfsInfo.BytesPerCluster : PAGE_SIZE)
|
||||
|
||||
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: create.c,v 1.46 2002/09/08 10:22:12 chorns Exp $
|
||||
/* $Id: create.c,v 1.47 2002/10/01 19:27:17 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: services/fs/vfat/create.c
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
#define ENTRIES_PER_PAGE (PAGESIZE / sizeof (FATDirEntry))
|
||||
#define ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FATDirEntry))
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
@ -175,7 +175,7 @@ GetEntryName(PVOID *pContext,
|
|||
Offset = 0;
|
||||
CcUnpinData(*pContext);
|
||||
FileOffset.QuadPart = *pIndex * sizeof(FATDirEntry);
|
||||
if(!CcMapData(FileObject, &FileOffset, PAGESIZE, TRUE, pContext, Block))
|
||||
if(!CcMapData(FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, Block))
|
||||
{
|
||||
*pContext = NULL;
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
|
@ -204,7 +204,7 @@ GetEntryName(PVOID *pContext,
|
|||
Offset = 0;
|
||||
CcUnpinData(*pContext);
|
||||
FileOffset.QuadPart = *pIndex * sizeof(FATDirEntry);
|
||||
if(!CcMapData(FileObject, &FileOffset, PAGESIZE, TRUE, pContext, Block))
|
||||
if(!CcMapData(FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, Block))
|
||||
{
|
||||
*pContext = NULL;
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
|
@ -263,7 +263,7 @@ ReadVolumeLabel (PDEVICE_EXTENSION DeviceExt, PVPB Vpb)
|
|||
}
|
||||
FileOffset.u.HighPart = 0;
|
||||
FileOffset.u.LowPart = (DirIndex - Offset) * sizeof(FATDirEntry);
|
||||
if (!CcMapData(pFcb->FileObject, &FileOffset, PAGESIZE, TRUE, &Context, (PVOID*)&Entry))
|
||||
if (!CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry))
|
||||
{
|
||||
Context = NULL;
|
||||
break;
|
||||
|
@ -400,7 +400,7 @@ FindFile (PDEVICE_EXTENSION DeviceExt,
|
|||
CcUnpinData(Context);
|
||||
}
|
||||
FileOffset.QuadPart = (DirIndex - Offset) * sizeof(FATDirEntry);
|
||||
if (!CcMapData(Parent->FileObject, &FileOffset, PAGESIZE, TRUE,
|
||||
if (!CcMapData(Parent->FileObject, &FileOffset, PAGE_SIZE, TRUE,
|
||||
&Context, (PVOID*)&block))
|
||||
{
|
||||
Context = NULL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: direntry.c,v 1.8 2002/09/08 10:22:12 chorns Exp $
|
||||
/* $Id: direntry.c,v 1.9 2002/10/01 19:27:17 chorns Exp $
|
||||
*
|
||||
*
|
||||
* FILE: DirEntry.c
|
||||
|
@ -20,8 +20,8 @@
|
|||
|
||||
#include "vfat.h"
|
||||
|
||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGESIZE ? \
|
||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGESIZE)
|
||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \
|
||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE)
|
||||
|
||||
#define ENTRIES_PER_CACHEPAGE(pDeviceExt) (ENTRIES_PER_SECTOR * \
|
||||
(CACHEPAGESIZE(pDeviceExt) / ((pDeviceExt)->FatInfo.BytesPerSector)))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: dirwr.c,v 1.30 2002/09/08 10:22:12 chorns Exp $
|
||||
/* $Id: dirwr.c,v 1.31 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -612,23 +612,23 @@ delEntry (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT pFileObject)
|
|||
Offset.u.HighPart = 0;
|
||||
for (i = startEntry; i <= Entry; i++)
|
||||
{
|
||||
if (Context == NULL || ((i * sizeof(FATDirEntry)) % PAGESIZE) == 0)
|
||||
if (Context == NULL || ((i * sizeof(FATDirEntry)) % PAGE_SIZE) == 0)
|
||||
{
|
||||
if (Context)
|
||||
{
|
||||
CcSetDirtyPinnedData(Context, NULL);
|
||||
CcUnpinData(Context);
|
||||
}
|
||||
Offset.u.LowPart = (i * sizeof(FATDirEntry) / PAGESIZE) * PAGESIZE;
|
||||
CcMapData (pDirFcb->FileObject, &Offset, PAGESIZE, TRUE,
|
||||
Offset.u.LowPart = (i * sizeof(FATDirEntry) / PAGE_SIZE) * PAGE_SIZE;
|
||||
CcMapData (pDirFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
|
||||
&Context, (PVOID*)&pDirEntry);
|
||||
}
|
||||
pDirEntry[i % (PAGESIZE / sizeof(FATDirEntry))].Filename[0] = 0xe5;
|
||||
pDirEntry[i % (PAGE_SIZE / sizeof(FATDirEntry))].Filename[0] = 0xe5;
|
||||
if (i == Entry)
|
||||
{
|
||||
CurrentCluster =
|
||||
vfatDirEntryGetFirstCluster (DeviceExt,
|
||||
&pDirEntry[i % (PAGESIZE / sizeof(FATDirEntry))]);
|
||||
&pDirEntry[i % (PAGE_SIZE / sizeof(FATDirEntry))]);
|
||||
}
|
||||
}
|
||||
if (Context)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: fat.c,v 1.39 2002/09/08 10:22:12 chorns Exp $
|
||||
* $Id: fat.c,v 1.40 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -24,8 +24,8 @@
|
|||
|
||||
#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
|
||||
|
||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGESIZE ? \
|
||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGESIZE)
|
||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \
|
||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE)
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: fcb.c,v 1.20 2002/09/08 10:22:12 chorns Exp $
|
||||
/* $Id: fcb.c,v 1.21 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
*
|
||||
* FILE: fcb.c
|
||||
|
@ -187,8 +187,8 @@ vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb)
|
|||
fcb->pDevExt = vcb;
|
||||
|
||||
|
||||
fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGESIZE) ?
|
||||
vcb->FatInfo.BytesPerCluster : PAGESIZE;
|
||||
fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGE_SIZE) ?
|
||||
vcb->FatInfo.BytesPerCluster : PAGE_SIZE;
|
||||
|
||||
status = CcRosInitializeFileCache (fileObject,
|
||||
&fcb->RFCB.Bcb,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: fsctl.c,v 1.10 2002/09/08 10:22:12 chorns Exp $
|
||||
/* $Id: fsctl.c,v 1.11 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -36,8 +36,8 @@
|
|||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGESIZE ? \
|
||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGESIZE)
|
||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \
|
||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE)
|
||||
|
||||
|
||||
static NTSTATUS
|
||||
|
@ -181,14 +181,14 @@ VfatMountDevice(PDEVICE_EXTENSION DeviceExt,
|
|||
return(Status);
|
||||
}
|
||||
|
||||
if (DeviceExt->FatInfo.BytesPerCluster >= PAGESIZE &&
|
||||
(DeviceExt->FatInfo.BytesPerCluster % PAGESIZE) != 0)
|
||||
if (DeviceExt->FatInfo.BytesPerCluster >= PAGE_SIZE &&
|
||||
(DeviceExt->FatInfo.BytesPerCluster % PAGE_SIZE) != 0)
|
||||
{
|
||||
DbgPrint("(%s:%d) Invalid cluster size\n", __FILE__, __LINE__);
|
||||
KeBugCheck(0);
|
||||
}
|
||||
else if (DeviceExt->FatInfo.BytesPerCluster < PAGESIZE &&
|
||||
(PAGESIZE % DeviceExt->FatInfo.BytesPerCluster) != 0)
|
||||
else if (DeviceExt->FatInfo.BytesPerCluster < PAGE_SIZE &&
|
||||
(PAGE_SIZE % DeviceExt->FatInfo.BytesPerCluster) != 0)
|
||||
{
|
||||
DbgPrint("(%s:%d) Invalid cluster size2\n", __FILE__, __LINE__);
|
||||
KeBugCheck(0);
|
||||
|
@ -323,7 +323,7 @@ VfatMount (PVFAT_IRP_CONTEXT IrpContext)
|
|||
}
|
||||
else
|
||||
{
|
||||
Status = CcRosInitializeFileCache(DeviceExt->FATFileObject, &Fcb->RFCB.Bcb, 2 * PAGESIZE);
|
||||
Status = CcRosInitializeFileCache(DeviceExt->FATFileObject, &Fcb->RFCB.Bcb, 2 * PAGE_SIZE);
|
||||
}
|
||||
if (!NT_SUCCESS (Status))
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/* $Id: rw.c,v 1.48 2002/09/08 10:22:12 chorns Exp $
|
||||
/* $Id: rw.c,v 1.49 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -696,9 +696,9 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext)
|
|||
{
|
||||
ULONG CacheSize;
|
||||
CacheSize = IrpContext->DeviceExt->FatInfo.BytesPerCluster;
|
||||
if (CacheSize < PAGESIZE)
|
||||
if (CacheSize < PAGE_SIZE)
|
||||
{
|
||||
CacheSize = PAGESIZE;
|
||||
CacheSize = PAGE_SIZE;
|
||||
}
|
||||
CcRosInitializeFileCache(IrpContext->FileObject, &Fcb->RFCB.Bcb, CacheSize);
|
||||
}
|
||||
|
@ -967,9 +967,9 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext)
|
|||
{
|
||||
ULONG CacheSize;
|
||||
CacheSize = IrpContext->DeviceExt->FatInfo.BytesPerCluster;
|
||||
if (CacheSize < PAGESIZE)
|
||||
if (CacheSize < PAGE_SIZE)
|
||||
{
|
||||
CacheSize = PAGESIZE;
|
||||
CacheSize = PAGE_SIZE;
|
||||
}
|
||||
CcRosInitializeFileCache(IrpContext->FileObject, &Fcb->RFCB.Bcb, CacheSize);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: class2.c,v 1.25 2002/09/19 16:18:00 ekohl Exp $
|
||||
/* $Id: class2.c,v 1.26 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -1534,11 +1534,11 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
|||
/* Adjust the maximum transfer length */
|
||||
CurrentTransferPages = DeviceExtension->PortCapabilities->MaximumPhysicalPages;
|
||||
|
||||
if (MaximumTransferLength > CurrentTransferPages * PAGESIZE)
|
||||
MaximumTransferLength = CurrentTransferPages * PAGESIZE;
|
||||
if (MaximumTransferLength > CurrentTransferPages * PAGE_SIZE)
|
||||
MaximumTransferLength = CurrentTransferPages * PAGE_SIZE;
|
||||
|
||||
if (MaximumTransferLength == 0)
|
||||
MaximumTransferLength = PAGESIZE;
|
||||
MaximumTransferLength = PAGE_SIZE;
|
||||
|
||||
IoMarkIrpPending(Irp);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: scsiport.c,v 1.22 2002/09/20 05:40:28 ei Exp $
|
||||
/* $Id: scsiport.c,v 1.23 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -1169,7 +1169,7 @@ ScsiPortCreatePortDevice(IN PDRIVER_OBJECT DriverObject,
|
|||
PortCapabilities->MaximumTransferLength =
|
||||
PortDeviceExtension->PortConfig.MaximumTransferLength;
|
||||
PortCapabilities->MaximumPhysicalPages =
|
||||
PortCapabilities->MaximumTransferLength / PAGESIZE;
|
||||
PortCapabilities->MaximumTransferLength / PAGE_SIZE;
|
||||
PortCapabilities->SupportedAsynchronousEvents = 0; /* FIXME */
|
||||
PortCapabilities->AlignmentMask =
|
||||
PortDeviceExtension->PortConfig.AlignmentMask;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: adapter.c,v 1.3 2002/09/08 10:22:24 chorns Exp $
|
||||
/* $Id: adapter.c,v 1.4 2002/10/01 19:27:18 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -33,7 +33,7 @@ HalAllocateAdapterChannel(PADAPTER_OBJECT AdapterObject,
|
|||
LARGE_INTEGER MaxAddress;
|
||||
|
||||
MaxAddress.QuadPart = 0x1000000;
|
||||
Buffer = MmAllocateContiguousAlignedMemory( NumberOfMapRegisters * PAGESIZE,
|
||||
Buffer = MmAllocateContiguousAlignedMemory( NumberOfMapRegisters * PAGE_SIZE,
|
||||
MaxAddress,
|
||||
0x10000 );
|
||||
if( !Buffer )
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mp.c,v 1.3 2002/09/08 10:22:24 chorns Exp $
|
||||
/* $Id: mp.c,v 1.4 2002/10/01 19:27:19 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -1561,7 +1561,7 @@ HaliInitBSP(
|
|||
CommonBase = (PULONG)COMMON_AREA;
|
||||
|
||||
/* Copy bootstrap code to common area */
|
||||
memcpy((PVOID)((ULONG)CommonBase + PAGESIZE),
|
||||
memcpy((PVOID)((ULONG)CommonBase + PAGE_SIZE),
|
||||
&APstart,
|
||||
(ULONG)&APend - (ULONG)&APstart + 1);
|
||||
|
||||
|
@ -1570,10 +1570,10 @@ HaliInitBSP(
|
|||
|
||||
/* Set warm reset vector */
|
||||
ps = (PUSHORT)((ULONG)BIOSBase + 0x467);
|
||||
*ps = (COMMON_AREA + PAGESIZE) & 0xF;
|
||||
*ps = (COMMON_AREA + PAGE_SIZE) & 0xF;
|
||||
|
||||
ps = (PUSHORT)((ULONG)BIOSBase + 0x469);
|
||||
*ps = (COMMON_AREA + PAGESIZE) >> 4;
|
||||
*ps = (COMMON_AREA + PAGE_SIZE) >> 4;
|
||||
|
||||
/* Calibrate APIC timer */
|
||||
APICCalibrateTimer(0);
|
||||
|
@ -1652,7 +1652,7 @@ HalInitializeProcessor (
|
|||
|
||||
APICSendIPI(CPUMap[CPU].APICId,
|
||||
0,
|
||||
APIC_DM_STARTUP | ((COMMON_AREA + PAGESIZE) >> 12),
|
||||
APIC_DM_STARTUP | ((COMMON_AREA + PAGE_SIZE) >> 12),
|
||||
APIC_ICR0_LEVEL_DEASSERT);
|
||||
|
||||
/* Wait up to 10ms for IPI to be delivered */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __INCLUDE_DDK_I386_PAGESIZE_H
|
||||
#define __INCLUDE_DDK_I386_PAGESIZE_H
|
||||
|
||||
#define PAGESIZE (4096)
|
||||
#define PAGE_SIZE (4096)
|
||||
|
||||
#endif /* __INCLUDE_DDK_I386_PAGESIZE_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _INCLUDE_DDK_MMFUNCS_H
|
||||
#define _INCLUDE_DDK_MMFUNCS_H
|
||||
/* $Id: mmfuncs.h,v 1.13 2002/09/08 10:47:44 chorns Exp $ */
|
||||
/* $Id: mmfuncs.h,v 1.14 2002/10/01 19:27:19 chorns Exp $ */
|
||||
/* MEMORY MANAGMENT ******************************************************/
|
||||
|
||||
|
||||
|
@ -35,12 +35,12 @@ extern inline unsigned int ADDRESS_AND_SIZE_TO_SPAN_PAGES(PVOID Va,
|
|||
|
||||
HighestAddr = PAGE_ROUND_UP(Size + ((ULONG)Va));
|
||||
LowestAddr = PAGE_ROUND_DOWN((ULONG)Va);
|
||||
return((HighestAddr - LowestAddr) / PAGESIZE);
|
||||
return((HighestAddr - LowestAddr) / PAGE_SIZE);
|
||||
}
|
||||
#endif
|
||||
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va, Size) \
|
||||
(ULONG)((PAGE_ROUND_UP((Size) + ((ULONG)(Va))) - \
|
||||
PAGE_ROUND_DOWN((ULONG)(Va))) / PAGESIZE)
|
||||
PAGE_ROUND_DOWN((ULONG)(Va))) / PAGE_SIZE)
|
||||
|
||||
/*
|
||||
* FUNCTION: Returns FALSE is the pointer is NULL, TRUE otherwise
|
||||
|
@ -50,7 +50,7 @@ extern inline unsigned int ADDRESS_AND_SIZE_TO_SPAN_PAGES(PVOID Va,
|
|||
/*
|
||||
* FUNCTION: Returns the byte offset of the address within its page
|
||||
*/
|
||||
#define BYTE_OFFSET(va) (((ULONG)va)%PAGESIZE)
|
||||
#define BYTE_OFFSET(va) (((ULONG)va)%PAGE_SIZE)
|
||||
|
||||
/*
|
||||
* FUNCTION: Takes a count in bytes and returns the number of pages
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mmtypes.h,v 1.13 2002/09/08 10:47:44 chorns Exp $ */
|
||||
/* $Id: mmtypes.h,v 1.14 2002/10/01 19:27:19 chorns Exp $ */
|
||||
|
||||
#ifndef _INCLUDE_DDK_MMTYPES_H
|
||||
#define _INCLUDE_DDK_MMTYPES_H
|
||||
|
@ -7,7 +7,7 @@
|
|||
#include <ntos/mm.h>
|
||||
|
||||
|
||||
#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGESIZE) ? ((((ULONG)x)&(~0xfff))+0x1000) : ((ULONG)x) )
|
||||
#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGE_SIZE) ? ((((ULONG)x)&(~0xfff))+0x1000) : ((ULONG)x) )
|
||||
#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~0xfff))
|
||||
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
*/
|
||||
|
||||
#ifdef i386
|
||||
#define PAGESIZE (4096)
|
||||
#define PAGE_SIZE (4096)
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: create.c,v 1.53 2002/09/13 18:55:31 hbirr Exp $
|
||||
/* $Id: create.c,v 1.54 2002/10/01 19:27:19 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -209,12 +209,12 @@ KlCreateFirstThread(HANDLE ProcessHandle,
|
|||
InitialTeb.StackReserve = (StackReserve < 0x100000) ? 0x100000 : StackReserve;
|
||||
/* FIXME: use correct commit size */
|
||||
#if 0
|
||||
InitialTeb.StackCommit = (StackCommit < PAGESIZE) ? PAGESIZE : StackCommit;
|
||||
InitialTeb.StackCommit = (StackCommit < PAGE_SIZE) ? PAGE_SIZE : StackCommit;
|
||||
#endif
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE;
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE;
|
||||
|
||||
/* size of guard page */
|
||||
InitialTeb.StackCommit += PAGESIZE;
|
||||
InitialTeb.StackCommit += PAGE_SIZE;
|
||||
|
||||
/* Reserve stack */
|
||||
InitialTeb.StackAllocate = NULL;
|
||||
|
@ -266,7 +266,7 @@ KlCreateFirstThread(HANDLE ProcessHandle,
|
|||
/* Protect guard page */
|
||||
Status = NtProtectVirtualMemory(ProcessHandle,
|
||||
InitialTeb.StackLimit,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
&OldPageProtection);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: thread.c,v 1.29 2002/09/08 10:22:46 chorns Exp $
|
||||
/* $Id: thread.c,v 1.30 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -96,12 +96,12 @@ HANDLE STDCALL CreateRemoteThread(HANDLE hProcess,
|
|||
InitialTeb.StackReserve = 0x100000; /* 1MByte */
|
||||
/* FIXME: use correct commit size */
|
||||
#if 0
|
||||
InitialTeb.StackCommit = (dwStackSize == 0) ? PAGESIZE : dwStackSize;
|
||||
InitialTeb.StackCommit = (dwStackSize == 0) ? PAGE_SIZE : dwStackSize;
|
||||
#endif
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE;
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE;
|
||||
|
||||
/* size of guard page */
|
||||
InitialTeb.StackCommit += PAGESIZE;
|
||||
InitialTeb.StackCommit += PAGE_SIZE;
|
||||
|
||||
/* Reserve stack */
|
||||
InitialTeb.StackAllocate = NULL;
|
||||
|
@ -154,7 +154,7 @@ HANDLE STDCALL CreateRemoteThread(HANDLE hProcess,
|
|||
/* Protect guard page */
|
||||
Status = NtProtectVirtualMemory(hProcess,
|
||||
InitialTeb.StackLimit,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
&OldPageProtection);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: utils.c,v 1.56 2002/09/08 10:23:04 chorns Exp $
|
||||
/* $Id: utils.c,v 1.57 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -893,7 +893,7 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_READWRITE,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -945,7 +945,7 @@ static NTSTATUS LdrPerformRelocations (PIMAGE_NT_HEADERS NTHeaders,
|
|||
Status = NtProtectVirtualMemory(NtCurrentProcess(),
|
||||
ImageBase +
|
||||
RelocationDir->VirtualAddress,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
OldProtect,
|
||||
&OldProtect);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: env.c,v 1.17 2002/09/08 10:23:05 chorns Exp $
|
||||
/* $Id: env.c,v 1.18 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -29,7 +29,7 @@ RtlCreateEnvironment(BOOLEAN Inherit,
|
|||
MEMORY_BASIC_INFORMATION MemInfo;
|
||||
PVOID EnvPtr = NULL;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
ULONG RegionSize = PAGESIZE;
|
||||
ULONG RegionSize = PAGE_SIZE;
|
||||
|
||||
if (Inherit == TRUE)
|
||||
{
|
||||
|
@ -298,7 +298,7 @@ found:
|
|||
/* enlarge environment size */
|
||||
/* check the size of available memory */
|
||||
new_size += (env_len - hole_len) * sizeof(WCHAR);
|
||||
new_size = ROUNDUP(new_size, PAGESIZE);
|
||||
new_size = ROUNDUP(new_size, PAGE_SIZE);
|
||||
mbi.RegionSize = 0;
|
||||
DPRINT("new_size %lu\n", new_size);
|
||||
|
||||
|
|
|
@ -1560,7 +1560,7 @@ RtlInitializeHeapManager(VOID)
|
|||
Peb = NtCurrentPeb();
|
||||
|
||||
Peb->NumberOfHeaps = 0;
|
||||
Peb->MaximumNumberOfHeaps = (PAGESIZE - sizeof(PEB)) / sizeof(HANDLE);
|
||||
Peb->MaximumNumberOfHeaps = (PAGE_SIZE - sizeof(PEB)) / sizeof(HANDLE);
|
||||
Peb->ProcessHeaps = (PVOID)Peb + sizeof(PEB);
|
||||
|
||||
RtlInitializeCriticalSection(&RtlpProcessHeapsListLock);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ppb.c,v 1.14 2002/09/08 10:23:06 chorns Exp $
|
||||
/* $Id: ppb.c,v 1.15 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -140,7 +140,7 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
|
|||
Length += ALIGN(RuntimeInfo->MaximumLength, sizeof(ULONG));
|
||||
|
||||
/* Calculate the required block size */
|
||||
RegionSize = ROUNDUP(Length, PAGESIZE);
|
||||
RegionSize = ROUNDUP(Length, PAGE_SIZE);
|
||||
|
||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||
(PVOID*)&Param,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: process.c,v 1.30 2002/09/08 10:23:06 chorns Exp $
|
||||
/* $Id: process.c,v 1.31 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -52,15 +52,15 @@ RtlpCreateFirstThread(HANDLE ProcessHandle,
|
|||
|
||||
/* FIXME */
|
||||
#if 0
|
||||
if (StackCommit > PAGESIZE)
|
||||
if (StackCommit > PAGE_SIZE)
|
||||
InitialTeb.StackCommit = StackCommit;
|
||||
else
|
||||
InitialTeb.StackCommit = PAGESIZE;
|
||||
InitialTeb.StackCommit = PAGE_SIZE;
|
||||
#endif
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE;
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE;
|
||||
|
||||
/* add guard page size */
|
||||
InitialTeb.StackCommit += PAGESIZE;
|
||||
InitialTeb.StackCommit += PAGE_SIZE;
|
||||
|
||||
/* Reserve stack */
|
||||
InitialTeb.StackAllocate = NULL;
|
||||
|
@ -109,7 +109,7 @@ RtlpCreateFirstThread(HANDLE ProcessHandle,
|
|||
/* Protect guard page */
|
||||
Status = NtProtectVirtualMemory(ProcessHandle,
|
||||
InitialTeb.StackLimit,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
&OldPageProtection);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -51,15 +51,15 @@ RtlCreateUserThread(HANDLE ProcessHandle,
|
|||
|
||||
/* FIXME: use correct commit size */
|
||||
#if 0
|
||||
if ((StackCommit != NULL) && (*StackCommit > PAGESIZE))
|
||||
if ((StackCommit != NULL) && (*StackCommit > PAGE_SIZE))
|
||||
InitialTeb.StackCommit = *StackCommit;
|
||||
else
|
||||
InitialTeb.StackCommit = PAGESIZE;
|
||||
InitialTeb.StackCommit = PAGE_SIZE;
|
||||
#endif
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGESIZE;
|
||||
InitialTeb.StackCommit = InitialTeb.StackReserve - PAGE_SIZE;
|
||||
|
||||
/* add size of guard page */
|
||||
InitialTeb.StackCommit += PAGESIZE;
|
||||
InitialTeb.StackCommit += PAGE_SIZE;
|
||||
|
||||
/* Reserve stack */
|
||||
InitialTeb.StackAllocate = NULL;
|
||||
|
@ -110,7 +110,7 @@ RtlCreateUserThread(HANDLE ProcessHandle,
|
|||
/* Protect guard page */
|
||||
Status = NtProtectVirtualMemory(ProcessHandle,
|
||||
InitialTeb.StackLimit,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
&OldPageProtection);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: copy.c,v 1.12 2002/09/08 10:23:16 chorns Exp $
|
||||
/* $Id: copy.c,v 1.13 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -116,11 +116,11 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
|
|||
offset = 0;
|
||||
while (current2 != NULL && !current2->Valid)
|
||||
{
|
||||
for (i = 0; i < (Bcb->CacheSegmentSize / PAGESIZE); i++)
|
||||
for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE); i++)
|
||||
{
|
||||
PVOID address;
|
||||
PHYSICAL_ADDRESS page;
|
||||
address = current2->BaseAddress + (i * PAGESIZE);
|
||||
address = current2->BaseAddress + (i * PAGE_SIZE);
|
||||
page = MmGetPhysicalAddressForProcess(NULL, address);
|
||||
((PULONG)(Mdl + 1))[offset] = page.u.LowPart;
|
||||
offset++;
|
||||
|
@ -482,21 +482,21 @@ CcZeroData (IN PFILE_OBJECT FileObject,
|
|||
|
||||
while (Length > 0)
|
||||
{
|
||||
if (Length + WriteOffset.u.LowPart % PAGESIZE > 262144)
|
||||
if (Length + WriteOffset.u.LowPart % PAGE_SIZE > 262144)
|
||||
{
|
||||
Mdl = MmCreateMdl(NULL, (PVOID)WriteOffset.u.LowPart,
|
||||
262144 - WriteOffset.u.LowPart % PAGESIZE);
|
||||
262144 - WriteOffset.u.LowPart % PAGE_SIZE);
|
||||
WriteOffset.QuadPart +=
|
||||
(262144 - WriteOffset.u.LowPart % PAGESIZE);
|
||||
Length -= (262144 - WriteOffset.u.LowPart % PAGESIZE);
|
||||
(262144 - WriteOffset.u.LowPart % PAGE_SIZE);
|
||||
Length -= (262144 - WriteOffset.u.LowPart % PAGE_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mdl =
|
||||
MmCreateMdl(NULL, (PVOID)WriteOffset.u.LowPart,
|
||||
Length - WriteOffset.u.LowPart % PAGESIZE);
|
||||
Length - WriteOffset.u.LowPart % PAGE_SIZE);
|
||||
WriteOffset.QuadPart +=
|
||||
(Length - WriteOffset.u.LowPart % PAGESIZE);
|
||||
(Length - WriteOffset.u.LowPart % PAGE_SIZE);
|
||||
Length = 0;
|
||||
}
|
||||
if (Mdl == NULL)
|
||||
|
@ -633,11 +633,11 @@ CcZeroData (IN PFILE_OBJECT FileObject,
|
|||
Length -= TempLength;
|
||||
|
||||
size = ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG));
|
||||
for (i = 0; i < (Bcb->CacheSegmentSize / PAGESIZE) &&
|
||||
for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE) &&
|
||||
count < size; i++)
|
||||
{
|
||||
PVOID Address;
|
||||
Address = current->BaseAddress + (i * PAGESIZE);
|
||||
Address = current->BaseAddress + (i * PAGE_SIZE);
|
||||
page =
|
||||
MmGetPhysicalAddressForProcess(NULL, Address);
|
||||
((PULONG)(Mdl + 1))[count++] = page.u.LowPart;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: view.c,v 1.51 2002/09/30 20:55:33 chorns Exp $
|
||||
/* $Id: view.c,v 1.52 2002/10/01 19:27:20 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/cc/view.c
|
||||
|
@ -128,7 +128,7 @@ CcRosFlushDirtyPages(ULONG Target, PULONG Count)
|
|||
}
|
||||
current->ReferenceCount++;
|
||||
ExReleaseFastMutex(&ViewLock);
|
||||
PagesPerSegment = current->Bcb->CacheSegmentSize / PAGESIZE;
|
||||
PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE;
|
||||
Status = CcRosFlushCacheSegment(current);
|
||||
current->ReferenceCount--;
|
||||
ExReleaseFastMutex(¤t->Lock);
|
||||
|
@ -189,7 +189,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
|
|||
ExReleaseFastMutex(¤t->Lock);
|
||||
DPRINT("current->Bcb->CacheSegmentSize %d\n",
|
||||
current->Bcb->CacheSegmentSize);
|
||||
PagesPerSegment = current->Bcb->CacheSegmentSize / PAGESIZE;
|
||||
PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE;
|
||||
CcRosInternalFreeCacheSegment(current->Bcb, current);
|
||||
DPRINT("CcRosTrimCache(): Freed %d\n", PagesPerSegment);
|
||||
PagesFreed = min(PagesPerSegment, Target);
|
||||
|
@ -383,7 +383,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
|
|||
ExAcquireFastMutex(¤t->Lock);
|
||||
}
|
||||
ExReleaseFastMutex(&ViewLock);
|
||||
for (i = 0; i < (Bcb->CacheSegmentSize / PAGESIZE); i++)
|
||||
for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS Page;
|
||||
|
||||
|
@ -394,7 +394,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
|
|||
}
|
||||
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
current->BaseAddress + (i * PAGESIZE),
|
||||
current->BaseAddress + (i * PAGE_SIZE),
|
||||
PAGE_READWRITE,
|
||||
Page,
|
||||
TRUE);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: sysinfo.c,v 1.17 2002/09/08 10:23:19 chorns Exp $
|
||||
/* $Id: sysinfo.c,v 1.18 2002/10/01 19:27:21 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -292,7 +292,7 @@ QSI_DEF(SystemBasicInformation)
|
|||
|
||||
Sbi->Reserved = 0;
|
||||
Sbi->TimerResolution = 0; /* FIXME */
|
||||
Sbi->PageSize = PAGESIZE; /* FIXME: it should be PAGE_SIZE */
|
||||
Sbi->PageSize = PAGE_SIZE; /* FIXME: it should be PAGE_SIZE */
|
||||
Sbi->NumberOfPhysicalPages = 0; /* FIXME */
|
||||
Sbi->LowestPhysicalPageNumber = 0; /* FIXME */
|
||||
Sbi->HighestPhysicalPageNumber = 0; /* FIXME */
|
||||
|
|
|
@ -24,7 +24,7 @@ struct _EPROCESS;
|
|||
#define PA_SYSTEM (0)
|
||||
#endif
|
||||
|
||||
#define PAGESIZE (4096)
|
||||
#define PAGE_SIZE (4096)
|
||||
|
||||
PULONG MmGetPageEntry(PVOID Address);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mdl.c,v 1.10 2002/09/08 10:23:25 chorns Exp $
|
||||
/* $Id: mdl.c,v 1.11 2002/10/01 19:27:21 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -65,9 +65,9 @@ IoBuildPartialMdl(PMDL SourceMdl,
|
|||
PULONG SourcePages = (PULONG)(SourceMdl + 1);
|
||||
ULONG Va;
|
||||
ULONG Delta = (PAGE_ROUND_DOWN(VirtualAddress) - (ULONG)SourceMdl->StartVa)/
|
||||
PAGESIZE;
|
||||
PAGE_SIZE;
|
||||
|
||||
for (Va = 0; Va < (PAGE_ROUND_UP(Length)/PAGESIZE); Va++)
|
||||
for (Va = 0; Va < (PAGE_ROUND_UP(Length)/PAGE_SIZE); Va++)
|
||||
{
|
||||
TargetPages[Va] = SourcePages[Va+Delta];
|
||||
}
|
||||
|
|
|
@ -61,11 +61,11 @@ KeApplicationProcessorInit(VOID)
|
|||
* Create a PCR for this processor
|
||||
*/
|
||||
Offset = InterlockedIncrement(&PcrsAllocated) - 1;
|
||||
KPCR = (PKPCR)(KPCR_BASE + (Offset * PAGESIZE));
|
||||
KPCR = (PKPCR)(KPCR_BASE + (Offset * PAGE_SIZE));
|
||||
MmCreateVirtualMappingForKernel((PVOID)KPCR,
|
||||
PAGE_READWRITE,
|
||||
PcrPages[Offset]);
|
||||
memset(KPCR, 0, PAGESIZE);
|
||||
memset(KPCR, 0, PAGE_SIZE);
|
||||
KPCR->ProcessorNumber = Offset;
|
||||
KPCR->Self = KPCR;
|
||||
KPCR->Irql = HIGH_LEVEL;
|
||||
|
@ -116,7 +116,7 @@ KeInit1(VOID)
|
|||
* called, so we use a predefined page in low memory
|
||||
*/
|
||||
KPCR = (PKPCR)KPCR_BASE;
|
||||
memset(KPCR, 0, PAGESIZE);
|
||||
memset(KPCR, 0, PAGE_SIZE);
|
||||
KPCR->Self = (PKPCR)KPCR_BASE;
|
||||
KPCR->Irql = HIGH_LEVEL;
|
||||
KPCR->GDT = (PUSHORT)&KiBootGdt;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: kthread.c,v 1.34 2002/09/08 10:23:28 chorns Exp $
|
||||
/* $Id: kthread.c,v 1.35 2002/10/01 19:27:21 chorns Exp $
|
||||
*
|
||||
* FILE: ntoskrnl/ke/kthread.c
|
||||
* PURPOSE: Microkernel thread support
|
||||
|
@ -114,7 +114,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
|
|||
DPRINT1("Failed to create thread stack\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
for (i = 0; i < (MM_STACK_SIZE / PAGESIZE); i++)
|
||||
for (i = 0; i < (MM_STACK_SIZE / PAGE_SIZE); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS Page;
|
||||
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page);
|
||||
|
@ -123,7 +123,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
|
|||
KeBugCheck(0);
|
||||
}
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
KernelStack + (i * PAGESIZE),
|
||||
KernelStack + (i * PAGE_SIZE),
|
||||
PAGE_EXECUTE_READWRITE,
|
||||
Page,
|
||||
TRUE);
|
||||
|
|
|
@ -238,10 +238,10 @@ NTSTATUS LdrLoadInitialProcess (VOID)
|
|||
DPRINT("NTHeaders %x\n", NTHeaders);
|
||||
InitialTeb.StackReserve = NTHeaders->OptionalHeader.SizeOfStackReserve;
|
||||
/* FIXME: use correct commit size */
|
||||
InitialTeb.StackCommit = NTHeaders->OptionalHeader.SizeOfStackReserve - PAGESIZE;
|
||||
InitialTeb.StackCommit = NTHeaders->OptionalHeader.SizeOfStackReserve - PAGE_SIZE;
|
||||
// InitialTeb.StackCommit = NTHeaders->OptionalHeader.SizeOfStackCommit;
|
||||
/* add guard page size */
|
||||
InitialTeb.StackCommit += PAGESIZE;
|
||||
InitialTeb.StackCommit += PAGE_SIZE;
|
||||
DPRINT("StackReserve 0x%lX StackCommit 0x%lX\n",
|
||||
InitialTeb.StackReserve, InitialTeb.StackCommit);
|
||||
KeDetachProcess();
|
||||
|
@ -297,7 +297,7 @@ NTSTATUS LdrLoadInitialProcess (VOID)
|
|||
/* Protect guard page */
|
||||
Status = NtProtectVirtualMemory(ProcessHandle,
|
||||
InitialTeb.StackLimit,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
&OldPageProtection);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: loader.c,v 1.122 2002/09/08 10:23:31 chorns Exp $
|
||||
/* $Id: loader.c,v 1.123 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -1117,7 +1117,7 @@ LdrPEProcessModule(PVOID ModuleLoadBase,
|
|||
{
|
||||
for (i = 0; i < PAGE_ROUND_DOWN(Length); i++)
|
||||
{
|
||||
MmSetPageProtect(NULL, BaseAddress + (i * PAGESIZE),
|
||||
MmSetPageProtect(NULL, BaseAddress + (i * PAGE_SIZE),
|
||||
PAGE_READONLY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: anonmem.c,v 1.6 2002/09/08 10:23:32 chorns Exp $
|
||||
/* $Id: anonmem.c,v 1.7 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/anonmem.c
|
||||
|
@ -99,7 +99,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
|||
/*
|
||||
* Write the page to the pagefile
|
||||
*/
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -199,7 +199,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
|||
/*
|
||||
* Write the page to the pagefile
|
||||
*/
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -365,7 +365,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
|||
PMDL Mdl;
|
||||
|
||||
MmDeletePageFileMapping(NULL, Address, &SwapEntry);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
||||
Status = MmReadFromSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -439,25 +439,25 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
|
|||
{
|
||||
ULONG i;
|
||||
|
||||
for (i=0; i <= (RegionSize/PAGESIZE); i++)
|
||||
for (i=0; i <= (RegionSize/PAGE_SIZE); i++)
|
||||
{
|
||||
LARGE_INTEGER PhysicalAddr;
|
||||
|
||||
if (MmIsPageSwapEntry(AddressSpace->Process,
|
||||
BaseAddress + (i * PAGESIZE)))
|
||||
BaseAddress + (i * PAGE_SIZE)))
|
||||
{
|
||||
SWAPENTRY SwapEntry;
|
||||
|
||||
MmDeletePageFileMapping(AddressSpace->Process,
|
||||
BaseAddress + (i * PAGESIZE),
|
||||
BaseAddress + (i * PAGE_SIZE),
|
||||
&SwapEntry);
|
||||
MmFreeSwapPage(SwapEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
PhysicalAddr = MmGetPhysicalAddress(BaseAddress + (i*PAGESIZE));
|
||||
PhysicalAddr = MmGetPhysicalAddress(BaseAddress + (i*PAGE_SIZE));
|
||||
MmDeleteVirtualMapping(AddressSpace->Process,
|
||||
BaseAddress + (i*PAGESIZE),
|
||||
BaseAddress + (i*PAGE_SIZE),
|
||||
FALSE, NULL, NULL);
|
||||
if (PhysicalAddr.QuadPart != 0)
|
||||
{
|
||||
|
@ -469,7 +469,7 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
|
|||
MmSetSavedSwapEntryPage(PhysicalAddr, 0);
|
||||
}
|
||||
MmDeleteRmap(PhysicalAddr, AddressSpace->Process,
|
||||
BaseAddress + (i * PAGESIZE));
|
||||
BaseAddress + (i * PAGE_SIZE));
|
||||
MmReleasePageMemoryConsumer(MC_USER, PhysicalAddr);
|
||||
}
|
||||
}
|
||||
|
@ -485,13 +485,13 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
|
|||
{
|
||||
ULONG i;
|
||||
|
||||
for (i=0; i <= (RegionSize/PAGESIZE); i++)
|
||||
for (i=0; i <= (RegionSize/PAGE_SIZE); i++)
|
||||
{
|
||||
if (MmIsPagePresent(AddressSpace->Process,
|
||||
BaseAddress + (i*PAGESIZE)))
|
||||
BaseAddress + (i*PAGE_SIZE)))
|
||||
{
|
||||
MmSetPageProtect(AddressSpace->Process,
|
||||
BaseAddress + (i*PAGESIZE),
|
||||
BaseAddress + (i*PAGE_SIZE),
|
||||
NewProtect);
|
||||
}
|
||||
}
|
||||
|
@ -690,7 +690,7 @@ MmFreeVirtualMemory(PEPROCESS Process,
|
|||
*/
|
||||
if (MemoryArea->PageOpCount > 0)
|
||||
{
|
||||
for (i = 0; i < (PAGE_ROUND_UP(MemoryArea->Length) / PAGESIZE); i++)
|
||||
for (i = 0; i < (PAGE_ROUND_UP(MemoryArea->Length) / PAGE_SIZE); i++)
|
||||
{
|
||||
PMM_PAGEOP PageOp;
|
||||
|
||||
|
@ -700,7 +700,7 @@ MmFreeVirtualMemory(PEPROCESS Process,
|
|||
}
|
||||
|
||||
PageOp = MmCheckForPageOp(MemoryArea, Process->UniqueProcessId,
|
||||
MemoryArea->BaseAddress + (i * PAGESIZE),
|
||||
MemoryArea->BaseAddress + (i * PAGE_SIZE),
|
||||
NULL, 0);
|
||||
if (PageOp != NULL)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: cont.c,v 1.23 2002/09/08 10:23:32 chorns Exp $
|
||||
/* $Id: cont.c,v 1.24 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -113,7 +113,7 @@ MmAllocateContiguousMemory (IN ULONG NumberOfBytes,
|
|||
{
|
||||
return(MmAllocateContiguousAlignedMemory(NumberOfBytes,
|
||||
HighestAcceptableAddress,
|
||||
PAGESIZE));
|
||||
PAGE_SIZE));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ static LIST_ENTRY BiosPageListHead;
|
|||
VOID
|
||||
MmTransferOwnershipPage(PHYSICAL_ADDRESS PhysicalAddress, ULONG NewConsumer)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
KeAcquireSpinLock(&PageListLock, &oldIrql);
|
||||
|
@ -80,7 +80,7 @@ MmGetLRUFirstUserPage(VOID)
|
|||
}
|
||||
PageDescriptor = CONTAINING_RECORD(NextListEntry, PHYSICAL_PAGE, ListEntry);
|
||||
Next.QuadPart = (ULONG)((ULONG)PageDescriptor - (ULONG)MmPageArray);
|
||||
Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGESIZE;
|
||||
Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGE_SIZE;
|
||||
KeReleaseSpinLock(&PageListLock, oldIrql);
|
||||
return(Next);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ MmGetLRUFirstUserPage(VOID)
|
|||
PHYSICAL_ADDRESS
|
||||
MmGetLRUNextUserPage(PHYSICAL_ADDRESS PreviousPhysicalAddress)
|
||||
{
|
||||
ULONG Start = PreviousPhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PreviousPhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
PLIST_ENTRY NextListEntry;
|
||||
PHYSICAL_ADDRESS Next;
|
||||
PHYSICAL_PAGE* PageDescriptor;
|
||||
|
@ -110,7 +110,7 @@ MmGetLRUNextUserPage(PHYSICAL_ADDRESS PreviousPhysicalAddress)
|
|||
}
|
||||
PageDescriptor = CONTAINING_RECORD(NextListEntry, PHYSICAL_PAGE, ListEntry);
|
||||
Next.QuadPart = (ULONG)((ULONG)PageDescriptor - (ULONG)MmPageArray);
|
||||
Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGESIZE;
|
||||
Next.QuadPart = (Next.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGE_SIZE;
|
||||
KeReleaseSpinLock(&PageListLock, oldIrql);
|
||||
return(Next);
|
||||
}
|
||||
|
@ -126,13 +126,13 @@ MmGetContinuousPages(ULONG NumberOfBytes,
|
|||
ULONG length;
|
||||
KIRQL oldIrql;
|
||||
|
||||
NrPages = PAGE_ROUND_UP(NumberOfBytes) / PAGESIZE;
|
||||
NrPages = PAGE_ROUND_UP(NumberOfBytes) / PAGE_SIZE;
|
||||
|
||||
KeAcquireSpinLock(&PageListLock, &oldIrql);
|
||||
|
||||
start = -1;
|
||||
length = 0;
|
||||
for (i = 0; i < (HighestAcceptableAddress.QuadPart / PAGESIZE); )
|
||||
for (i = 0; i < (HighestAcceptableAddress.QuadPart / PAGE_SIZE); )
|
||||
{
|
||||
if (MM_PTYPE(MmPageArray[i].Flags) == MM_PHYSICAL_PAGE_FREE)
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ MmGetContinuousPages(ULONG NumberOfBytes,
|
|||
/*
|
||||
* Fast forward to the base of the next aligned region
|
||||
*/
|
||||
i = ROUND_UP((i + 1), (Alignment / PAGESIZE));
|
||||
i = ROUND_UP((i + 1), (Alignment / PAGE_SIZE));
|
||||
}
|
||||
}
|
||||
if (start == -1 || length != NrPages)
|
||||
|
@ -192,8 +192,8 @@ MiParseRangeToFreeList(PADDRESS_RANGE Range)
|
|||
Range->LengthLow,
|
||||
Range->Type);
|
||||
|
||||
first = (Range->BaseAddrLow + PAGESIZE - 1) / PAGESIZE;
|
||||
last = first + ((Range->LengthLow + PAGESIZE - 1) / PAGESIZE);
|
||||
first = (Range->BaseAddrLow + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
last = first + ((Range->LengthLow + PAGE_SIZE - 1) / PAGE_SIZE);
|
||||
for (i = first; i < last; i++)
|
||||
{
|
||||
if (MmPageArray[i].Flags == 0)
|
||||
|
@ -218,8 +218,8 @@ MiParseRangeToBiosList(PADDRESS_RANGE Range)
|
|||
Range->LengthLow,
|
||||
Range->Type);
|
||||
|
||||
first = (Range->BaseAddrLow + PAGESIZE - 1) / PAGESIZE;
|
||||
last = first + ((Range->LengthLow + PAGESIZE - 1) / PAGESIZE);
|
||||
first = (Range->BaseAddrLow + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
last = first + ((Range->LengthLow + PAGE_SIZE - 1) / PAGE_SIZE);
|
||||
for (i = first; i < last; i++)
|
||||
{
|
||||
/* Remove the page from the free list if it is there */
|
||||
|
@ -249,7 +249,7 @@ MiParseBIOSMemoryMap(ULONG MemorySizeInPages,
|
|||
p = BIOSMemoryMap;
|
||||
for (i = 0; i < AddressRangeCount; i++)
|
||||
{
|
||||
if (((p->BaseAddrLow + PAGESIZE - 1) / PAGESIZE) < MemorySizeInPages)
|
||||
if (((p->BaseAddrLow + PAGE_SIZE - 1) / PAGE_SIZE) < MemorySizeInPages)
|
||||
{
|
||||
if (p->Type == 1)
|
||||
{
|
||||
|
@ -304,15 +304,15 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress);
|
||||
|
||||
Reserved =
|
||||
PAGE_ROUND_UP((MemorySizeInPages * sizeof(PHYSICAL_PAGE))) / PAGESIZE;
|
||||
PAGE_ROUND_UP((MemorySizeInPages * sizeof(PHYSICAL_PAGE))) / PAGE_SIZE;
|
||||
MmPageArray = (PHYSICAL_PAGE *)LastKernelAddress;
|
||||
|
||||
DPRINT("Reserved %d\n", Reserved);
|
||||
|
||||
LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress);
|
||||
LastKernelAddress = ((ULONG)LastKernelAddress + (Reserved * PAGESIZE));
|
||||
LastKernelAddress = ((ULONG)LastKernelAddress + (Reserved * PAGE_SIZE));
|
||||
LastPhysKernelAddress = (PVOID)PAGE_ROUND_UP(LastPhysKernelAddress);
|
||||
LastPhysKernelAddress = LastPhysKernelAddress + (Reserved * PAGESIZE);
|
||||
LastPhysKernelAddress = LastPhysKernelAddress + (Reserved * PAGE_SIZE);
|
||||
|
||||
MmStats.NrTotalPages = 0;
|
||||
MmStats.NrSystemPages = 0;
|
||||
|
@ -323,12 +323,12 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
|
||||
for (i = 0; i < Reserved; i++)
|
||||
{
|
||||
PVOID Address = (PVOID)(ULONG)MmPageArray + (i * PAGESIZE);
|
||||
PVOID Address = (PVOID)(ULONG)MmPageArray + (i * PAGE_SIZE);
|
||||
if (!MmIsPagePresent(NULL, Address))
|
||||
{
|
||||
ULONG PhysicalAddress;
|
||||
PhysicalAddress = (ULONG)LastPhysKernelAddress -
|
||||
(Reserved * PAGESIZE) + (i * PAGESIZE);
|
||||
(Reserved * PAGE_SIZE) + (i * PAGE_SIZE);
|
||||
Status =
|
||||
MmCreateVirtualMappingUnsafe(NULL,
|
||||
Address,
|
||||
|
@ -341,7 +341,7 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
KeBugCheck(0);
|
||||
}
|
||||
}
|
||||
memset((PVOID)MmPageArray + (i * PAGESIZE), 0, PAGESIZE);
|
||||
memset((PVOID)MmPageArray + (i * PAGE_SIZE), 0, PAGE_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -363,8 +363,8 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
i = 2;
|
||||
if ((ULONG)FirstPhysKernelAddress < 0xa0000)
|
||||
{
|
||||
MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGESIZE) - 1);
|
||||
for (; i<((ULONG)FirstPhysKernelAddress/PAGESIZE); i++)
|
||||
MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGE_SIZE) - 1);
|
||||
for (; i<((ULONG)FirstPhysKernelAddress/PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE;
|
||||
MmPageArray[i].ReferenceCount = 0;
|
||||
|
@ -372,24 +372,24 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
&MmPageArray[i].ListEntry);
|
||||
}
|
||||
MmStats.NrSystemPages +=
|
||||
((((ULONG)LastPhysKernelAddress) / PAGESIZE) - i);
|
||||
for (; i<((ULONG)LastPhysKernelAddress / PAGESIZE); i++)
|
||||
((((ULONG)LastPhysKernelAddress) / PAGE_SIZE) - i);
|
||||
for (; i<((ULONG)LastPhysKernelAddress / PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_USED;
|
||||
MmPageArray[i].ReferenceCount = 1;
|
||||
InsertTailList(&UsedPageListHeads[MC_NPPOOL],
|
||||
&MmPageArray[i].ListEntry);
|
||||
}
|
||||
MmStats.NrFreePages += ((0xa0000/PAGESIZE) - i);
|
||||
for (; i<(0xa0000/PAGESIZE); i++)
|
||||
MmStats.NrFreePages += ((0xa0000/PAGE_SIZE) - i);
|
||||
for (; i<(0xa0000/PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE;
|
||||
MmPageArray[i].ReferenceCount = 0;
|
||||
InsertTailList(&FreeUnzeroedPageListHead,
|
||||
&MmPageArray[i].ListEntry);
|
||||
}
|
||||
MmStats.NrReservedPages += ((0x100000/PAGESIZE) - i);
|
||||
for (; i<(0x100000 / PAGESIZE); i++)
|
||||
MmStats.NrReservedPages += ((0x100000/PAGE_SIZE) - i);
|
||||
for (; i<(0x100000 / PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_BIOS;
|
||||
MmPageArray[i].ReferenceCount = 1;
|
||||
|
@ -399,24 +399,24 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
}
|
||||
else
|
||||
{
|
||||
MmStats.NrFreePages += ((0xa0000 / PAGESIZE) - 1);
|
||||
for (; i<(0xa0000 / PAGESIZE); i++)
|
||||
MmStats.NrFreePages += ((0xa0000 / PAGE_SIZE) - 1);
|
||||
for (; i<(0xa0000 / PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE;
|
||||
MmPageArray[i].ReferenceCount = 0;
|
||||
InsertTailList(&FreeUnzeroedPageListHead,
|
||||
&MmPageArray[i].ListEntry);
|
||||
}
|
||||
MmStats.NrReservedPages += (0x60000 / PAGESIZE);
|
||||
for (; i<(0x100000 / PAGESIZE); i++)
|
||||
MmStats.NrReservedPages += (0x60000 / PAGE_SIZE);
|
||||
for (; i<(0x100000 / PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_BIOS;
|
||||
MmPageArray[i].ReferenceCount = 1;
|
||||
InsertTailList(&BiosPageListHead,
|
||||
&MmPageArray[i].ListEntry);
|
||||
}
|
||||
MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGESIZE) - i);
|
||||
for (; i<((ULONG)FirstPhysKernelAddress/PAGESIZE); i++)
|
||||
MmStats.NrFreePages += (((ULONG)FirstPhysKernelAddress/PAGE_SIZE) - i);
|
||||
for (; i<((ULONG)FirstPhysKernelAddress/PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_FREE;
|
||||
MmPageArray[i].ReferenceCount = 0;
|
||||
|
@ -424,8 +424,8 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
&MmPageArray[i].ListEntry);
|
||||
}
|
||||
MmStats.NrSystemPages +=
|
||||
(((ULONG)LastPhysKernelAddress/PAGESIZE) - i);
|
||||
for (; i<((ULONG)LastPhysKernelAddress/PAGESIZE); i++)
|
||||
(((ULONG)LastPhysKernelAddress/PAGE_SIZE) - i);
|
||||
for (; i<((ULONG)LastPhysKernelAddress/PAGE_SIZE); i++)
|
||||
{
|
||||
MmPageArray[i].Flags = MM_PHYSICAL_PAGE_USED;
|
||||
MmPageArray[i].ReferenceCount = 1;
|
||||
|
@ -460,7 +460,7 @@ MmInitializePageList(PVOID FirstPhysKernelAddress,
|
|||
VOID
|
||||
MmSetFlagsPage(PHYSICAL_ADDRESS PhysicalAddress, ULONG Flags)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
KeAcquireSpinLock(&PageListLock, &oldIrql);
|
||||
|
@ -472,7 +472,7 @@ VOID
|
|||
MmSetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress,
|
||||
struct _MM_RMAP_ENTRY* ListHead)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
|
||||
MmPageArray[Start].RmapListHead = ListHead;
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ MmSetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress,
|
|||
struct _MM_RMAP_ENTRY*
|
||||
MmGetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
|
||||
return(MmPageArray[Start].RmapListHead);
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ MmGetRmapListHeadPage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
VOID
|
||||
MmMarkPageMapped(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
KeAcquireSpinLock(&PageListLock, &oldIrql);
|
||||
|
@ -499,7 +499,7 @@ MmMarkPageMapped(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
VOID
|
||||
MmMarkPageUnmapped(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
KeAcquireSpinLock(&PageListLock, &oldIrql);
|
||||
|
@ -510,7 +510,7 @@ MmMarkPageUnmapped(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
ULONG
|
||||
MmGetFlagsPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
ULONG Flags;
|
||||
|
||||
|
@ -526,7 +526,7 @@ VOID
|
|||
MmSetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress,
|
||||
SWAPENTRY SavedSwapEntry)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
KeAcquireSpinLock(&PageListLock, &oldIrql);
|
||||
|
@ -537,7 +537,7 @@ MmSetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress,
|
|||
SWAPENTRY
|
||||
MmGetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
SWAPENTRY SavedSwapEntry;
|
||||
KIRQL oldIrql;
|
||||
|
||||
|
@ -551,7 +551,7 @@ MmGetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
VOID
|
||||
MmReferencePage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
DPRINT("MmReferencePage(PhysicalAddress %x)\n", PhysicalAddress);
|
||||
|
@ -576,7 +576,7 @@ MmReferencePage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
ULONG
|
||||
MmGetReferenceCountPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
ULONG RCount;
|
||||
|
||||
|
@ -604,7 +604,7 @@ MmGetReferenceCountPage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
BOOLEAN
|
||||
MmIsUsablePage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
|
||||
DPRINT("MmGetReferenceCountPage(PhysicalAddress %x)\n", PhysicalAddress);
|
||||
|
||||
|
@ -625,7 +625,7 @@ MmIsUsablePage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
VOID
|
||||
MmDereferencePage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
DPRINT("MmDereferencePage(PhysicalAddress %I64x)\n", PhysicalAddress);
|
||||
|
@ -687,7 +687,7 @@ MmDereferencePage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
ULONG
|
||||
MmGetLockCountPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
ULONG LockCount;
|
||||
|
||||
|
@ -715,7 +715,7 @@ MmGetLockCountPage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
VOID
|
||||
MmLockPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
DPRINT("MmLockPage(PhysicalAddress %x)\n", PhysicalAddress);
|
||||
|
@ -740,7 +740,7 @@ MmLockPage(PHYSICAL_ADDRESS PhysicalAddress)
|
|||
VOID
|
||||
MmUnlockPage(PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGESIZE;
|
||||
ULONG Start = PhysicalAddress.u.LowPart / PAGE_SIZE;
|
||||
KIRQL oldIrql;
|
||||
|
||||
DPRINT("MmUnlockPage(PhysicalAddress %llx)\n", PhysicalAddress);
|
||||
|
@ -815,7 +815,7 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry)
|
|||
|
||||
PageOffset.QuadPart = (ULONG)((ULONG)PageDescriptor - (ULONG)MmPageArray);
|
||||
PageOffset.QuadPart =
|
||||
(PageOffset.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGESIZE;
|
||||
(PageOffset.QuadPart / sizeof(PHYSICAL_PAGE)) * PAGE_SIZE;
|
||||
if (NeedClear)
|
||||
{
|
||||
MiZeroPage(PageOffset);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: page.c,v 1.44 2002/09/15 10:45:04 guido Exp $
|
||||
/* $Id: page.c,v 1.45 2002/10/01 19:27:25 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/i386/page.c
|
||||
|
@ -150,7 +150,7 @@ NTSTATUS MmCopyMmInfo(PEPROCESS Src, PEPROCESS Dest)
|
|||
KProcess->DirectoryTableBase = PhysPageDirectory;
|
||||
CurrentPageDirectory = (PULONG)PAGEDIRECTORY_MAP;
|
||||
|
||||
memset(PageDirectory,0,PAGESIZE);
|
||||
memset(PageDirectory,0,PAGE_SIZE);
|
||||
for (i=768; i<896; i++)
|
||||
{
|
||||
PageDirectory[i] = CurrentPageDirectory[i];
|
||||
|
@ -258,7 +258,7 @@ NTSTATUS MmGetPageEntry2(PVOID PAddress, PULONG* Pte, BOOLEAN MayWait)
|
|||
MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] =
|
||||
*Pde;
|
||||
}
|
||||
memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGESIZE);
|
||||
memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGE_SIZE);
|
||||
FLUSH_TLB;
|
||||
}
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ NTSTATUS MmCreatePageTable(PVOID PAddress)
|
|||
return(Status);
|
||||
}
|
||||
(*page_dir) = npage.QuadPart | 0x7;
|
||||
memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGESIZE);
|
||||
memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGE_SIZE);
|
||||
FLUSH_TLB;
|
||||
}
|
||||
return(STATUS_SUCCESS);
|
||||
|
@ -696,7 +696,7 @@ PULONG MmGetPageEntry(PVOID PAddress)
|
|||
KeBugCheck(0);
|
||||
}
|
||||
(*page_dir) = npage.QuadPart | 0x7;
|
||||
memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGESIZE);
|
||||
memset((PVOID)PAGE_ROUND_DOWN(ADDR_TO_PTE(Address)), 0, PAGE_SIZE);
|
||||
FLUSH_TLB;
|
||||
}
|
||||
page_tlb = ADDR_TO_PTE(Address);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: iospace.c,v 1.15 2002/09/08 10:23:33 chorns Exp $
|
||||
/* $Id: iospace.c,v 1.16 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/iospace.c
|
||||
|
@ -96,21 +96,21 @@ MmMapIoSpace (IN PHYSICAL_ADDRESS PhysicalAddress,
|
|||
{
|
||||
Attributes |= (PAGE_NOCACHE | PAGE_WRITETHROUGH);
|
||||
}
|
||||
for (i = 0; (i < ((NumberOfBytes + PAGESIZE - 1) / PAGESIZE)); i++)
|
||||
for (i = 0; (i < ((NumberOfBytes + PAGE_SIZE - 1) / PAGE_SIZE)); i++)
|
||||
{
|
||||
Status =
|
||||
MmCreateVirtualMappingForKernel(Result + (i * PAGESIZE),
|
||||
MmCreateVirtualMappingForKernel(Result + (i * PAGE_SIZE),
|
||||
Attributes,
|
||||
(PHYSICAL_ADDRESS)
|
||||
(PhysicalAddress.QuadPart +
|
||||
(i * PAGESIZE)));
|
||||
(i * PAGE_SIZE)));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("Unable to create virtual mapping\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
}
|
||||
return ((PVOID)(Result + PhysicalAddress.QuadPart % PAGESIZE));
|
||||
return ((PVOID)(Result + PhysicalAddress.QuadPart % PAGE_SIZE));
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,7 +142,7 @@ MmUnmapIoSpace (IN PVOID BaseAddress,
|
|||
IN ULONG NumberOfBytes)
|
||||
{
|
||||
(VOID)MmFreeMemoryArea(&PsGetCurrentProcess()->AddressSpace,
|
||||
(PVOID)(((ULONG)BaseAddress / PAGESIZE) * PAGESIZE),
|
||||
(PVOID)(((ULONG)BaseAddress / PAGE_SIZE) * PAGE_SIZE),
|
||||
NumberOfBytes,
|
||||
NULL,
|
||||
NULL);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: kmap.c,v 1.20 2002/09/08 10:23:33 chorns Exp $
|
||||
/* $Id: kmap.c,v 1.21 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
/* GLOBALS *****************************************************************/
|
||||
|
||||
#define ALLOC_MAP_SIZE (NONPAGED_POOL_SIZE / PAGESIZE)
|
||||
#define ALLOC_MAP_SIZE (NONPAGED_POOL_SIZE / PAGE_SIZE)
|
||||
|
||||
/*
|
||||
* One bit for each page in the kmalloc region
|
||||
|
@ -38,7 +38,7 @@ VOID
|
|||
ExUnmapPage(PVOID Addr)
|
||||
{
|
||||
KIRQL oldIrql;
|
||||
ULONG i = (Addr - NonPagedPoolBase) / PAGESIZE;
|
||||
ULONG i = (Addr - NonPagedPoolBase) / PAGE_SIZE;
|
||||
|
||||
DPRINT("ExUnmapPage(Addr %x)\n",Addr);
|
||||
DPRINT("i %x\n",i);
|
||||
|
@ -75,7 +75,7 @@ MiZeroPage(PHYSICAL_ADDRESS PhysPage)
|
|||
{
|
||||
return(STATUS_NO_MEMORY);
|
||||
}
|
||||
memset(TempAddress, 0, PAGESIZE);
|
||||
memset(TempAddress, 0, PAGE_SIZE);
|
||||
ExUnmapPage(TempAddress);
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ MiCopyFromUserPage(PHYSICAL_ADDRESS DestPhysPage, PVOID SourceAddress)
|
|||
{
|
||||
return(STATUS_NO_MEMORY);
|
||||
}
|
||||
memcpy(TempAddress, SourceAddress, PAGESIZE);
|
||||
memcpy(TempAddress, SourceAddress, PAGE_SIZE);
|
||||
ExUnmapPage(TempAddress);
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ ExAllocatePageWithPhysPage(PHYSICAL_ADDRESS PhysPage)
|
|||
DPRINT("i %x\n",i);
|
||||
AllocMap[i / 32] |= (1 << (i % 32));
|
||||
AllocMapHint = i + 1;
|
||||
addr = (ULONG)(NonPagedPoolBase + (i*PAGESIZE));
|
||||
addr = (ULONG)(NonPagedPoolBase + (i*PAGE_SIZE));
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
(PVOID)addr,
|
||||
PAGE_READWRITE | PAGE_SYSTEM,
|
||||
|
@ -141,7 +141,7 @@ VOID
|
|||
MiFreeNonPagedPoolRegion(PVOID Addr, ULONG Count, BOOLEAN Free)
|
||||
{
|
||||
ULONG i;
|
||||
ULONG Base = (Addr - NonPagedPoolBase) / PAGESIZE;
|
||||
ULONG Base = (Addr - NonPagedPoolBase) / PAGE_SIZE;
|
||||
ULONG Offset;
|
||||
KIRQL oldlvl;
|
||||
|
||||
|
@ -152,7 +152,7 @@ MiFreeNonPagedPoolRegion(PVOID Addr, ULONG Count, BOOLEAN Free)
|
|||
Offset = Base + i;
|
||||
AllocMap[Offset / 32] &= (~(1 << (Offset % 32)));
|
||||
MmDeleteVirtualMapping(NULL,
|
||||
Addr + (i * PAGESIZE),
|
||||
Addr + (i * PAGE_SIZE),
|
||||
Free,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -192,9 +192,9 @@ MiAllocNonPagedPoolRegion(ULONG nr_pages)
|
|||
{
|
||||
AllocMap[j / 32] |= (1 << (j % 32));
|
||||
}
|
||||
DPRINT("returning %x\n",((start*PAGESIZE)+NonPagedPoolBase));
|
||||
DPRINT("returning %x\n",((start*PAGE_SIZE)+NonPagedPoolBase));
|
||||
KeReleaseSpinLock(&AllocMapLock, oldlvl);
|
||||
return(((start*PAGESIZE)+NonPagedPoolBase));
|
||||
return(((start*PAGE_SIZE)+NonPagedPoolBase));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -271,29 +271,29 @@ MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace,
|
|||
KeBugCheck(0);
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
for (i=0; i<(PAGE_ROUND_UP(MemoryArea->Length)/PAGESIZE); i++)
|
||||
for (i=0; i<(PAGE_ROUND_UP(MemoryArea->Length)/PAGE_SIZE); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS PhysAddr = (PHYSICAL_ADDRESS)0LL;
|
||||
BOOL Dirty;
|
||||
SWAPENTRY SwapEntry = 0;
|
||||
|
||||
if (MmIsPageSwapEntry(AddressSpace->Process,
|
||||
MemoryArea->BaseAddress + (i * PAGESIZE)))
|
||||
MemoryArea->BaseAddress + (i * PAGE_SIZE)))
|
||||
{
|
||||
MmDeletePageFileMapping(AddressSpace->Process,
|
||||
MemoryArea->BaseAddress + (i * PAGESIZE),
|
||||
MemoryArea->BaseAddress + (i * PAGE_SIZE),
|
||||
&SwapEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
MmDeleteVirtualMapping(AddressSpace->Process,
|
||||
MemoryArea->BaseAddress + (i*PAGESIZE),
|
||||
MemoryArea->BaseAddress + (i*PAGE_SIZE),
|
||||
FALSE, &Dirty, &PhysAddr);
|
||||
}
|
||||
if (FreePage != NULL)
|
||||
{
|
||||
FreePage(FreePageContext, MemoryArea,
|
||||
MemoryArea->BaseAddress + (i * PAGESIZE), PhysAddr,
|
||||
MemoryArea->BaseAddress + (i * PAGE_SIZE), PhysAddr,
|
||||
SwapEntry, Dirty);
|
||||
}
|
||||
}
|
||||
|
@ -383,13 +383,13 @@ NTSTATUS MmCreateMemoryArea(PEPROCESS Process,
|
|||
if ((*BaseAddress)==0 && !FixedAddress)
|
||||
{
|
||||
*BaseAddress = MmFindGap(AddressSpace,
|
||||
PAGE_ROUND_UP(Length) +(PAGESIZE*2));
|
||||
PAGE_ROUND_UP(Length) +(PAGE_SIZE*2));
|
||||
if ((*BaseAddress)==0)
|
||||
{
|
||||
DPRINT("No suitable gap\n");
|
||||
return(STATUS_NO_MEMORY);
|
||||
}
|
||||
(*BaseAddress)=(*BaseAddress)+PAGESIZE;
|
||||
(*BaseAddress)=(*BaseAddress)+PAGE_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mdl.c,v 1.44 2002/09/08 10:23:34 chorns Exp $
|
||||
/* $Id: mdl.c,v 1.45 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -58,7 +58,7 @@ MmInitializeMdlImplementation(VOID)
|
|||
|
||||
MiMdlMappingRegionAllocMap =
|
||||
ExAllocatePool(NonPagedPool,
|
||||
MI_MDL_MAPPING_REGION_SIZE / (PAGESIZE * 32));
|
||||
MI_MDL_MAPPING_REGION_SIZE / (PAGE_SIZE * 32));
|
||||
MiMdlMappingRegionHighWaterMark = 0;
|
||||
KeInitializeSpinLock(&MiMdlMappingRegionLock);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ MmGetMdlPageAddress(PMDL Mdl, PVOID Offset)
|
|||
|
||||
MdlPages = (PULONG)(Mdl + 1);
|
||||
|
||||
return((PVOID)MdlPages[((ULONG)Offset) / PAGESIZE]);
|
||||
return((PVOID)MdlPages[((ULONG)Offset) / PAGE_SIZE]);
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
|
@ -105,7 +105,7 @@ MmUnlockPages(PMDL Mdl)
|
|||
}
|
||||
|
||||
MdlPages = (PULONG)(Mdl + 1);
|
||||
for (i=0; i<(PAGE_ROUND_UP(Mdl->ByteCount+Mdl->ByteOffset)/PAGESIZE); i++)
|
||||
for (i=0; i<(PAGE_ROUND_UP(Mdl->ByteCount+Mdl->ByteOffset)/PAGE_SIZE); i++)
|
||||
{
|
||||
MmUnlockPage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
|
||||
MmDereferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
|
||||
|
@ -145,11 +145,11 @@ MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode)
|
|||
}
|
||||
|
||||
/* Calculate the number of pages required. */
|
||||
RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGESIZE;
|
||||
RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE;
|
||||
|
||||
/* Allocate that number of pages from the mdl mapping region. */
|
||||
KeAcquireSpinLock(&MiMdlMappingRegionLock, &oldIrql);
|
||||
Base = MiMdlMappingRegionBase + MiMdlMappingRegionHighWaterMark * PAGESIZE;
|
||||
Base = MiMdlMappingRegionBase + MiMdlMappingRegionHighWaterMark * PAGE_SIZE;
|
||||
for (i = 0; i < RegionSize; i++)
|
||||
{
|
||||
ULONG Offset = MiMdlMappingRegionHighWaterMark + i;
|
||||
|
@ -164,7 +164,7 @@ MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode)
|
|||
{
|
||||
NTSTATUS Status;
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
(PVOID)((ULONG)Base+(i*PAGESIZE)),
|
||||
(PVOID)((ULONG)Base+(i*PAGE_SIZE)),
|
||||
PAGE_READWRITE,
|
||||
(LARGE_INTEGER)(LONGLONG)MdlPages[i],
|
||||
FALSE);
|
||||
|
@ -207,13 +207,13 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
|
|||
}
|
||||
|
||||
/* Calculate the number of pages we mapped. */
|
||||
RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGESIZE;
|
||||
RegionSize = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE;
|
||||
|
||||
/* Unmap all the pages. */
|
||||
for (i = 0; i < RegionSize; i++)
|
||||
{
|
||||
MmDeleteVirtualMapping(NULL,
|
||||
BaseAddress + (i * PAGESIZE),
|
||||
BaseAddress + (i * PAGE_SIZE),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -222,7 +222,7 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
|
|||
KeAcquireSpinLock(&MiMdlMappingRegionLock, &oldIrql);
|
||||
/* Deallocate all the pages used. */
|
||||
Base = (ULONG)(BaseAddress - MiMdlMappingRegionBase - Mdl->ByteOffset);
|
||||
Base = Base / PAGESIZE;
|
||||
Base = Base / PAGE_SIZE;
|
||||
for (i = 0; i < RegionSize; i++)
|
||||
{
|
||||
ULONG Offset = Base + i;
|
||||
|
@ -252,7 +252,7 @@ MmBuildMdlFromPages(PMDL Mdl, PULONG Pages)
|
|||
|
||||
MdlPages = (PULONG)(Mdl + 1);
|
||||
|
||||
for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGESIZE);i++)
|
||||
for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGE_SIZE);i++)
|
||||
{
|
||||
MdlPages[i] = Pages[i];
|
||||
}
|
||||
|
@ -308,12 +308,12 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
|||
|
||||
MmLockAddressSpace(&Mdl->Process->AddressSpace);
|
||||
MdlPages = (ULONG *)(Mdl + 1);
|
||||
NrPages = PAGE_ROUND_UP(Mdl->ByteOffset + Mdl->ByteCount) / PAGESIZE;
|
||||
NrPages = PAGE_ROUND_UP(Mdl->ByteOffset + Mdl->ByteCount) / PAGE_SIZE;
|
||||
for (i = 0; i < NrPages; i++)
|
||||
{
|
||||
PVOID Address;
|
||||
|
||||
Address = Mdl->StartVa + (i*PAGESIZE);
|
||||
Address = Mdl->StartVa + (i*PAGE_SIZE);
|
||||
|
||||
if (!MmIsPagePresent(NULL, Address))
|
||||
{
|
||||
|
@ -393,7 +393,7 @@ MmBuildMdlForNonPagedPool (PMDL Mdl)
|
|||
for (va=0; va < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); va++)
|
||||
{
|
||||
((PULONG)(Mdl + 1))[va] =
|
||||
(MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).u.LowPart;
|
||||
(MmGetPhysicalAddress(Mdl->StartVa + (va * PAGE_SIZE))).u.LowPart;
|
||||
}
|
||||
Mdl->MappedSystemVa = Mdl->StartVa + Mdl->ByteOffset;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mminit.c,v 1.40 2002/09/08 10:23:35 chorns Exp $
|
||||
/* $Id: mminit.c,v 1.41 2002/10/01 19:27:22 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -86,7 +86,7 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress,
|
|||
LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress);
|
||||
|
||||
MmInitMemoryAreas();
|
||||
ExInitNonPagedPool(LastKernelAddress + PAGESIZE);
|
||||
ExInitNonPagedPool(LastKernelAddress + PAGE_SIZE);
|
||||
|
||||
/*
|
||||
* Setup the system area descriptor list
|
||||
|
@ -140,7 +140,7 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress,
|
|||
&kernel_param_desc,
|
||||
FALSE);
|
||||
|
||||
BaseAddress = (PVOID)(LastKernelAddress + PAGESIZE);
|
||||
BaseAddress = (PVOID)(LastKernelAddress + PAGE_SIZE);
|
||||
Length = NONPAGED_POOL_SIZE;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
|
@ -152,8 +152,8 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress,
|
|||
FALSE);
|
||||
|
||||
MmPagedPoolSize = MM_PAGED_POOL_SIZE;
|
||||
BaseAddress = (PVOID)(LastKernelAddress + PAGESIZE + NONPAGED_POOL_SIZE +
|
||||
PAGESIZE);
|
||||
BaseAddress = (PVOID)(LastKernelAddress + PAGE_SIZE + NONPAGED_POOL_SIZE +
|
||||
PAGE_SIZE);
|
||||
MmPagedPoolBase = BaseAddress;
|
||||
Length = MM_PAGED_POOL_SIZE;
|
||||
MmCreateMemoryArea(NULL,
|
||||
|
@ -170,7 +170,7 @@ VOID MmInitVirtualMemory(ULONG LastKernelAddress,
|
|||
* Create the kernel mapping of the user/kernel shared memory.
|
||||
*/
|
||||
BaseAddress = (PVOID)KI_USER_SHARED_DATA;
|
||||
Length = PAGESIZE;
|
||||
Length = PAGE_SIZE;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
|
@ -226,9 +226,9 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
for (i = 0; i < AddressRangeCount; i++)
|
||||
{
|
||||
if (BIOSMemoryMap[i].Type == 1
|
||||
&& (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGESIZE -1) / PAGESIZE > last)
|
||||
&& (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE > last)
|
||||
{
|
||||
last = (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGESIZE -1) / PAGESIZE;
|
||||
last = (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
if ((last - 256) * 4 > KeLoaderBlock.MemHigher)
|
||||
|
@ -294,7 +294,7 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
#ifdef BIOS_MEM_FIX
|
||||
MmStats.NrTotalPages += 16;
|
||||
#endif
|
||||
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGESIZE) / 1024);
|
||||
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGE_SIZE) / 1024);
|
||||
|
||||
LastKernelAddress = (ULONG)MmInitializePageList(
|
||||
(PVOID)FirstKrnlPhysAddr,
|
||||
|
@ -312,7 +312,7 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
CHECKPOINT;
|
||||
DPRINT("_text_start__ %x _text_end__ %x\n",(int)&_text_start__,(int)&_text_end__);
|
||||
for (i=PAGE_ROUND_UP(((int)&_text_start__));
|
||||
i<PAGE_ROUND_DOWN(((int)&_text_end__));i=i+PAGESIZE)
|
||||
i<PAGE_ROUND_DOWN(((int)&_text_end__));i=i+PAGE_SIZE)
|
||||
{
|
||||
MmSetPageProtect(NULL,
|
||||
(PVOID)i,
|
||||
|
@ -324,7 +324,7 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
KERNEL_BASE + 2 * PAGE_TABLE_SIZE);
|
||||
for (i=(LastKernelAddress);
|
||||
i<(KERNEL_BASE + 2 * PAGE_TABLE_SIZE);
|
||||
i=i+PAGESIZE)
|
||||
i=i+PAGE_SIZE)
|
||||
{
|
||||
MmDeleteVirtualMapping(NULL, (PVOID)(i), FALSE, NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ncache.c,v 1.21 2002/09/08 10:23:35 chorns Exp $
|
||||
/* $Id: ncache.c,v 1.22 2002/10/01 19:27:23 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -71,13 +71,13 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
|
|||
}
|
||||
Attributes = PAGE_READWRITE | PAGE_SYSTEM | PAGE_NOCACHE |
|
||||
PAGE_WRITETHROUGH;
|
||||
for (i = 0; i <= (NumberOfBytes / PAGESIZE); i++)
|
||||
for (i = 0; i <= (NumberOfBytes / PAGE_SIZE); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS NPage;
|
||||
|
||||
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &NPage);
|
||||
MmCreateVirtualMapping (NULL,
|
||||
Result + (i * PAGESIZE),
|
||||
Result + (i * PAGE_SIZE),
|
||||
Attributes,
|
||||
NPage,
|
||||
TRUE);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: npool.c,v 1.61 2002/09/08 10:23:35 chorns Exp $
|
||||
/* $Id: npool.c,v 1.62 2002/10/01 19:27:23 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -691,7 +691,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller)
|
|||
*/
|
||||
{
|
||||
unsigned int total_size = size + sizeof(BLOCK_HDR);
|
||||
unsigned int nr_pages = PAGE_ROUND_UP(total_size) / PAGESIZE;
|
||||
unsigned int nr_pages = PAGE_ROUND_UP(total_size) / PAGE_SIZE;
|
||||
unsigned int start;
|
||||
BLOCK_HDR* used_blk=NULL;
|
||||
BLOCK_HDR* free_blk=NULL;
|
||||
|
@ -715,7 +715,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller)
|
|||
return(NULL);
|
||||
}
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
(PVOID)(start + (i*PAGESIZE)),
|
||||
(PVOID)(start + (i*PAGE_SIZE)),
|
||||
PAGE_READWRITE,
|
||||
Page,
|
||||
FALSE);
|
||||
|
@ -727,7 +727,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller)
|
|||
}
|
||||
|
||||
KeAcquireSpinLock(&MmNpoolLock, &oldIrql);
|
||||
if ((PAGESIZE-(total_size%PAGESIZE))>(2*sizeof(BLOCK_HDR)))
|
||||
if ((PAGE_SIZE-(total_size%PAGE_SIZE))>(2*sizeof(BLOCK_HDR)))
|
||||
{
|
||||
used_blk = (struct _BLOCK_HDR *)start;
|
||||
DPRINT("Creating block at %x\n",start);
|
||||
|
@ -738,7 +738,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller)
|
|||
free_blk = (BLOCK_HDR *)(start + sizeof(BLOCK_HDR) + size);
|
||||
DPRINT("Creating block at %x\n",free_blk);
|
||||
free_blk->Magic = BLOCK_HDR_FREE_MAGIC;
|
||||
free_blk->Size = (nr_pages * PAGESIZE) -((sizeof(BLOCK_HDR)*2) + size);
|
||||
free_blk->Size = (nr_pages * PAGE_SIZE) -((sizeof(BLOCK_HDR)*2) + size);
|
||||
add_to_free_list(free_blk);
|
||||
|
||||
EiFreeNonPagedPool = EiFreeNonPagedPool + free_blk->Size;
|
||||
|
@ -748,7 +748,7 @@ static BLOCK_HDR* grow_kernel_pool(unsigned int size, ULONG Tag, PVOID Caller)
|
|||
{
|
||||
used_blk = (struct _BLOCK_HDR *)start;
|
||||
used_blk->Magic = BLOCK_HDR_USED_MAGIC;
|
||||
used_blk->Size = (nr_pages * PAGESIZE) - sizeof(BLOCK_HDR);
|
||||
used_blk->Size = (nr_pages * PAGE_SIZE) - sizeof(BLOCK_HDR);
|
||||
add_to_used_list(used_blk);
|
||||
|
||||
EiUsedNonPagedPool = EiUsedNonPagedPool + used_blk->Size;
|
||||
|
@ -1013,7 +1013,7 @@ ExAllocateWholePageBlock(ULONG UserSize)
|
|||
ULONG NrPages;
|
||||
|
||||
Size = sizeof(ULONG) + UserSize;
|
||||
NrPages = ROUND_UP(Size, PAGESIZE) / PAGESIZE;
|
||||
NrPages = ROUND_UP(Size, PAGE_SIZE) / PAGE_SIZE;
|
||||
|
||||
Address = MiAllocNonPagedPoolRegion(NrPages + 1);
|
||||
|
||||
|
@ -1025,14 +1025,14 @@ ExAllocateWholePageBlock(ULONG UserSize)
|
|||
KeBugCheck(0);
|
||||
}
|
||||
MmCreateVirtualMapping(NULL,
|
||||
Address + (i * PAGESIZE),
|
||||
Address + (i * PAGE_SIZE),
|
||||
PAGE_READWRITE | PAGE_SYSTEM,
|
||||
Page,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
*((PULONG)((ULONG)Address + (NrPages * PAGESIZE) - Size)) = NrPages;
|
||||
return((PVOID)((ULONG)Address + (NrPages * PAGESIZE) - UserSize));
|
||||
*((PULONG)((ULONG)Address + (NrPages * PAGE_SIZE) - Size)) = NrPages;
|
||||
return((PVOID)((ULONG)Address + (NrPages * PAGE_SIZE) - UserSize));
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: pagefile.c,v 1.26 2002/09/08 10:23:35 chorns Exp $
|
||||
/* $Id: pagefile.c,v 1.27 2002/10/01 19:27:23 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/pagefile.c
|
||||
|
@ -227,7 +227,7 @@ MmInitPagingFile(VOID)
|
|||
/*
|
||||
* Initialize the crash dump support.
|
||||
*/
|
||||
MmCoreDumpPageFrame = MmAllocateSection(PAGESIZE);
|
||||
MmCoreDumpPageFrame = MmAllocateSection(PAGE_SIZE);
|
||||
if (MmCoreDumpType == MM_CORE_DUMP_TYPE_FULL)
|
||||
{
|
||||
MmCoreDumpSize = MmStats.NrTotalPages * 4096 + 1024 * 1024;
|
||||
|
@ -427,7 +427,7 @@ MmDumpToPagingFile(ULONG BugCode,
|
|||
Headers->FaultingStackBase = (PVOID)Thread->Tcb.StackLimit;
|
||||
Headers->FaultingStackSize = StackSize =
|
||||
(ULONG)(Thread->Tcb.StackBase - Thread->Tcb.StackLimit);
|
||||
Headers->PhysicalMemorySize = MmStats.NrTotalPages * PAGESIZE;
|
||||
Headers->PhysicalMemorySize = MmStats.NrTotalPages * PAGE_SIZE;
|
||||
|
||||
/* Initialize the dump device. */
|
||||
Context = MmCoreDumpDeviceFuncs.Context;
|
||||
|
@ -445,7 +445,7 @@ MmDumpToPagingFile(ULONG BugCode,
|
|||
Mdl->Process = NULL;
|
||||
Mdl->MappedSystemVa = MmCoreDumpPageFrame;
|
||||
Mdl->StartVa = NULL;
|
||||
Mdl->ByteCount = PAGESIZE;
|
||||
Mdl->ByteCount = PAGE_SIZE;
|
||||
Mdl->ByteOffset = 0;
|
||||
MdlMap = (PULONG)(Mdl + 1);
|
||||
|
||||
|
@ -462,9 +462,9 @@ MmDumpToPagingFile(ULONG BugCode,
|
|||
DbgPrint(".");
|
||||
|
||||
/* Write out the kernel mode stack of the faulting thread. */
|
||||
for (i = 0; i < (StackSize / PAGESIZE); i++)
|
||||
for (i = 0; i < (StackSize / PAGE_SIZE); i++)
|
||||
{
|
||||
Mdl->MappedSystemVa = (PVOID)(Thread->Tcb.StackLimit + (i * PAGESIZE));
|
||||
Mdl->MappedSystemVa = (PVOID)(Thread->Tcb.StackLimit + (i * PAGE_SIZE));
|
||||
MdlMap[0] = MmGetPhysicalAddress(Mdl->MappedSystemVa).u.LowPart;
|
||||
Status =
|
||||
MmCoreDumpDeviceFuncs.DeviceWrite(Context,
|
||||
|
@ -485,8 +485,8 @@ MmDumpToPagingFile(ULONG BugCode,
|
|||
for (i = 0; i < MmStats.NrTotalPages; i++)
|
||||
{
|
||||
LARGE_INTEGER PhysicalAddress;
|
||||
PhysicalAddress.QuadPart = i * PAGESIZE;
|
||||
MdlMap[0] = i * PAGESIZE;
|
||||
PhysicalAddress.QuadPart = i * PAGE_SIZE;
|
||||
MdlMap[0] = i * PAGE_SIZE;
|
||||
MmCreateVirtualMappingForKernel(MmCoreDumpPageFrame,
|
||||
PAGE_READWRITE,
|
||||
PhysicalAddress);
|
||||
|
@ -591,7 +591,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
|||
PagingFile->FileObject = FileObject;
|
||||
PagingFile->MaximumSize.QuadPart = MaximumSize->QuadPart;
|
||||
PagingFile->CurrentSize.QuadPart = InitialSize->QuadPart;
|
||||
PagingFile->FreePages = InitialSize->QuadPart / PAGESIZE;
|
||||
PagingFile->FreePages = InitialSize->QuadPart / PAGE_SIZE;
|
||||
PagingFile->UsedPages = 0;
|
||||
KeInitializeSpinLock(&PagingFile->AllocMapLock);
|
||||
|
||||
|
@ -627,7 +627,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
|||
{
|
||||
MmCoreDumpBlockMap =
|
||||
ExAllocatePool(NonPagedPool,
|
||||
(MmCoreDumpSize / PAGESIZE) * sizeof(ULONG));
|
||||
(MmCoreDumpSize / PAGE_SIZE) * sizeof(ULONG));
|
||||
if (MmCoreDumpBlockMap == NULL)
|
||||
{
|
||||
DPRINT1("Failed to allocate block map.\n");
|
||||
|
@ -643,7 +643,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
|||
&MmCoreDumpSize,
|
||||
sizeof(ULONG),
|
||||
MmCoreDumpBlockMap,
|
||||
(MmCoreDumpSize / PAGESIZE) * sizeof(ULONG));
|
||||
(MmCoreDumpSize / PAGE_SIZE) * sizeof(ULONG));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to get dump block map (Status %X)\n", Status);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: pageop.c,v 1.13 2002/09/08 10:23:36 chorns Exp $
|
||||
/* $Id: pageop.c,v 1.14 2002/10/01 19:27:24 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -82,11 +82,11 @@ MmCheckForPageOp(PMEMORY_AREA MArea, ULONG Pid, PVOID Address,
|
|||
*/
|
||||
if (MArea->Type == MEMORY_AREA_SECTION_VIEW)
|
||||
{
|
||||
Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGESIZE));
|
||||
Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGE_SIZE));
|
||||
}
|
||||
else
|
||||
{
|
||||
Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGESIZE));
|
||||
Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGE_SIZE));
|
||||
}
|
||||
Hash = Hash % PAGEOP_HASH_TABLE_SIZE;
|
||||
|
||||
|
@ -149,11 +149,11 @@ MmGetPageOp(PMEMORY_AREA MArea, ULONG Pid, PVOID Address,
|
|||
*/
|
||||
if (MArea->Type == MEMORY_AREA_SECTION_VIEW)
|
||||
{
|
||||
Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGESIZE));
|
||||
Hash = (((ULONG)Segment) | (((ULONG)Offset) / PAGE_SIZE));
|
||||
}
|
||||
else
|
||||
{
|
||||
Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGESIZE));
|
||||
Hash = (((ULONG)Pid) | (((ULONG)Address) / PAGE_SIZE));
|
||||
}
|
||||
Hash = Hash % PAGEOP_HASH_TABLE_SIZE;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: section.c,v 1.98 2002/09/15 10:45:03 guido Exp $
|
||||
/* $Id: section.c,v 1.99 2002/10/01 19:27:24 chorns Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/section.c
|
||||
|
@ -280,7 +280,7 @@ MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section,
|
|||
Fcb = (PREACTOS_COMMON_FCB_HEADER)FileObject->FsContext;
|
||||
|
||||
if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ &&
|
||||
(Offset % PAGESIZE) == 0)
|
||||
(Offset % PAGE_SIZE) == 0)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
Status = CcRosUnmapCacheSegment(Fcb->Bcb, Offset, Dirty);
|
||||
|
@ -334,7 +334,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
|||
* then get the related cache segment.
|
||||
*/
|
||||
if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ &&
|
||||
(Offset->QuadPart % PAGESIZE) == 0)
|
||||
(Offset->QuadPart % PAGE_SIZE) == 0)
|
||||
{
|
||||
ULONG BaseOffset;
|
||||
PVOID BaseAddress;
|
||||
|
@ -395,7 +395,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
|||
/*
|
||||
* Create an mdl to hold the page we are going to read data into.
|
||||
*/
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, &Page->u.LowPart);
|
||||
/*
|
||||
* Call the FSD to read the page
|
||||
|
@ -599,7 +599,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
KeBugCheck(0);
|
||||
}
|
||||
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
||||
Status = MmReadFromSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -861,7 +861,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
KeBugCheck(0);
|
||||
}
|
||||
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&Page);
|
||||
Status = MmReadFromSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1088,7 +1088,7 @@ MmAccessFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
OldPage = MmGetPhysicalAddressForProcess(NULL, Address);
|
||||
|
||||
NewAddress = ExAllocatePageWithPhysPage(NewPage);
|
||||
memcpy(NewAddress, (PVOID)PAGE_ROUND_DOWN(Address), PAGESIZE);
|
||||
memcpy(NewAddress, (PVOID)PAGE_ROUND_DOWN(Address), PAGE_SIZE);
|
||||
ExUnmapPage(NewAddress);
|
||||
|
||||
/*
|
||||
|
@ -1195,7 +1195,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
* then note this is a direct mapped page.
|
||||
*/
|
||||
if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ &&
|
||||
(Offset.QuadPart % PAGESIZE) == 0)
|
||||
(Offset.QuadPart % PAGE_SIZE) == 0)
|
||||
{
|
||||
DirectMapped = TRUE;
|
||||
}
|
||||
|
@ -1431,7 +1431,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
/*
|
||||
* Write the page to the pagefile
|
||||
*/
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1540,7 +1540,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
* then note this is a direct mapped page.
|
||||
*/
|
||||
if (FileObject->Flags & FO_DIRECT_CACHE_PAGING_READ &&
|
||||
(Offset.QuadPart % PAGESIZE) == 0)
|
||||
(Offset.QuadPart % PAGE_SIZE) == 0)
|
||||
{
|
||||
DirectMapped = TRUE;
|
||||
}
|
||||
|
@ -1630,7 +1630,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
/*
|
||||
* Write the page to the pagefile
|
||||
*/
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGESIZE);
|
||||
Mdl = MmCreateMdl(NULL, NULL, PAGE_SIZE);
|
||||
MmBuildMdlFromPages(Mdl, (PULONG)&PhysicalAddress);
|
||||
Status = MmWriteToSwapPage(SwapEntry, Mdl);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1680,9 +1680,9 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace,
|
|||
|
||||
if (OldProtect != NewProtect)
|
||||
{
|
||||
for (i = 0; i < (RegionSize / PAGESIZE); i++)
|
||||
for (i = 0; i < (RegionSize / PAGE_SIZE); i++)
|
||||
{
|
||||
PVOID Address = BaseAddress + (i * PAGESIZE);
|
||||
PVOID Address = BaseAddress + (i * PAGE_SIZE);
|
||||
ULONG Protect = NewProtect;
|
||||
|
||||
/*
|
||||
|
@ -2507,8 +2507,8 @@ MmCreateImageSection(PHANDLE SectionHandle,
|
|||
SectionSegments[0].FileOffset = 0;
|
||||
SectionSegments[0].Characteristics = IMAGE_SECTION_CHAR_DATA;
|
||||
SectionSegments[0].Protection = PAGE_READWRITE;
|
||||
SectionSegments[0].RawLength = PAGESIZE;
|
||||
SectionSegments[0].Length = PAGESIZE;
|
||||
SectionSegments[0].RawLength = PAGE_SIZE;
|
||||
SectionSegments[0].Length = PAGE_SIZE;
|
||||
SectionSegments[0].Flags = 0;
|
||||
SectionSegments[0].ReferenceCount = 1;
|
||||
SectionSegments[0].VirtualAddress = 0;
|
||||
|
@ -3189,7 +3189,7 @@ MmAllocateSection (IN ULONG Length)
|
|||
}
|
||||
MmUnlockAddressSpace(AddressSpace);
|
||||
DPRINT("Result %p\n",Result);
|
||||
for (i = 0; (i <= (Length / PAGESIZE)); i++)
|
||||
for (i = 0; (i <= (Length / PAGE_SIZE)); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS Page;
|
||||
|
||||
|
@ -3200,7 +3200,7 @@ MmAllocateSection (IN ULONG Length)
|
|||
KeBugCheck(0);
|
||||
}
|
||||
Status = MmCreateVirtualMapping (NULL,
|
||||
(Result + (i * PAGESIZE)),
|
||||
(Result + (i * PAGE_SIZE)),
|
||||
PAGE_READWRITE,
|
||||
Page,
|
||||
TRUE);
|
||||
|
@ -3369,7 +3369,7 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
|||
ViewOffset = SectionOffset->u.LowPart;
|
||||
}
|
||||
|
||||
if ((ViewOffset % PAGESIZE) != 0)
|
||||
if ((ViewOffset % PAGE_SIZE) != 0)
|
||||
{
|
||||
MmUnlockSection(Section);
|
||||
MmUnlockAddressSpace(AddressSpace);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: slab.c,v 1.7 2002/09/08 10:23:36 chorns Exp $
|
||||
/* $Id: slab.c,v 1.8 2002/10/01 19:27:24 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -92,7 +92,7 @@ ExCreateSlabCache(PUNICODE_STRING Name, ULONG Size, ULONG Align,
|
|||
AlignSize = Align - (ObjectSize % Align);
|
||||
Slab->ObjectSize = ObjectSize + AlignSize;
|
||||
Slab->ObjectsPerPage =
|
||||
(PAGESIZE - sizeof(SLAB_CACHE_PAGE)) / Slab->ObjectSize;
|
||||
(PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)) / Slab->ObjectSize;
|
||||
InitializeListHead(&Slab->PageListHead);
|
||||
KeInitializeSpinLock(&Slab->SlabLock);
|
||||
|
||||
|
@ -123,7 +123,7 @@ ExGrowSlabCache(PSLAB_CACHE Slab)
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
SlabPage = (PSLAB_CACHE_PAGE)(Page + PAGESIZE - sizeof(SLAB_CACHE_PAGE));
|
||||
SlabPage = (PSLAB_CACHE_PAGE)(Page + PAGE_SIZE - sizeof(SLAB_CACHE_PAGE));
|
||||
SlabPage->ReferenceCount = 0;
|
||||
SlabPage->FirstFreeBuffer = (PSLAB_CACHE_BUFCTL)Page;
|
||||
for (i = 0; i < Slab->ObjectsPerPage; i++)
|
||||
|
@ -261,9 +261,9 @@ ExFreeSlabCache(PSLAB_CACHE Slab, PVOID Object)
|
|||
current = CONTAINING_RECORD(current_entry,
|
||||
SLAB_CACHE_PAGE,
|
||||
PageListEntry);
|
||||
Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGESIZE;
|
||||
Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGE_SIZE;
|
||||
if (Base >= Object &&
|
||||
(Base + PAGESIZE - sizeof(SLAB_CACHE_PAGE)) >=
|
||||
(Base + PAGE_SIZE - sizeof(SLAB_CACHE_PAGE)) >=
|
||||
(Object + Slab->ObjectSize))
|
||||
{
|
||||
ExFreeFromPageSlabCache(Slab, current, Object);
|
||||
|
@ -304,7 +304,7 @@ ExDestroySlabCache(PSLAB_CACHE Slab)
|
|||
current = CONTAINING_RECORD(current_entry,
|
||||
SLAB_CACHE_PAGE,
|
||||
PageListEntry);
|
||||
Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGESIZE;
|
||||
Base = (PVOID)current + sizeof(SLAB_CACHE_PAGE) - PAGE_SIZE;
|
||||
if (Slab->Destructor != NULL)
|
||||
{
|
||||
for (i = 0; i < Slab->ObjectsPerPage; i++)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: handle.c,v 1.40 2002/09/08 10:23:39 chorns Exp $
|
||||
/* $Id: handle.c,v 1.41 2002/10/01 19:27:25 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -50,7 +50,7 @@ typedef struct
|
|||
BOOLEAN Inherit;
|
||||
} HANDLE_REP, *PHANDLE_REP;
|
||||
|
||||
#define HANDLE_BLOCK_ENTRIES ((PAGESIZE-sizeof(LIST_ENTRY))/sizeof(HANDLE_REP))
|
||||
#define HANDLE_BLOCK_ENTRIES ((PAGE_SIZE-sizeof(LIST_ENTRY))/sizeof(HANDLE_REP))
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: create.c,v 1.54 2002/09/30 20:56:17 hbirr Exp $
|
||||
/* $Id: create.c,v 1.55 2002/10/01 19:27:25 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -412,7 +412,7 @@ PsCreateTeb(HANDLE ProcessHandle,
|
|||
ULONG ResultLength;
|
||||
|
||||
TebBase = (PVOID)0x7FFDE000;
|
||||
TebSize = PAGESIZE;
|
||||
TebSize = PAGE_SIZE;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: process.c,v 1.92 2002/09/08 10:23:40 chorns Exp $
|
||||
/* $Id: process.c,v 1.93 2002/10/01 19:27:25 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -601,7 +601,7 @@ NtCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
&Process->AddressSpace,
|
||||
MEMORY_AREA_SHARED_DATA,
|
||||
&BaseAddress,
|
||||
PAGESIZE,
|
||||
PAGE_SIZE,
|
||||
PAGE_READONLY,
|
||||
&MemoryArea,
|
||||
FALSE);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: w32call.c,v 1.4 2002/09/08 10:23:41 chorns Exp $
|
||||
/* $Id: w32call.c,v 1.5 2002/10/01 19:27:25 chorns Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -169,7 +169,7 @@ PsAllocateCallbackStack(ULONG StackSize)
|
|||
DPRINT("Failed to create thread stack\n");
|
||||
return(NULL);
|
||||
}
|
||||
for (i = 0; i < (StackSize / PAGESIZE); i++)
|
||||
for (i = 0; i < (StackSize / PAGE_SIZE); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS Page;
|
||||
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Page);
|
||||
|
@ -178,7 +178,7 @@ PsAllocateCallbackStack(ULONG StackSize)
|
|||
return(NULL);
|
||||
}
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
KernelStack + (i * PAGESIZE),
|
||||
KernelStack + (i * PAGE_SIZE),
|
||||
PAGE_EXECUTE_READWRITE,
|
||||
Page,
|
||||
TRUE);
|
||||
|
|
|
@ -25,7 +25,7 @@ typedef struct _USER_HANDLE
|
|||
PVOID ObjectBody;
|
||||
} USER_HANDLE, *PUSER_HANDLE;
|
||||
|
||||
#define HANDLE_BLOCK_ENTRIES ((PAGESIZE-sizeof(LIST_ENTRY))/sizeof(USER_HANDLE))
|
||||
#define HANDLE_BLOCK_ENTRIES ((PAGE_SIZE-sizeof(LIST_ENTRY))/sizeof(USER_HANDLE))
|
||||
|
||||
typedef struct _USER_HANDLE_BLOCK
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue