Author: ros-arm-bringup
Date: Thu Oct 15 19:01:31 2009
New Revision: 43481
URL:
http://svn.reactos.org/svn/reactos?rev=43481&view=rev
Log:
- Get rid of mm/mmsup.c and move some of the ROS-internal functions better where they
belong.
- Add ARM3/mmsup.c for miscellaneous function helper functions.
- Implemented:
- Move MmIsRecursiveIoFault, MmIsThisanNtAsSystem and MmQuerySystemSize. These belong
here.
- Unimplemented:
- Move MmSetBankedSection and fix the prototype. This should probably go somewhere else
later.
- Move MmAdjustWorkingSetSize and fix the prototype. This should probably go in
procsup.c later.
- Move MmMapUserAddressesToPage. This should also probably go in procsup.c later.
- Move MmSetAddressrangeModified and MmIsNonPagedsystemAddressValid. These should
probably go somewhere else later.
Added:
trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c (with props)
Removed:
trunk/reactos/ntoskrnl/mm/mmsup.c
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
trunk/reactos/ntoskrnl/mm/section.c
trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
Added: trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c (added)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c [iso-8859-1] Thu Oct 15 19:01:31 2009
@@ -1,0 +1,133 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
+ * FILE: ntoskrnl/mm/ARM3/mmsup.c
+ * PURPOSE: ARM Memory Manager Support Routines
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include <ntoskrnl.h>
+#define NDEBUG
+#include <debug.h>
+
+#line 15 "ARM³::MMSUP"
+#define MODULE_INVOLVED_IN_ARM3
+#include "../ARM3/miarm.h"
+
+/* GLOBALS ********************************************************************/
+
+BOOLEAN IsThisAnNtAsSystem = FALSE;
+MM_SYSTEMSIZE MmSystemSize = MmSmallSystem;
+
+/* PUBLIC FUNCTIONS ***********************************************************/
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+MmMapUserAddressesToPage(IN PVOID BaseAddress,
+ IN SIZE_T NumberOfBytes,
+ IN PVOID PageAddress)
+{
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+MmAdjustWorkingSetSize(IN SIZE_T WorkingSetMinimumInBytes,
+ IN SIZE_T WorkingSetMaximumInBytes,
+ IN ULONG SystemCache,
+ IN BOOLEAN IncreaseOkay)
+{
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+MmSetAddressRangeModified(IN PVOID Address,
+ IN SIZE_T Length)
+{
+ UNIMPLEMENTED;
+ return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+MmIsNonPagedSystemAddressValid(IN PVOID VirtualAddress)
+{
+ DPRINT1("WARNING: %s returns bogus result\n", __FUNCTION__);
+ return MmIsAddressValid(VirtualAddress);
+}
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+MmSetBankedSection(IN HANDLE ProcessHandle,
+ IN PVOID VirtualAddress,
+ IN ULONG BankLength,
+ IN BOOLEAN ReadWriteBank,
+ IN PVOID BankRoutine,
+ IN PVOID Context)
+{
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+BOOLEAN
+NTAPI
+MmIsRecursiveIoFault(VOID)
+{
+ PETHREAD Thread = PsGetCurrentThread();
+
+ //
+ // If any of these is true, this is a recursive fault
+ //
+ return ((Thread->DisablePageFaultClustering) | (Thread->ForwardClusterOnly));
+}
+
+/*
+ * @implemented
+ */
+BOOLEAN
+NTAPI
+MmIsThisAnNtAsSystem(VOID)
+{
+ //
+ // Return if this is a server system
+ //
+ return IsThisAnNtAsSystem;
+}
+
+/*
+ * @implemented
+ */
+MM_SYSTEMSIZE
+NTAPI
+MmQuerySystemSize(VOID)
+{
+ //
+ // Return the low, medium or high memory system type
+ //
+ return MmSystemSize;
+}
+
+/* EOF */
Propchange: trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Thu Oct 15 19:01:31 2009
@@ -1079,6 +1079,25 @@
NTSTATUS
NTAPI
+MiZeroPage(PFN_TYPE Page)
+{
+ KIRQL Irql;
+ PVOID TempAddress;
+
+ Irql = KeRaiseIrqlToDpcLevel();
+ TempAddress = MiMapPageToZeroInHyperSpace(Page);
+ if (TempAddress == NULL)
+ {
+ return(STATUS_NO_MEMORY);
+ }
+ memset(TempAddress, 0, PAGE_SIZE);
+ MiUnmapPagesInZeroSpace(TempAddress, 1);
+ KeLowerIrql(Irql);
+ return(STATUS_SUCCESS);
+}
+
+NTSTATUS
+NTAPI
MmZeroPageThreadMain(PVOID Ignored)
{
NTSTATUS Status;
Removed: trunk/reactos/ntoskrnl/mm/mmsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmsup.c?rev=43…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mmsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mmsup.c (removed)
@@ -1,145 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top directory
- * PROJECT: ReactOS kernel
- * FILE: ntoskrnl/mm/mmsup.c
- * PURPOSE: Kernel memory managment functions
- * PROGRAMMERS: David Welch (welch(a)cwcom.net)
- */
-
-/* INCLUDES *******************************************************************/
-
-#include <ntoskrnl.h>
-#define NDEBUG
-#include <debug.h>
-
-/* GLOBALS ********************************************************************/
-
-BOOLEAN IsThisAnNtAsSystem = FALSE;
-MM_SYSTEMSIZE MmSystemSize = MmSmallSystem;
-
-/* PRIVATE FUNCTIONS **********************************************************/
-
-NTSTATUS
-NTAPI
-MiZeroPage(PFN_TYPE Page)
-{
- KIRQL Irql;
- PVOID TempAddress;
-
- Irql = KeRaiseIrqlToDpcLevel();
- TempAddress = MiMapPageToZeroInHyperSpace(Page);
- if (TempAddress == NULL)
- {
- return(STATUS_NO_MEMORY);
- }
- memset(TempAddress, 0, PAGE_SIZE);
- MiUnmapPagesInZeroSpace(TempAddress, 1);
- KeLowerIrql(Irql);
- return(STATUS_SUCCESS);
-}
-
-NTSTATUS
-NTAPI
-MiCopyFromUserPage(PFN_TYPE DestPage, PVOID SourceAddress)
-{
- PEPROCESS Process;
- KIRQL Irql;
- PVOID TempAddress;
-
- Process = PsGetCurrentProcess();
- TempAddress = MiMapPageInHyperSpace(Process, DestPage, &Irql);
- if (TempAddress == NULL)
- {
- return(STATUS_NO_MEMORY);
- }
- memcpy(TempAddress, SourceAddress, PAGE_SIZE);
- MiUnmapPageInHyperSpace(Process, TempAddress, Irql);
- return(STATUS_SUCCESS);
-}
-
-/* PRIVATE FUNCTIONS **********************************************************/
-
-/* Miscellanea functions: they may fit somewhere else */
-
-/*
- * @implemented
- */
-BOOLEAN
-NTAPI
-MmIsRecursiveIoFault (VOID)
-{
- PETHREAD Thread = PsGetCurrentThread();
-
- return (Thread->DisablePageFaultClustering | Thread->ForwardClusterOnly);
-}
-
-/*
- * @unimplemented
- */
-NTSTATUS
-NTAPI
-MmMapUserAddressesToPage(IN PVOID BaseAddress,
- IN SIZE_T NumberOfBytes,
- IN PVOID PageAddress)
-{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
-}
-
-/*
- * @unimplemented
- */
-ULONG NTAPI
-MmAdjustWorkingSetSize (ULONG Unknown0,
- ULONG Unknown1,
- ULONG Unknown2,
- ULONG Unknown3)
-{
- UNIMPLEMENTED;
- return (0);
-}
-
-/*
- * @unimplemented
- */
-BOOLEAN
-NTAPI
-MmSetAddressRangeModified (
- IN PVOID Address,
- IN ULONG Length
-)
-{
- UNIMPLEMENTED;
- return (FALSE);
-}
-
-/*
- * @implemented
- */
-BOOLEAN NTAPI MmIsNonPagedSystemAddressValid(PVOID VirtualAddress)
-{
- DPRINT1("WARNING: %s returns bogus result\n", __FUNCTION__);
- return MmIsAddressValid(VirtualAddress);
-}
-
-/*
- * @implemented
- */
-BOOLEAN
-NTAPI
-MmIsThisAnNtAsSystem(VOID)
-{
- return IsThisAnNtAsSystem;
-}
-
-/*
- * @implemented
- */
-MM_SYSTEMSIZE
-NTAPI
-MmQuerySystemSize(VOID)
-{
- return MmSystemSize;
-}
-
-/* EOF */
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Thu Oct 15 19:01:31 2009
@@ -572,6 +572,25 @@
}
}
return FALSE;
+}
+
+NTSTATUS
+NTAPI
+MiCopyFromUserPage(PFN_TYPE DestPage, PVOID SourceAddress)
+{
+ PEPROCESS Process;
+ KIRQL Irql;
+ PVOID TempAddress;
+
+ Process = PsGetCurrentProcess();
+ TempAddress = MiMapPageInHyperSpace(Process, DestPage, &Irql);
+ if (TempAddress == NULL)
+ {
+ return(STATUS_NO_MEMORY);
+ }
+ memcpy(TempAddress, SourceAddress, PAGE_SIZE);
+ MiUnmapPageInHyperSpace(Process, TempAddress, Irql);
+ return(STATUS_SUCCESS);
}
NTSTATUS
@@ -4941,22 +4960,6 @@
return STATUS_NOT_IMPLEMENTED;
}
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-MmSetBankedSection (ULONG Unknown0,
- ULONG Unknown1,
- ULONG Unknown2,
- ULONG Unknown3,
- ULONG Unknown4,
- ULONG Unknown5)
-{
- UNIMPLEMENTED;
- return (STATUS_NOT_IMPLEMENTED);
-}
-
-
/**********************************************************************
* NAME EXPORTED
* MmCreateSection@
Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Thu Oct 15 19:01:31 2009
@@ -390,6 +390,7 @@
<file>hypermap.c</file>
<file>iosup.c</file>
<file>mdlsup.c</file>
+ <file>mmsup.c</file>
<file>ncache.c</file>
<file>pool.c</file>
<file>procsup.c</file>
@@ -402,7 +403,6 @@
<file>freelist.c</file>
<file>marea.c</file>
<file>mmfault.c</file>
- <file>mmsup.c</file>
<file>mminit.c</file>
<file>mpw.c</file>
<file>pagefile.c</file>