Mm subsystem exports table complete.

svn path=/trunk/; revision=1101
This commit is contained in:
Emanuele Aliberti 2000-04-02 13:32:43 +00:00
parent fccf1c26a7
commit 3b0f32720d
15 changed files with 803 additions and 163 deletions

View file

@ -1,69 +1,11 @@
# $Id: makefile,v 1.6 2000/03/08 21:23:13 jfilby Exp $
# $Id: makefile,v 1.7 2000/04/02 13:32:43 ea Exp $
#
#
BASE_CFLAGS = -I../../../include
MP_OBJECTS = vgamp.o vgamp.coff ../../../ntoskrnl/ntoskrnl.a ../vidport/vidport.a
all: vgamp.sys
.phony: all
all:
make -C display
make -C miniport
clean:
- $(RM) *.o
- $(RM) junk.tmp
- $(RM) base.tmp
- $(RM) temp.exp
- $(RM) *.sys
- $(RM) *.coff
.phony: clean
vgamp.sys: $(MP_OBJECTS)
$(CC) \
-specs=../../svc_specs \
-mdll \
-o junk.tmp \
-Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ \
-Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp \
$(MP_OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) \
--dllname vgamp.sys \
--base-file base.tmp \
--output-exp temp.exp \
--kill-at
- $(RM) base.tmp
$(CC) \
--verbose \
-Wl,--image-base,0x10000 \
-Wl,-e,_DriverEntry@8 \
-Wl,temp.exp \
-specs=../../svc_specs \
-mdll \
-o vgamp.sys \
$(MP_OBJECTS)
- $(RM) temp.exp
floppy: $(FLOPPY_DIR)/drivers/vgamp.sys
$(FLOPPY_DIR)/drivers/vgamp.sys: vgamp.sys
ifeq ($(DOSCLI),yes)
$(CP) vgamp.sys $(FLOPPY_DIR)\drivers\vgamp.sys
else
$(CP) vgamp.sys $(FLOPPY_DIR)/drivers/vgamp.sys
endif
dist: ../../../$(DIST_DIR)/drivers/vgamp.sys
../../../$(DIST_DIR)/drivers/vgamp.sys: vgamp.sys
ifeq ($(DOSCLI),yes)
$(CP) vgamp.sys ..\..\..\$(DIST_DIR)\drivers\vgamp.sys
else
$(CP) vgamp.sys ../../../$(DIST_DIR)/drivers/vgamp.sys
endif
include ../../../rules.mak
make -C display clean
make -C miniport clean

View file

