mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
- Collapse MmInit1 into MmInitSystem.
- Check for ARM3-owned memory areas during a page fault, and crash the system as this shouldn't happen yet. - Use portable PTE macro instead of setting the owner bit directly, fixing an ARM port build issue. svn path=/trunk/; revision=43488
This commit is contained in:
parent
b452b0b30a
commit
3b34847f3e
3 changed files with 73 additions and 53 deletions
|
@ -157,6 +157,22 @@ extern PVOID MiSessionSpaceEnd;
|
||||||
extern ULONG MmSizeOfPagedPoolInBytes;
|
extern ULONG MmSizeOfPagedPoolInBytes;
|
||||||
extern PMMPTE MmSystemPagePtes;
|
extern PMMPTE MmSystemPagePtes;
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MmArmInitSystem(
|
||||||
|
IN ULONG Phase,
|
||||||
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock
|
||||||
|
);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MmArmAccessFault(
|
||||||
|
IN BOOLEAN StoreInstruction,
|
||||||
|
IN PVOID Address,
|
||||||
|
IN KPROCESSOR_MODE Mode,
|
||||||
|
IN PVOID TrapInformation
|
||||||
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
MiInitializeArmPool(
|
MiInitializeArmPool(
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#define MODULE_INVOLVED_IN_ARM3
|
||||||
|
#include "ARM3/miarm.h"
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS **********************************************************/
|
/* PRIVATE FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -256,6 +259,8 @@ MmAccessFault(IN BOOLEAN StoreInstruction,
|
||||||
IN KPROCESSOR_MODE Mode,
|
IN KPROCESSOR_MODE Mode,
|
||||||
IN PVOID TrapInformation)
|
IN PVOID TrapInformation)
|
||||||
{
|
{
|
||||||
|
PMEMORY_AREA MemoryArea;
|
||||||
|
|
||||||
/* Cute little hack for ROS */
|
/* Cute little hack for ROS */
|
||||||
if ((ULONG_PTR)Address >= (ULONG_PTR)MmSystemRangeStart)
|
if ((ULONG_PTR)Address >= (ULONG_PTR)MmSystemRangeStart)
|
||||||
{
|
{
|
||||||
|
@ -269,6 +274,20 @@ MmAccessFault(IN BOOLEAN StoreInstruction,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if this is an ARM3 memory area
|
||||||
|
//
|
||||||
|
MemoryArea = MmLocateMemoryAreaByAddress(MmGetKernelAddressSpace(), Address);
|
||||||
|
if ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Hand it off to more competent hands...
|
||||||
|
//
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
KeBugCheckEx(MEMORY_AREA_OWNED_BY_ARM3, Mode, (ULONG_PTR)Address, 0, 0);
|
||||||
|
//return MmArmAccessFault(StoreInstruction, Address, Mode, TrapInformation);
|
||||||
|
}
|
||||||
|
|
||||||
/* Keep same old ReactOS Behaviour */
|
/* Keep same old ReactOS Behaviour */
|
||||||
if (StoreInstruction)
|
if (StoreInstruction)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,6 @@ MM_STATS MmStats;
|
||||||
PMMPTE MmSharedUserDataPte;
|
PMMPTE MmSharedUserDataPte;
|
||||||
PMMSUPPORT MmKernelAddressSpace;
|
PMMSUPPORT MmKernelAddressSpace;
|
||||||
extern KMUTANT MmSystemLoadLock;
|
extern KMUTANT MmSystemLoadLock;
|
||||||
extern ULONG MmBootImageSize;
|
|
||||||
BOOLEAN MiDbgEnableMdDump =
|
BOOLEAN MiDbgEnableMdDump =
|
||||||
#ifdef _ARM_
|
#ifdef _ARM_
|
||||||
TRUE;
|
TRUE;
|
||||||
|
@ -313,55 +312,6 @@ MiDbgDumpMemoryDescriptors(VOID)
|
||||||
DPRINT1("Total: %08lX (%d MB)\n", TotalPages, (TotalPages * PAGE_SIZE) / 1024 / 1024);
|
DPRINT1("Total: %08lX (%d MB)\n", TotalPages, (TotalPages * PAGE_SIZE) / 1024 / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmArmInitSystem(IN ULONG Phase,
|
|
||||||
IN PLOADER_PARAMETER_BLOCK LoaderBlock);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
INIT_FUNCTION
|
|
||||||
NTAPI
|
|
||||||
MmInit1(VOID)
|
|
||||||
{
|
|
||||||
/* Initialize the kernel address space */
|
|
||||||
KeInitializeGuardedMutex(&PsGetCurrentProcess()->AddressCreationLock);
|
|
||||||
MmKernelAddressSpace = MmGetCurrentAddressSpace();
|
|
||||||
MmInitGlobalKernelPageDirectory();
|
|
||||||
|
|
||||||
/* Dump memory descriptors */
|
|
||||||
if (MiDbgEnableMdDump) MiDbgDumpMemoryDescriptors();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize ARM³ in phase 0
|
|
||||||
//
|
|
||||||
MmArmInitSystem(0, KeLoaderBlock);
|
|
||||||
|
|
||||||
/* Initialize the page list */
|
|
||||||
MmInitializePageList();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize ARM³ in phase 1
|
|
||||||
//
|
|
||||||
MmArmInitSystem(1, KeLoaderBlock);
|
|
||||||
|
|
||||||
/* Put the paged pool after the loaded modules */
|
|
||||||
MmPagedPoolBase = (PVOID)PAGE_ROUND_UP((ULONG_PTR)MmSystemRangeStart +
|
|
||||||
MmBootImageSize);
|
|
||||||
MmPagedPoolSize = MM_PAGED_POOL_SIZE;
|
|
||||||
|
|
||||||
/* Intialize system memory areas */
|
|
||||||
MiInitSystemMemoryAreas();
|
|
||||||
|
|
||||||
/* Dump the address space */
|
|
||||||
MiDbgDumpAddressSpace();
|
|
||||||
|
|
||||||
/* Initialize paged pool */
|
|
||||||
MmInitializePagedPool();
|
|
||||||
|
|
||||||
/* Initialize working sets */
|
|
||||||
MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
MmInitSystem(IN ULONG Phase,
|
MmInitSystem(IN ULONG Phase,
|
||||||
|
@ -374,8 +324,43 @@ MmInitSystem(IN ULONG Phase,
|
||||||
|
|
||||||
if (Phase == 0)
|
if (Phase == 0)
|
||||||
{
|
{
|
||||||
/* Initialize Mm bootstrap */
|
/* Initialize the kernel address space */
|
||||||
MmInit1();
|
KeInitializeGuardedMutex(&PsGetCurrentProcess()->AddressCreationLock);
|
||||||
|
MmKernelAddressSpace = MmGetCurrentAddressSpace();
|
||||||
|
MmInitGlobalKernelPageDirectory();
|
||||||
|
|
||||||
|
/* Dump memory descriptors */
|
||||||
|
if (MiDbgEnableMdDump) MiDbgDumpMemoryDescriptors();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialize ARM³ in phase 0
|
||||||
|
//
|
||||||
|
MmArmInitSystem(0, KeLoaderBlock);
|
||||||
|
|
||||||
|
/* Initialize the page list */
|
||||||
|
MmInitializePageList();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialize ARM³ in phase 1
|
||||||
|
//
|
||||||
|
MmArmInitSystem(1, KeLoaderBlock);
|
||||||
|
|
||||||
|
/* Put the paged pool after the loaded modules */
|
||||||
|
MmPagedPoolBase = (PVOID)PAGE_ROUND_UP((ULONG_PTR)MmSystemRangeStart +
|
||||||
|
MmBootImageSize);
|
||||||
|
MmPagedPoolSize = MM_PAGED_POOL_SIZE;
|
||||||
|
|
||||||
|
/* Intialize system memory areas */
|
||||||
|
MiInitSystemMemoryAreas();
|
||||||
|
|
||||||
|
/* Dump the address space */
|
||||||
|
MiDbgDumpAddressSpace();
|
||||||
|
|
||||||
|
/* Initialize paged pool */
|
||||||
|
MmInitializePagedPool();
|
||||||
|
|
||||||
|
/* Initialize working sets */
|
||||||
|
MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory);
|
||||||
|
|
||||||
/* Initialize the Loader Lock */
|
/* Initialize the Loader Lock */
|
||||||
KeInitializeMutant(&MmSystemLoadLock, FALSE);
|
KeInitializeMutant(&MmSystemLoadLock, FALSE);
|
||||||
|
@ -422,7 +407,7 @@ MmInitSystem(IN ULONG Phase,
|
||||||
//
|
//
|
||||||
// Now write a copy of it
|
// Now write a copy of it
|
||||||
//
|
//
|
||||||
TempPte.u.Hard.Owner = 1;
|
MI_MAKE_OWNER_PAGE(&TempPte);
|
||||||
TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
|
TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
|
||||||
*MmSharedUserDataPte = TempPte;
|
*MmSharedUserDataPte = TempPte;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue