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