@ -1,10 +1,10 @@
#ifndef _INCLUDE_DDK_MMFUNCS_H
#define _INCLUDE_DDK_MMFUNCS_H
/* $Id: mmfuncs.h,v 1.5 2000/04/02 13:32:38 ea Exp $ */
/* MEMORY MANAGMENT ******************************************************/
#include <internal/mmhal.h>
BOOLEAN MmIsNonPagedSystemAddressValid(PVOID VirtualAddress);
BOOLEAN MmIsThisAnNtAsSystem(VOID);
#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGESIZE) ? ((((ULONG)x)&(~0xfff))+0x1000) : ((ULONG)x) )
#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~0xfff))
@ -63,6 +63,13 @@ extern inline unsigned int ADDRESS_AND_SIZE_TO_SPAN_PAGES(PVOID Va,
*/
#define BYTES_TO_PAGES(size) (?)
DWORD
STDCALL
MmAdjustWorkingSetSize (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
);
PVOID
STDCALL
MmAllocateContiguousMemory (
@ -80,8 +87,17 @@ MmAllocateNonCachedMemory (
* ARGUMENTS:
* MemoryDescriptorList = MDL to fill
*/
VOID MmBuildMdlForNonPagedPool(PMDL MemoryDescriptorList);
VOID
STDCALL
MmBuildMdlForNonPagedPool (
PMDL MemoryDescriptorList
);
BOOLEAN
STDCALL
MmCanFileBeTruncated (
IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
IN PLARGE_INTEGER NewFileSize
);
/*
* FUNCTION: Allocates and initializes an MDL
* ARGUMENTS:
@ -90,7 +106,50 @@ VOID MmBuildMdlForNonPagedPool(PMDL MemoryDescriptorList);
* Length = Length in bytes of the buffer
* RETURNS: A pointer to the initalized MDL
*/
PMDL MmCreateMdl(PMDL MemoryDescriptorList, PVOID Base, ULONG Length);
PMDL
STDCALL
MmCreateMdl (
PMDL MemoryDescriptorList,
PVOID Base,
ULONG Length
);
#if 0
NTSTATUS
STDCALL
MmCreateSection (
OUT PSECTION_OBJECT * SectionObject,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN PLARGE_INTEGER MaximumSize,
IN ULONG SectionPageProtection,
IN ULONG AllocationAttributes,
IN HANDLE FileHandle OPTIONAL,
IN PFILE_OBJECT File OPTIONAL
);
#endif
DWORD
STDCALL
MmDbgTranslatePhysicalAddress (
DWORD Unknown0,
DWORD Unknown1
);
BOOLEAN
STDCALL
MmDisableModifiedWriteOfSection (
DWORD Unknown0
);
BOOLEAN
STDCALL
MmFlushImageSection (
IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
IN MMFLUSH_TYPE FlushType
);
BOOLEAN
STDCALL
MmForceSectionClosed (
DWORD Unknown0,
DWORD Unknown1
);
VOID
STDCALL
MmFreeContiguousMemory (
@ -108,7 +167,7 @@ MmFreeNonCachedMemory (
* Mdl = the mdl
* RETURNS: Size of the buffer
*/
ULONG MmGetMdlByteCount(PMDL Mdl);
#define MmGetMdlByteCount(Mdl) ((Mdl)->ByteCount)
/*
* FUNCTION: Returns the byte offset within a page of the buffer described
@ -117,7 +176,7 @@ ULONG MmGetMdlByteCount(PMDL Mdl);
* Mdl = the mdl
* RETURNS: The offset in bytes
*/
ULONG MmGetMdlByteOffset(PMDL Mdl);
#define MmGetMdlByteOffset(Mdl) ((Mdl)->ByteOffset)
/*
* FUNCTION: Returns the initial virtual address for a buffer described
@ -126,7 +185,8 @@ ULONG MmGetMdlByteOffset(PMDL Mdl);
* Mdl = the mdl
* RETURNS: The initial virtual address
*/
PVOID MmGetMdlVirtualAddress(PMDL Mdl);
#define MmGetMdlVirtualAddress(Mdl) \
((PVOID) ((PCHAR) (Mdl)->StartVa + (Mdl)->ByteOffset))
/*
* FUNCTION: Returns the physical address corresponding to a given valid
@ -135,7 +195,12 @@ PVOID MmGetMdlVirtualAddress(PMDL Mdl);
* BaseAddress = the virtual address
* RETURNS: The physical address
*/
PHYSICAL_ADDRESS MmGetPhysicalAddress(PVOID BaseAddress);
PHYSICAL_ADDRESS
STDCALL
MmGetPhysicalAddress (
IN PVOID BaseAddress
);
#define MmGetProcedureAddress(Address) (Address)
/*
* FUNCTION: Maps the physical pages described by an MDL into system space
@ -144,7 +209,16 @@ PHYSICAL_ADDRESS MmGetPhysicalAddress(PVOID BaseAddress);
* RETURNS: The base system address for the mapped buffer
*/
PVOID MmGetSystemAddressForMdl(PMDL Mdl);
NTSTATUS
STDCALL
MmGrowKernelStack (
DWORD Unknown0
);
#ifdef __NTOSKRNL__
extern PVOID EXPORTED MmHighestUserAddress;
#else
extern PVOID IMPORTED MmHighestUserAddress;
#endif
/*
* FUNCTION: Initalizes an mdl
* ARGUMENTS:
@ -160,23 +234,39 @@ VOID MmInitializeMdl(PMDL MemoryDescriptorList, PVOID BaseVa, ULONG Length);
* VirtualAddress = address to be check
* RETURNS: TRUE if an access would be valid
*/
BOOLEAN MmIsAddressValid(PVOID VirtualAddress);
BOOLEAN
STDCALL
MmIsAddressValid (
IN PVOID VirtualAddress
);
BOOLEAN
STDCALL
MmIsNonPagedSystemAddressValid (
IN PVOID VirtualAddress
);
BOOLEAN
STDCALL
MmIsRecursiveIoFault (
VOID
);
/*
* FUNCTION: Checks if the current platform is a workstation or a server
* RETURNS: If the system is a server returns true
* NOTE: Drivers can use this as an estimate of the likely resources
* available
*/
BOOLEAN MmIsThisAnAsSystem(VOID);
BOOLEAN
STDCALL
MmIsThisAnNtAsSystem (
VOID
);
/*
* FUNCTION: Locks a section of the driver's code into memory
* ARGUMENTS:
* AddressWithinSection = Any address in the region
* RETURNS: A handle to the region
*/
PVOID MmLockPagableCodeSection(PVOID AddressWithinSection);
#define MmLockPagableCodeSection(Address) MmLockPagableDataSection(Address)
/*
* FUNCTION: Locks a section of the driver's data into memory
@ -184,16 +274,27 @@ PVOID MmLockPagableCodeSection(PVOID AddressWithinSection);
* AddressWithinSection = Any address in the region
* RETURNS: A handle to the region
*/
PVOID MmLockPagableDataSection(PVOID AddressWithinSection);
PVOID
STDCALL
MmLockPagableDataSection (
PVOID AddressWithinSection
);
PVOID
STDCALL
MmLockPagableImageSection (
PVOID AddressWithinSection
);
/*
* FUNCTION: Locks a section of memory
* ARGUMENTS:
* ImageSectionHandle = handle returned from MmLockPagableCodeSection
* or MmLockPagableDataSection
*/
VOID MmLockPagableSectionByHandle(PVOID ImageSectionHandle);
VOID
STDCALL
MmLockPagableSectionByHandle (
PVOID ImageSectionHandle
);
PVOID
STDCALL
MmMapIoSpace (
@ -201,12 +302,6 @@ MmMapIoSpace (
ULONG NumberOfBytes,
BOOLEAN CacheEnable
);
VOID
STDCALL
MmUnmapIoSpace (
PVOID BaseAddress,
ULONG NumberOfBytes
);
/*
* FUNCTION: Maps the pages described by a given MDL
* ARGUMENTS:
@ -214,23 +309,90 @@ MmUnmapIoSpace (
* AccessMode = Access mode in which to map the MDL
* RETURNS: The base virtual address which maps the buffer
*/
PVOID MmMapLockedPages(PMDL MemoryDescriptorList, KPROCESSOR_MODE AccessMode);
PVOID
STDCALL
MmMapLockedPages (
PMDL MemoryDescriptorList,
KPROCESSOR_MODE AccessMode
);
VOID
STDCALL
MmMapMemoryDumpMdl (
PVOID Unknown0
);
PVOID
STDCALL
MmMapVideoDisplay (
IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType
);
NTSTATUS
STDCALL
MmMapViewInSystemSpace (
IN PVOID Section,
OUT PVOID * MappedBase,
IN PULONG ViewSize
);
PVOID
STDCALL
MmMapViewOfSection (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5,
DWORD Unknown6,
DWORD Unknown7,
DWORD Unknown8,
DWORD Unknown9
);
/*
* FUNCTION: Makes the whole driver pageable
* ARGUMENTS:
* AddressWithinSection = Any address within the driver
*/
VOID MmPageEntireDriver(PVOID AddressWithinSection);
VOID
STDCALL
MmPageEntireDriver (
PVOID AddressWithinSection
);
/*
* FUNCTION: Resets the pageable status of a driver's sections to their
* compile time settings
* ARGUMENTS:
* AddressWithinSection = Any address within the driver
*/
VOID MmResetDriverPaging(PVOID AddressWithinSection);
VOID
STDCALL
MmResetDriverPaging (
PVOID AddressWithinSection
);
DWORD
STDCALL
MmSecureVirtualMemory (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
);
BOOLEAN
STDCALL
MmSetAddressRangeModified (
DWORD Unknown0,
DWORD Unknown1
);
NTSTATUS
STDCALL
MmSetBankedSection (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5
);
/*
* FUNCTION: Reinitializes a caller-allocated MDL
* ARGUMENTS:
@ -248,16 +410,22 @@ VOID MmPrepareMdlForReuse(PMDL Mdl);
* Operation = Types of operation for which the pages should be
* probed
*/
VOID MmProbeAndLockPages(PMDL MemoryDescriptorList,
KPROCESSOR_MODE AccessMode,
LOCK_OPERATION Operation);
VOID
STDCALL
MmProbeAndLockPages (
PMDL MemoryDescriptorList,
KPROCESSOR_MODE AccessMode,
LOCK_OPERATION Operation
);
/*
* FUNCTION: Returns an estimate of the amount of memory in the system
* RETURNS: Either MmSmallSystem, MmMediumSystem or MmLargeSystem
*/
MM_SYSTEM_SIZE MmQuerySystemSize(VOID);
MM_SYSTEM_SIZE
STDCALL
MmQuerySystemSize (
VOID
);
/*
* FUNCTION: Returns the number of bytes to allocate for an MDL
* describing a given address range
@ -266,22 +434,67 @@ MM_SYSTEM_SIZE MmQuerySystemSize(VOID);
* Length = size in bytes of the region
* RETURNS: The number of bytes required for the MDL
*/
ULONG MmSizeOfMdl(PVOID Base, ULONG Length);
ULONG
STDCALL
MmSizeOfMdl (
PVOID Base,
ULONG Length
);
/*
* FUNCTION: Unlocks the physical pages described by a given MDL
* ARGUMENTS:
* Mdl = Mdl to unlock
*/
VOID MmUnlockPages(PMDL Mdl);
VOID
STDCALL
MmUnlockPages (
PMDL Mdl
);
/*
* FUNCTION: Releases a section of driver code or data previously locked into
* memory
* ARGUMENTS:
* ImageSectionHandle = Handle for the locked section
*/
VOID MmUnlockPagableImageSection(PVOID ImageSectionHandle);
VOID MmUnmapLockedPages(PVOID BaseAddress, PMDL MemoryDescriptorList);
VOID
STDCALL
MmUnlockPagableImageSection (
PVOID ImageSectionHandle
);
VOID
STDCALL
MmUnmapIoSpace (
PVOID BaseAddress,
ULONG NumberOfBytes
);
VOID
STDCALL
MmUnmapLockedPages (
PVOID BaseAddress,
PMDL MemoryDescriptorList
);
VOID
STDCALL
MmUnmapVideoDisplay (
IN PVOID BaseAddress,
IN ULONG NumberOfBytes
);
NTSTATUS
STDCALL
MmUnmapViewInSystemSpace (
DWORD Unknown0
);
#if 0
NTSTATUS
STDCALL
MmUnmapViewOfSection (
PEPROCESS Process,
PMEMORY_AREA MemoryArea
)
#endif
VOID
STDCALL
MmUnsecureVirtualMemory (
DWORD Unknown0
);
#endif

View file

@ -1,3 +1,7 @@
#ifndef _INCLUDE_DDK_MMTYPES_H
#define _INCLUDE_DDK_MMTYPES_H
/* $Id: mmtypes.h,v 1.4 2000/04/02 13:32:38 ea Exp $ */
typedef struct _MADDRESS_SPACE
{
@ -42,3 +46,24 @@ typedef struct _MDL
#define MmSmallSystem (0)
#define MmMediumSystem (1)
#define MmLargeSystem (2)
/* Used in MmFlushImageSection */
typedef
enum _MMFLUSH_TYPE
{
MmFlushForDelete,
MmFlushForWrite
} MMFLUSH_TYPE;
typedef
enum _MEMORY_CACHING_TYPE
{
MmNonCached = FALSE,
MmCached = TRUE,
MmFrameBufferCached,
MmHardwareCoherentCached,
MmMaximumCacheType
} MEMORY_CACHING_TYPE;
#endif

View file

@ -119,7 +119,7 @@ PVOID MmGetMdlPageAddress(PMDL Mdl, PVOID Offset);
VOID MiShutdownMemoryManager(VOID);
ULONG MmGetPhysicalAddressForProcess(PEPROCESS Process,
PVOID Address);
NTSTATUS MmUnmapViewOfSection(PEPROCESS Process,
NTSTATUS STDCALL MmUnmapViewOfSection(PEPROCESS Process,
PMEMORY_AREA MemoryArea);
PVOID MiTryToSharePageInSection(PSECTION_OBJECT Section, ULONG Offset);
@ -128,4 +128,18 @@ NTSTATUS MmSafeCopyToUser(PVOID Dest, PVOID Src, ULONG NumberOfBytes);
VOID MmInitPagingFile(VOID);
ULONG MmPageFault(ULONG cs, ULONG eip, ULONG error_code);
/* FIXME: it should be in ddk/mmfuncs.h */
NTSTATUS
STDCALL
MmCreateSection (
OUT PSECTION_OBJECT * SectionObject,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN PLARGE_INTEGER MaximumSize,
IN ULONG SectionPageProtection,
IN ULONG AllocationAttributes,
IN HANDLE FileHandle OPTIONAL,
IN PFILE_OBJECT File OPTIONAL
);
#endif

View file

@ -1,4 +1,5 @@
/*
/* $Id: drvlck.c,v 1.3 2000/04/02 13:32:41 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/io/drvlck.c
@ -17,6 +18,7 @@
/* FUNCTIONS *****************************************************************/
#if 0
VOID MmUnlockPagableImageSection(PVOID ImageSectionHandle)
/*
* FUNCTION: Releases a section of driver code or driver data, previously
@ -30,13 +32,15 @@ VOID MmUnlockPagableImageSection(PVOID ImageSectionHandle)
// MmUnlockMemoryArea((MEMORY_AREA *)ImageSectionHandle);
UNIMPLEMENTED;
}
#endif
VOID MmLockPagableSectionByHandle(PVOID ImageSectionHandle)
VOID STDCALL MmLockPagableSectionByHandle(PVOID ImageSectionHandle)
{
// MmLockMemoryArea((MEMORY_AREA *)ImageSectionHandle);
UNIMPLEMENTED;
}
#if 0
PVOID MmLockPagableCodeSection(PVOID AddressWithinSection)
{
PVOID Handle;
@ -44,17 +48,33 @@ PVOID MmLockPagableCodeSection(PVOID AddressWithinSection)
MmLockPagableSectionByHandle(Handle);
return(Handle);
}
#endif
PVOID MmLockPagableDataSection(PVOID AddressWithinSection)
PVOID STDCALL MmLockPagableDataSection(PVOID AddressWithinSection)
{
return(MmLockPagableCodeSection(AddressWithinSection));
PVOID Handle;
Handle = MmOpenMemoryAreaByAddress(NULL,AddressWithinSection);
MmLockPagableSectionByHandle(Handle);
return(Handle);
}
VOID MmPageEntireDriver(PVOID AddressWithinSection)
VOID
STDCALL
MmUnlockPagableImageSection (
PVOID ImageSectionHandle
)
{
}
VOID MmResetDriverPaging(PVOID AddressWithinSection)
VOID STDCALL MmPageEntireDriver(PVOID AddressWithinSection)
{
}
VOID STDCALL MmResetDriverPaging(PVOID AddressWithinSection)
{
}
/* EOF */

View file

@ -1,4 +1,4 @@
# $Id: makefile_rex,v 1.65 2000/03/29 13:11:52 dwelch Exp $
# $Id: makefile_rex,v 1.66 2000/04/02 13:32:39 ea Exp $
#
# ReactOS Operating System
#
@ -37,7 +37,8 @@ KE_I386_OBJECTS = ke/i386/thread.o ke/i386/usercall.o ke/i386/exp.o
MM_OBJECTS = mm/mm.o mm/freelist.o mm/pool.o mm/virtual.o \
mm/mdl.o mm/zone.o mm/paging.o mm/section.o \
mm/marea.o mm/ppool.o mm/npool.o mm/pagefile.o \
mm/cont.o mm/iospace.o mm/ncache.o mm/aspace.o
mm/cont.o mm/iospace.o mm/ncache.o mm/aspace.o \
mm/pagfault.o
MM_I386_OBJECTS = mm/i386/page.o mm/i386/memsafe.o

View file

@ -1,4 +1,5 @@
/*
/* $Id: page.c,v 1.7 2000/04/02 13:32:43 ea Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/i386/page.c
@ -275,7 +276,7 @@ VOID MmSetPageProtect(PEPROCESS Process,
}
}
PHYSICAL_ADDRESS MmGetPhysicalAddress(PVOID vaddr)
PHYSICAL_ADDRESS STDCALL MmGetPhysicalAddress(PVOID vaddr)
/*
* FUNCTION: Returns the physical address corresponding to a virtual address
*/
@ -291,3 +292,6 @@ PHYSICAL_ADDRESS MmGetPhysicalAddress(PVOID vaddr)
return p;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: iospace.c,v 1.3 2000/03/29 13:11:54 dwelch Exp $
/* $Id: iospace.c,v 1.4 2000/04/02 13:32:41 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -117,4 +117,38 @@ VOID STDCALL MmUnmapIoSpace (IN PVOID BaseAddress,
}
/**********************************************************************
* NAME EXPORTED
* MmMapVideoDisplay@16
*/
PVOID
STDCALL
MmMapVideoDisplay (
IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType
)
{
return MmMapIoSpace (
PhysicalAddress,
NumberOfBytes,
CacheType
);
}
VOID
STDCALL
MmUnmapVideoDisplay (
IN PVOID BaseAddress,
IN ULONG NumberOfBytes
)
{
MmUnmapIoSpace (
BaseAddress,
NumberOfBytes
);
}
/* EOF */

View file

@ -1,4 +1,5 @@
/*
/* $Id: mdl.c,v 1.18 2000/04/02 13:32:41 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/mdl.c
@ -30,7 +31,7 @@ PVOID MmGetMdlPageAddress(PMDL Mdl, PVOID Offset)
return((PVOID)mdl_pages[((ULONG)Offset) / PAGESIZE]);
}
VOID MmUnlockPages(PMDL MemoryDescriptorList)
VOID STDCALL MmUnlockPages(PMDL MemoryDescriptorList)
/*
* FUNCTION: Unlocks the physical pages described by a given MDL
* ARGUMENTS:
@ -43,7 +44,7 @@ VOID MmUnlockPages(PMDL MemoryDescriptorList)
/* It is harmless to leave this one as a stub */
}
PVOID MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode)
PVOID STDCALL MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode)
/*
* FUNCTION: Maps the physical pages described by a given MDL
* ARGUMENTS:
@ -87,7 +88,7 @@ PVOID MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode)
return(base + Mdl->ByteOffset);
}
VOID MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
VOID STDCALL MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
/*
* FUNCTION: Releases a mapping set up by a preceding call to MmMapLockedPages
* ARGUMENTS:
@ -130,7 +131,7 @@ VOID MmBuildMdlFromPages(PMDL Mdl)
}
VOID MmProbeAndLockPages(PMDL Mdl,
VOID STDCALL MmProbeAndLockPages(PMDL Mdl,
KPROCESSOR_MODE AccessMode,
LOCK_OPERATION Operation)
/*
@ -195,6 +196,7 @@ VOID MmProbeAndLockPages(PMDL Mdl,
MmUnlockAddressSpace(AddressSpace);
}
#if 0
ULONG MmGetMdlByteCount(PMDL Mdl)
/*
* FUNCTION: MmGetMdlByteCount returns the length in bytes described
@ -207,7 +209,9 @@ ULONG MmGetMdlByteCount(PMDL Mdl)
{
return(Mdl->ByteCount);
}
#endif
#if 0
ULONG MmGetMdlByteOffset(PMDL Mdl)
/*
* FUNCTION: Returns the byte offset within its page of the buffer described
@ -219,8 +223,9 @@ ULONG MmGetMdlByteOffset(PMDL Mdl)
{
return(Mdl->ByteOffset);
}
#endif
ULONG MmSizeOfMdl(PVOID Base, ULONG Length)
ULONG STDCALL MmSizeOfMdl(PVOID Base, ULONG Length)
/*
* FUNCTION: Returns the number of bytes to allocate for an MDL describing
* the given address range
@ -235,10 +240,12 @@ ULONG MmSizeOfMdl(PVOID Base, ULONG Length)
return(sizeof(MDL)+(len*sizeof(ULONG)));
}
#if 0
PVOID MmGetMdlVirtualAddress(PMDL Mdl)
{
return(Mdl->StartVa + Mdl->ByteOffset);
}
#endif
PVOID MmGetSystemAddressForMdl(PMDL Mdl)
/*
@ -262,7 +269,7 @@ PVOID MmGetSystemAddressForMdl(PMDL Mdl)
return(Mdl->MappedSystemVa);
}
VOID MmBuildMdlForNonPagedPool(PMDL Mdl)
VOID STDCALL MmBuildMdlForNonPagedPool(PMDL Mdl)
/*
* FUNCTION: Fills in the corresponding physical page array of a given
* MDL for a buffer in nonpaged system space
@ -300,7 +307,7 @@ VOID MmInitializeMdl(PMDL MemoryDescriptorList, PVOID Base, ULONG Length)
MemoryDescriptorList->Process = PsGetCurrentProcess();
}
PMDL MmCreateMdl(PMDL MemoryDescriptorList, PVOID Base, ULONG Length)
PMDL STDCALL MmCreateMdl(PMDL MemoryDescriptorList, PVOID Base, ULONG Length)
/*
* FUNCTION: Allocates and initalizes an MDL
* ARGUMENTS:
@ -327,3 +334,15 @@ PMDL MmCreateMdl(PMDL MemoryDescriptorList, PVOID Base, ULONG Length)
return(MemoryDescriptorList);
}
VOID
STDCALL
MmMapMemoryDumpMdl (
PVOID Unknown0
)
{
UNIMPLEMENTED;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: mm.c,v 1.26 2000/03/29 13:11:54 dwelch Exp $
/* $Id: mm.c,v 1.27 2000/04/02 13:32:41 ea Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
@ -53,6 +53,9 @@ static MEMORY_AREA* kernel_data_desc = NULL;
static MEMORY_AREA* kernel_param_desc = NULL;
static MEMORY_AREA* kernel_pool_desc = NULL;
ULONG EXPORTED MmUserProbeAddress [PAGESIZE] = {0,}; /* FIXME */
PVOID EXPORTED MmHighestUserAddress = NULL; /* FIXME */
/* FUNCTIONS ****************************************************************/
VOID MiShutdownMemoryManager(VOID)
@ -331,12 +334,12 @@ ULONG MmPageFault(ULONG cs, ULONG eip, ULONG error_code)
return(NT_SUCCESS(Status));
}
BOOLEAN MmIsThisAnNtAsSystem(VOID)
BOOLEAN STDCALL MmIsThisAnNtAsSystem(VOID)
{
return(IsThisAnNtAsSystem);
}
MM_SYSTEM_SIZE MmQuerySystemSize(VOID)
MM_SYSTEM_SIZE STDCALL MmQuerySystemSize(VOID)
{
return(MmSystemSize);
}
@ -426,4 +429,54 @@ VOID MmInitSystem (ULONG Phase, boot_param* bp, ULONG LastKernelAddress)
}
}
/* Miscellanea functions: they may fit somewhere else */
DWORD
STDCALL
MmAdjustWorkingSetSize (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
UNIMPLEMENTED;
return (0);
}
DWORD
STDCALL
MmDbgTranslatePhysicalAddress (
DWORD Unknown0,
DWORD Unknown1
)
{
UNIMPLEMENTED;
return (0);
}
NTSTATUS
STDCALL
MmGrowKernelStack (
DWORD Unknown0
)
{
UNIMPLEMENTED;
return (STATUS_NOT_IMPLEMENTED);
}
BOOLEAN
STDCALL
MmSetAddressRangeModified (
DWORD Unknown0,
DWORD Unknown1
)
{
UNIMPLEMENTED;
return (FALSE);
}
/* EOF */

View file

@ -0,0 +1,18 @@
/* $Id: pagfault.c,v 1.1 2000/04/02 13:32:41 ea Exp $ */
#include <ddk/ntddk.h>
BOOLEAN
STDCALL
MmIsRecursiveIoFault (
VOID
)
{
PETHREAD Thread = PsGetCurrentThread ();
return ( Thread->DisablePageFaultClustering
| Thread->ForwardClusterOnly
);
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: section.c,v 1.26 2000/03/29 13:11:54 dwelch Exp $
/* $Id: section.c,v 1.27 2000/04/02 13:32:41 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -23,7 +23,7 @@
/* GLOBALS *******************************************************************/
POBJECT_TYPE MmSectionType = NULL;
POBJECT_TYPE EXPORTED MmSectionObjectType = NULL;
/* FUNCTIONS *****************************************************************/
@ -113,31 +113,32 @@ NTSTATUS MmInitSectionImplementation(VOID)
{
ANSI_STRING AnsiString;
MmSectionType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
MmSectionObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
MmSectionType->TotalObjects = 0;
MmSectionType->TotalHandles = 0;
MmSectionType->MaxObjects = ULONG_MAX;
MmSectionType->MaxHandles = ULONG_MAX;
MmSectionType->PagedPoolCharge = 0;
MmSectionType->NonpagedPoolCharge = sizeof(SECTION_OBJECT);
MmSectionType->Dump = NULL;
MmSectionType->Open = NULL;
MmSectionType->Close = NULL;
MmSectionType->Delete = MmpDeleteSection;
MmSectionType->Parse = NULL;
MmSectionType->Security = NULL;
MmSectionType->QueryName = NULL;
MmSectionType->OkayToClose = NULL;
MmSectionType->Create = MmpCreateSection;
MmSectionObjectType->TotalObjects = 0;
MmSectionObjectType->TotalHandles = 0;
MmSectionObjectType->MaxObjects = ULONG_MAX;
MmSectionObjectType->MaxHandles = ULONG_MAX;
MmSectionObjectType->PagedPoolCharge = 0;
MmSectionObjectType->NonpagedPoolCharge = sizeof(SECTION_OBJECT);
MmSectionObjectType->Dump = NULL;
MmSectionObjectType->Open = NULL;
MmSectionObjectType->Close = NULL;
MmSectionObjectType->Delete = MmpDeleteSection;
MmSectionObjectType->Parse = NULL;
MmSectionObjectType->Security = NULL;
MmSectionObjectType->QueryName = NULL;
MmSectionObjectType->OkayToClose = NULL;
MmSectionObjectType->Create = MmpCreateSection;
RtlInitAnsiString(&AnsiString,"Section");
RtlAnsiStringToUnicodeString(&MmSectionType->TypeName,
RtlAnsiStringToUnicodeString(&MmSectionObjectType->TypeName,
&AnsiString,TRUE);
return(STATUS_SUCCESS);
}
/* FIXME: NtCS should call MmCS */
NTSTATUS STDCALL NtCreateSection (OUT PHANDLE SectionHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
@ -178,7 +179,7 @@ NTSTATUS STDCALL NtCreateSection (OUT PHANDLE SectionHandle,
Section = ObCreateObject(SectionHandle,
DesiredAccess,
ObjectAttributes,
MmSectionType);
MmSectionObjectType);
DPRINT("SectionHandle %x\n", SectionHandle);
if (Section == NULL)
{
@ -259,7 +260,7 @@ NTSTATUS STDCALL NtOpenSection(PHANDLE SectionHandle,
ObjectAttributes->Attributes,
NULL,
DesiredAccess,
MmSectionType,
MmSectionObjectType,
UserMode,
NULL,
&Object);
@ -356,7 +357,7 @@ NTSTATUS STDCALL NtMapViewOfSection(HANDLE SectionHandle,
Status = ObReferenceObjectByHandle(SectionHandle,
SECTION_MAP_READ,
MmSectionType,
MmSectionObjectType,
UserMode,
(PVOID*)&Section,
NULL);
@ -440,7 +441,7 @@ NTSTATUS STDCALL NtMapViewOfSection(HANDLE SectionHandle,
return(STATUS_SUCCESS);
}
NTSTATUS MmUnmapViewOfSection(PEPROCESS Process,
NTSTATUS STDCALL MmUnmapViewOfSection(PEPROCESS Process,
PMEMORY_AREA MemoryArea)
{
PSECTION_OBJECT Section;
@ -607,4 +608,191 @@ PVOID STDCALL MmAllocateSection (IN ULONG Length)
}
/**********************************************************************
* NAME EXPORTED
* MmMapViewOfSection@40
*
* DESCRIPTION
*
* ARGUMENTS
* FIXME: stack space allocated is 40 bytes, but nothing
* is known about what they are filled with.
*
* RETURN VALUE
* Status.
*
*/
PVOID
STDCALL
MmMapViewOfSection (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5,
DWORD Unknown6,
DWORD Unknown7,
DWORD Unknown8,
DWORD Unknown9
)
{
UNIMPLEMENTED;
return (NULL);
}
BOOLEAN
STDCALL
MmCanFileBeTruncated (
IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
IN PLARGE_INTEGER NewFileSize
)
{
UNIMPLEMENTED;
return (FALSE);
}
BOOLEAN
STDCALL
MmDisableModifiedWriteOfSection (
DWORD Unknown0
)
{
UNIMPLEMENTED;
return (FALSE);
}
BOOLEAN
STDCALL
MmFlushImageSection (
IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
IN MMFLUSH_TYPE FlushType
)
{
UNIMPLEMENTED;
return (FALSE);
}
BOOLEAN
STDCALL
MmForceSectionClosed (
DWORD Unknown0,
DWORD Unknown1
)
{
UNIMPLEMENTED;
return (FALSE);
}
NTSTATUS
STDCALL
MmMapViewInSystemSpace (
IN PVOID Section,
OUT PVOID * MappedBase,
IN PULONG ViewSize
)
{
UNIMPLEMENTED;
return (STATUS_NOT_IMPLEMENTED);
}
NTSTATUS
STDCALL
MmUnmapViewInSystemSpace (
DWORD Unknown0
)
{
UNIMPLEMENTED;
return (STATUS_NOT_IMPLEMENTED);
}
NTSTATUS
STDCALL
MmSetBankedSection (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5
)
{
UNIMPLEMENTED;
return (STATUS_NOT_IMPLEMENTED);
}
/**********************************************************************
* NAME EXPORTED
* MmCreateSection@
*
* DESCRIPTION
* Creates a section object.
*
* ARGUMENTS
* SectionObjiect (OUT)
* Caller supplied storage for the resulting pointer
* to a SECTION_BOJECT instance;
*
* DesiredAccess
* Specifies the desired access to the section can be a
* combination of:
* STANDARD_RIGHTS_REQUIRED |
* SECTION_QUERY |
* SECTION_MAP_WRITE |
* SECTION_MAP_READ |
* SECTION_MAP_EXECUTE
*
* ObjectAttributes [OPTIONAL]
* Initialized attributes for the object can be used
* to create a named section;
*
* MaximumSize
* Maximizes the size of the memory section. Must be
* non-NULL for a page-file backed section.
* If value specified for a mapped file and the file is
* not large enough, file will be extended.
*
* SectionPageProtection
* Can be a combination of:
* PAGE_READONLY |
* PAGE_READWRITE |
* PAGE_WRITEONLY |
* PAGE_WRITECOPY
*
* AllocationAttributes
* Can be a combination of:
* SEC_IMAGE |
* SEC_RESERVE
*
* FileHandle
* Handle to a file to create a section mapped to a file
* instead of a memory backed section;
*
* File
* Unknown.
*
* RETURN VALUE
* Status.
*/
NTSTATUS
STDCALL
MmCreateSection (
OUT PSECTION_OBJECT * SectionObject,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN PLARGE_INTEGER MaximumSize,
IN ULONG SectionPageProtection,
IN ULONG AllocationAttributes,
IN HANDLE FileHandle OPTIONAL,
IN PFILE_OBJECT File OPTIONAL
)
{
return (STATUS_NOT_IMPLEMENTED);
}
/* EOF */

View file

@ -1,4 +1,5 @@
/*
/* $Id: virtual.c,v 1.26 2000/04/02 13:32:42 ea Exp $
*
* COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/virtual.c
@ -78,12 +79,12 @@ NTSTATUS MmReleaseMmInfo(PEPROCESS Process)
return(STATUS_SUCCESS);
}
BOOLEAN MmIsNonPagedSystemAddressValid(PVOID VirtualAddress)
BOOLEAN STDCALL MmIsNonPagedSystemAddressValid(PVOID VirtualAddress)
{
UNIMPLEMENTED;
}
BOOLEAN MmIsAddressValid(PVOID VirtualAddress)
BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress)
/*
* FUNCTION: Checks whether the given address is valid for a read or write
* ARGUMENTS:
@ -635,3 +636,27 @@ NTSTATUS STDCALL NtWriteVirtualMemory(IN HANDLE ProcessHandle,
return(STATUS_SUCCESS);
}
DWORD
STDCALL
MmSecureVirtualMemory (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
UNIMPLEMENTED;
return 0;
}
VOID
STDCALL
MmUnsecureVirtualMemory (
DWORD Unknown0
)
{
UNIMPLEMENTED;
}
/* EOF */

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.64 2000/03/29 13:11:53 dwelch Exp $
; $Id: ntoskrnl.def,v 1.65 2000/04/02 13:32:40 ea Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -297,13 +297,54 @@ KeSetEvent
KeSetTimer
KeSynchronizeExecution
KeWaitForSingleObject
MmAdjustWorkingSetSize@12
MmAllocateContiguousMemory@12
MmAllocateNonCachedMemory@4
MmBuildMdlForNonPagedPool@4
MmCanFileBeTruncated@8
MmCreateMdl@12
MmCreateSection@32
MmDbgTranslatePhysicalAddress@8
MmDisableModifiedWriteOfSection@4
MmFlushImageSection@8
MmForceSectionClosed@8
MmFreeContiguousMemory@4
MmFreeNonCachedMemory@8
MmGetSystemAddressForMdl
MmGetPhysicalAddress@4
MmGrowKernelStack@4
MmHighestUserAddress DATA
MmIsAddressValid@4
MmIsNonPagedSystemAddressValid@4
MmIsRecursiveIoFault@0
MmIsThisAnNtAsSystem@0
MmLockPagableDataSection@4
MmLockPagableImageSection@4=MmLockPagableDataSection@4
MmLockPagableSectionByHandle@4
MmMapIoSpace@16
MmMapLockedPages@8
MmMapMemoryDumpMdl@4
MmMapVideoDisplay@16
MmMapViewInSystemSpace@12
MmMapViewOfSection@40
MmPageEntireDriver@4
MmProbeAndLockPages@12
MmQuerySystemSize@0
MmResetDriverPaging@4
MmSectionObjectType DATA
MmSecureVirtualMemory@12
MmSetAddressRangeModified@8
MmSetBankedSection@24
MmSizeOfMdl@8
MmSystemRangeStart=MmSectionObjectType
MmUnlockPagableImageSection@4
MmUnlockPages@4
MmUnmapIoSpace@8
MmUnmapLockedPages@8
MmUnmapVideoDisplay@8
MmUnmapViewInSystemSpace@4
MmUnmapViewOfSection@8
MmUnsecureVirtualMemory@4
MmUserProbeAddress DATA
NlsAnsiCodePage DATA
NlsLeadByteInfo DATA
NlsMbCodePageTag DATA
@ -728,6 +769,7 @@ IoGetCurrentIrpStackLocation
IoInitializeDpcRequest
IoMarkIrpPending
IoRequestDpc
MmGetSystemAddressForMdl
;
;
; exports from hal.dll

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.51 2000/03/29 13:11:53 dwelch Exp $
; $Id: ntoskrnl.edf,v 1.52 2000/04/02 13:32:40 ea Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -296,13 +296,54 @@ KeSetEvent
KeSetTimer
KeSynchronizeExecution
KeWaitForSingleObject
MmAdjustWorkingSetSize=MmAdjustWorkingSetSize@12
MmAllocateContiguousMemory=MmAllocateContiguousMemory@12
MmAllocateNonCachedMemory=MmAllocateNonCachedMemory@4
MmBuildMdlForNonPagedPool=MmBuildMdlForNonPagedPool@4
MmCanFileBeTruncated=MmCanFileBeTruncated@8
MmCreateMdl=MmCreateMdl@12
MmCreateSection=MmCreateSection@32
MmDbgTranslatePhysicalAddress=MmDbgTranslatePhysicalAddress@8
MmDisableModifiedWriteOfSection=MmDisableModifiedWriteOfSection@4
MmFlushImageSection=MmFlushImageSection@8
MmForceSectionClosed=MmForceSectionClosed@8
MmFreeContiguousMemory=MmFreeContiguousMemory@4
MmFreeNonCachedMemory=MmFreeNonCachedMemory@8
MmGetSystemAddressForMdl
MmGetPhysicalAddress=MmGetPhysicalAddress@4
MmGrowKernelStack=MmGrowKernelStack@4
MmHighestUserAddress DATA
MmIsAddressValid=MmIsAddressValid@4
MmIsNonPagedSystemAddressValid=MmIsNonPagedSystemAddressValid@4
MmIsRecursiveIoFault=MmIsRecursiveIoFault@0
MmIsThisAnNtAsSystem=MmIsThisAnNtAsSystem@0
MmLockPagableDataSection=MmLockPagableDataSection@4
MmLockPagableImageSection=MmLockPagableDataSection@4
MmLockPagableSectionByHandle=MmLockPagableSectionByHandle@4
MmMapIoSpace=MmMapIoSpace@16
MmMapLockedPages=MmMapLockedPages@8
MmMapMemoryDumpMdl=MmMapMemoryDumpMdl@4
MmMapVideoDisplay=MmMapVideoDisplay@16
MmMapViewInSystemSpace=MmMapViewInSystemSpace@12
MmMapViewOfSection=MmMapViewOfSection@40
MmPageEntireDriver=MmPageEntireDriver@4
MmProbeAndLockPages=MmProbeAndLockPages@12
MmQuerySystemSize=MmQuerySystemSize@0
MmResetDriverPaging=MmResetDriverPaging@4
MmSectionObjectType DATA
MmSecureVirtualMemory=MmSecureVirtualMemory@12
MmSetAddressRangeModified=MmSetAddressRangeModified@8
MmSetBankedSection=MmSetBankedSection@24
MmSizeOfMdl=MmSizeOfMdl@8
MmSystemRangeStart=MmSectionObjectType
MmUnlockPagableImageSection=MmUnlockPagableImageSection@4
MmUnlockPages=MmUnlockPages@4
MmUnmapIoSpace=MmUnmapIoSpace@8
MmUnmapLockedPages=MmUnmapLockedPages@8
MmUnmapVideoDisplay=MmUnmapVideoDisplay@8
MmUnmapViewInSystemSpace=MmUnmapViewInSystemSpace@4
MmUnmapViewOfSection=MmUnmapViewOfSection@8
MmUnsecureVirtualMemory=MmUnsecureVirtualMemory@4
MmUserProbeAddress DATA
NlsAnsiCodePage DATA
NlsLeadByteInfo DATA
NlsMbCodePageTag DATA
@ -654,6 +695,7 @@ IoGetCurrentIrpStackLocation
IoInitializeDpcRequest
IoMarkIrpPending
IoRequestDpc
MmGetSystemAddressForMdl
;
;
; exports from hal.dll