Author: sir_richard
Date: Wed May 12 20:36:15 2010
New Revision: 47173
URL: http://svn.reactos.org/svn/reactos?rev=47173&view=rev
Log:
[NTOS]: Compute MiHighestUserPte, MiHighestUserPde, MiSessionImagePteStart, MiSessionImagePteEnd, MiSessionBasePte, MiSessionLastPte since these internal variables did not exit yet. Useful for debugging and also future PFN support. Just computes some values, no behavior changes.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Wed May 12 20:36:15 2010
@@ -136,6 +136,14 @@
ULONG MmSessionPoolSize;
ULONG MmSessionImageSize;
+/*
+ * These are the PTE addresses of the boundaries carved out above
+ */
+PMMPTE MiSessionImagePteStart;
+PMMPTE MiSessionImagePteEnd;
+PMMPTE MiSessionBasePte;
+PMMPTE MiSessionLastPte;
+
//
// The system view space, on the other hand, is where sections that are memory
// mapped into "system space" end up.
@@ -217,6 +225,11 @@
PVOID MmHighestUserAddress;
PVOID MmSystemRangeStart;
+/* And these store the respective highest PTE/PDE address */
+PMMPTE MiHighestUserPte;
+PMMPDE MiHighestUserPde;
+
+/* These variables define the system cache address space */
PVOID MmSystemCacheStart;
PVOID MmSystemCacheEnd;
MMSUPPORT MmSystemCacheWs;
@@ -1700,6 +1713,10 @@
MmUserProbeAddress = (ULONG_PTR)MmSystemRangeStart - 0x10000;
MmHighestUserAddress = (PVOID)(MmUserProbeAddress - 1);
+ /* Highest PTE and PDE based on the addresses above */
+ MiHighestUserPte = MiAddressToPte(MmHighestUserAddress);
+ MiHighestUserPde = MiAddressToPde(MmHighestUserAddress);
+
//
// Get the size of the boot loader's image allocations and then round
// that region up to a PDE size, so that any PDEs we might create for
@@ -1772,7 +1789,12 @@
//
MiSystemViewStart = (PVOID)((ULONG_PTR)MmSessionBase -
MmSystemViewSize);
-
+
+ /* Compute the PTE addresses for all the addresses we carved out */
+ MiSessionImagePteStart = MiAddressToPte(MiSessionImageStart);
+ MiSessionImagePteEnd = MiAddressToPte(MiSessionImageEnd);
+ MiSessionBasePte = MiAddressToPte(MmSessionBase);
+ MiSessionLastPte = MiAddressToPte(MiSessionSpaceEnd);
/* Initialize the user mode image list */
InitializeListHead(&MmLoadedUserImageList);
Author: sir_richard
Date: Wed May 12 20:33:18 2010
New Revision: 47172
URL: http://svn.reactos.org/svn/reactos?rev=47172&view=rev
Log:
[NTOS]: MmSystemPageDirectory is an array of page directories, not just a value. On x86 there's just one page directory, but that's not the case on other architectures/PAE, so fix this bug.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c
trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/arm/init.…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c [iso-8859-1] Wed May 12 20:33:18 2010
@@ -41,7 +41,7 @@
ULONG MmSessionImageSize;
PVOID MiSystemViewStart;
ULONG MmSystemViewSize;
-PFN_NUMBER MmSystemPageDirectory;
+PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
PMMPTE MmSystemPagePtes;
ULONG MmNumberOfSystemPtes;
ULONG MxPfnAllocation;
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Wed May 12 20:33:18 2010
@@ -151,7 +151,7 @@
// map paged pool PDEs into external processes when they fault on a paged pool
// address.
//
-PFN_NUMBER MmSystemPageDirectory;
+PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
PMMPTE MmSystemPagePtes;
//
@@ -1483,7 +1483,8 @@
// Get the page frame number for the system page directory
//
PointerPte = MiAddressToPte(PDE_BASE);
- MmSystemPageDirectory = PFN_FROM_PTE(PointerPte);
+ ASSERT(PD_COUNT == 1);
+ MmSystemPageDirectory[0] = PFN_FROM_PTE(PointerPte);
//
// Allocate a system PTE which will hold a copy of the page directory
@@ -1500,7 +1501,8 @@
// way).
//
TempPte = ValidKernelPte;
- TempPte.u.Hard.PageFrameNumber = MmSystemPageDirectory;
+ ASSERT(PD_COUNT == 1);
+ TempPte.u.Hard.PageFrameNumber = MmSystemPageDirectory[0];
ASSERT(PointerPte->u.Hard.Valid == 0);
ASSERT(TempPte.u.Hard.Valid == 1);
*PointerPte = TempPte;
Author: fireball
Date: Wed May 12 11:45:43 2010
New Revision: 47169
URL: http://svn.reactos.org/svn/reactos?rev=47169&view=rev
Log:
[HALX86]
- Revert changes to HalpGetPCIData made in r47162. There is no need to introduce ReactOS-specific behavior of this function. It's much better to aim real NT compatibility, and develop your drivers against NT first and only then hack ReactOS.
- Changes to buses scanning are left as they are.
Modified:
trunk/reactos/hal/halx86/generic/bus/pcibus.c
Modified: trunk/reactos/hal/halx86/generic/bus/pcibus.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/pci…
==============================================================================
--- trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] Wed May 12 11:45:43 2010
@@ -369,10 +369,6 @@
}
#endif
- /* Make sure the bus number is in our range of good bus numbers */
- if (BusHandler->BusNumber > HalpMaxPciBus || BusHandler->BusNumber < HalpMinPciBus)
- return 0;
-
/* Normalize the length */
if (Length > sizeof(PCI_COMMON_CONFIG)) Length = sizeof(PCI_COMMON_CONFIG);
@@ -394,15 +390,9 @@
/* Validate the vendor ID */
if (PciConfig->VendorID == PCI_INVALID_VENDORID)
{
- /* It's invalid, but we can copy PCI_INVALID_VENDORID */
- if (Offset == 0 && Length >= sizeof(USHORT))
- {
- *(PUSHORT)Buffer = PCI_INVALID_VENDORID;
- return sizeof(USHORT);
- }
-
- /* We can't copy PCI_INVALID_VENDORID so just return 0 */
- return 0;
+ /* It's invalid, but we want to return this much */
+ PciConfig->VendorID = PCI_INVALID_VENDORID;
+ Len = sizeof(USHORT);
}
/* Now check if there's space left */
@@ -464,10 +454,6 @@
return 0;
}
#endif
-
- /* Make sure this bus number is in our range of good bus numbers */
- if (BusHandler->BusNumber > HalpMaxPciBus || BusHandler->BusNumber < HalpMinPciBus)
- return 0;
/* Normalize the length */
if (Length > sizeof(PCI_COMMON_CONFIG)) Length = sizeof(PCI_COMMON_CONFIG);