Author: jimtabor
Date: Mon Jul 13 09:00:17 2009
New Revision: 41939
URL: http://svn.reactos.org/svn/reactos?rev=41939&view=rev
Log:
- Half-implement MmPageEntireDriver and use it to set the module instance for win32k. ATM, it does not set the entry pageable.
- I mean no disrespect to the Arm developers, I'm an admire of your great work with ReactOS! By my commits you can see the need for the offset address when calling internal procs in win32k.
- References: MmPageEntireDriver, http://www.osronline.com/ddkx/kmarch/k106_7os2.htm
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] Mon Jul 13 09:00:17 2009
@@ -119,7 +119,8 @@
//
// We should find the driver loader entry and return its base address
//
- UNIMPLEMENTED;
+ PLDR_DATA_TABLE_ENTRY pLdrDataTabEntry = MiLookupDataTableEntry(AddressWithinSection);
+ if (pLdrDataTabEntry) return pLdrDataTabEntry->DllBase;
return NULL;
}
Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ma…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] Mon Jul 13 09:00:17 2009
@@ -26,6 +26,8 @@
#define NDEBUG
#include <debug.h>
+
+HANDLE hModuleWin;
PGDI_HANDLE_TABLE INTERNAL_CALL GDIOBJ_iAllocHandleTable(OUT PSECTION_OBJECT *SectionObject);
BOOL INTERNAL_CALL GDI_CleanupForProcess (struct _EPROCESS *Process);
@@ -387,6 +389,8 @@
return STATUS_UNSUCCESSFUL;
}
+ hModuleWin = MmPageEntireDriver(DriverEntry);
+
/*
* Register Object Manager Callbacks
*/
Author: ros-arm-bringup
Date: Sun Jul 12 17:02:05 2009
New Revision: 41933
URL: http://svn.reactos.org/svn/reactos?rev=41933&view=rev
Log:
- Implement the rest of the nonpaged pool allocator, now with support for allocating pages in the nonpaged pool expansion area.
- This uses System PTEs, so if you're still not sick of the same old mantra -- optimizations to the former will help the latter.
- Additionally, we should eventually implement a single-page SLIST for nonpaged pool pages, which will greately improve allocate/free of 1 page.
- As a reminder, this code isn't being used yet.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/pool.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Sun Jul 12 17:02:05 2009
@@ -130,11 +130,12 @@
MiAllocatePoolPages(IN POOL_TYPE PoolType,
IN SIZE_T SizeInBytes)
{
- PFN_NUMBER SizeInPages;
+ PFN_NUMBER SizeInPages, PageFrameNumber;
ULONG i;
KIRQL OldIrql;
PLIST_ENTRY NextEntry, NextHead, LastHead;
- PMMPTE PointerPte;
+ PMMPTE PointerPte, StartPte;
+ MMPTE TempPte;
PMMPFN Pfn1;
PVOID BaseVa;
PMMFREE_POOL_ENTRY FreeEntry;
@@ -258,13 +259,78 @@
// If we got here, we're out of space.
// Start by releasing the lock
//
- KeReleaseQueuedSpinLock (LockQueueMmNonPagedPoolLock, OldIrql);
-
- //
- // We should now go into expansion nonpaged pool
- //
- DPRINT1("Out of NP Pool\n");
- return NULL;
+ KeReleaseQueuedSpinLock(LockQueueMmNonPagedPoolLock, OldIrql);
+
+ //
+ // Allocate some system PTEs
+ //
+ StartPte = MiReserveSystemPtes(SizeInPages, NonPagedPoolExpansion);
+ PointerPte = StartPte;
+ if (StartPte == NULL)
+ {
+ //
+ // Ran out of memory
+ //
+ DPRINT1("Out of NP Expansion Pool\n");
+ return NULL;
+ }
+
+ //
+ // Acquire the pool lock now
+ //
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMmNonPagedPoolLock);
+
+ //
+ // Lock the PFN database too
+ //
+ //KeAcquireQueuedSpinLockAtDpcLevel(LockQueuePfnLock);
+
+ //
+ // Loop the pages
+ //
+ TempPte = HyperTemplatePte;
+ do
+ {
+ //
+ // Allocate a page
+ //
+ PageFrameNumber = MmAllocPage(MC_NPPOOL, 0);
+
+ //
+ // Get the PFN entry for it
+ //
+ Pfn1 = MiGetPfnEntry(PageFrameNumber);
+
+ //
+ // Write the PTE for it
+ //
+ TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
+ ASSERT(PointerPte->u.Hard.Valid == 0);
+ ASSERT(TempPte.u.Hard.Valid == 1);
+ *PointerPte++ = TempPte;
+ } while (--SizeInPages > 0);
+
+ //
+ // This is the last page
+ //
+ Pfn1->u3.e1.EndOfAllocation = 1;
+
+ //
+ // Get the first page and mark it as such
+ //
+ Pfn1 = MiGetPfnEntry(StartPte->u.Hard.PageFrameNumber);
+ Pfn1->u3.e1.StartOfAllocation = 1;
+
+ //
+ // Release the PFN and nonpaged pool lock
+ //
+ //KeReleaseQueuedSpinLockFromDpcLevel(LockQueuePfnLock);
+ KeReleaseQueuedSpinLock(LockQueueMmNonPagedPoolLock, OldIrql);
+
+ //
+ // Return the address
+ //
+ return MiPteToAddress(StartPte);
}
ULONG
Author: ros-arm-bringup
Date: Sun Jul 12 17:00:19 2009
New Revision: 41932
URL: http://svn.reactos.org/svn/reactos?rev=41932&view=rev
Log:
- Stop excercising the nonpaged pool allocator since there have been no complaints and internal testing has revealed no faults.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/init.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/init.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/init.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/init.c [iso-8859-1] Sun Jul 12 17:00:19 2009
@@ -718,7 +718,7 @@
//
// Do a little test of the nonpaged pool allocator
//
- if (1)
+ if (0)
{
ULONG i = 0;
PVOID Buffers[4096];