From 92f6dfd7d4b1327a4daa77ed2cab0a0945f96680 Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Tue, 9 Feb 2010 02:14:20 +0000 Subject: [PATCH] [NTOS]: Tabula rasa (clean slate) on the old-MM page routines for ARM. Get rid of all of them for now. [NTOS]: Implement MmInitGlobalKernelPageDirectory as the first ARM page function in the new file. That's it for the kernel. svn path=/trunk/; revision=45515 --- reactos/ntoskrnl/mm/arm/page.c | 285 +++++++++++++++++++++++ reactos/ntoskrnl/ntoskrnl-generic.rbuild | 2 +- 2 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 reactos/ntoskrnl/mm/arm/page.c diff --git a/reactos/ntoskrnl/mm/arm/page.c b/reactos/ntoskrnl/mm/arm/page.c new file mode 100644 index 00000000000..30969fd5c87 --- /dev/null +++ b/reactos/ntoskrnl/mm/arm/page.c @@ -0,0 +1,285 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: ntoskrnl/mm/arm/page.c + * PURPOSE: Old-school Page Management + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS ********************************************************************/ + +ULONG MmGlobalKernelPageDirectory[4096]; +//MMPTE MiArmTemplatePte, MiArmTemplatePde; + +/* PRIVATE FUNCTIONS **********************************************************/ + +VOID +NTAPI +MiFlushTlb(IN PMMPTE PointerPte, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); +} + +BOOLEAN +NTAPI +MmCreateProcessAddressSpace(IN ULONG MinWs, + IN PEPROCESS Process, + IN PULONG DirectoryTableBase) +{ + UNIMPLEMENTED; + while (TRUE); + return FALSE; +} + +VOID +NTAPI +MmUpdatePageDir(IN PEPROCESS Process, + IN PVOID Address, + IN ULONG Size) +{ + /* Nothing to do */ + return; +} + +NTSTATUS +NTAPI +Mmi386ReleaseMmInfo(IN PEPROCESS Process) +{ + UNIMPLEMENTED; + while (TRUE); + return 0; +} + +NTSTATUS +NTAPI +MmInitializeHandBuiltProcess(IN PEPROCESS Process, + IN PULONG DirectoryTableBase) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + +PULONG +NTAPI +MmGetPageDirectory(VOID) +{ + /* Return the TTB */ + return (PULONG)KeArmTranslationTableRegisterGet().AsUlong; +} + +VOID +NTAPI +MmDisableVirtualMapping(IN PEPROCESS Process, + IN PVOID Address, + OUT PBOOLEAN WasDirty, + OUT PPFN_TYPE Page) +{ + UNIMPLEMENTED; + while (TRUE); +} + +VOID +NTAPI +MmEnableVirtualMapping(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); +} + +NTSTATUS +NTAPI +MmCreateVirtualMappingUnsafe(IN PEPROCESS Process, + IN PVOID Address, + IN ULONG Protection, + IN PPFN_TYPE Pages, + IN ULONG PageCount) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +MmCreateVirtualMapping(IN PEPROCESS Process, + IN PVOID Address, + IN ULONG Protection, + IN PPFN_TYPE Pages, + IN ULONG PageCount) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_SUCCESS; +} + +VOID +NTAPI +MmRawDeleteVirtualMapping(IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); +} + +VOID +NTAPI +MmDeleteVirtualMapping(IN PEPROCESS Process, + IN PVOID Address, + IN BOOLEAN FreePage, + OUT PBOOLEAN WasDirty, + OUT PPFN_TYPE Page) +{ + UNIMPLEMENTED; + while (TRUE); +} + +VOID +NTAPI +MmDeletePageFileMapping(IN PEPROCESS Process, + IN PVOID Address, + IN SWAPENTRY *SwapEntry) +{ + UNIMPLEMENTED; + while (TRUE); +} + +NTSTATUS +NTAPI +MmCreatePageFileMapping(IN PEPROCESS Process, + IN PVOID Address, + IN SWAPENTRY SwapEntry) +{ + UNIMPLEMENTED; + while (TRUE); + return 0; +} + +PFN_TYPE +NTAPI +MmGetPfnForProcess(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); + return 0; +} + +BOOLEAN +NTAPI +MmIsDirtyPage(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); + return 0; +} + +VOID +NTAPI +MmSetCleanPage(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); +} + +VOID +NTAPI +MmSetDirtyPage(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); +} + +BOOLEAN +NTAPI +MmIsPagePresent(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); + return FALSE; +} + +BOOLEAN +NTAPI +MmIsPageSwapEntry(IN PEPROCESS Process, + IN PVOID Address) +{ + UNIMPLEMENTED; + while (TRUE); + return FALSE; +} + +ULONG +NTAPI +MmGetPageProtect(IN PEPROCESS Process, + IN PVOID Address) +{ + /* We don't enforce any protection on the pages -- they are all RWX */ + return PAGE_READWRITE; +} + +VOID +NTAPI +MmSetPageProtect(IN PEPROCESS Process, + IN PVOID Address, + IN ULONG Protection) +{ + /* We don't enforce any protection on the pages -- they are all RWX */ + return; +} + +VOID +NTAPI +MmInitGlobalKernelPageDirectory(VOID) +{ + ULONG i; + PULONG CurrentPageDirectory = (PULONG)PDE_BASE; + extern MMPTE HyperTemplatePte; + + /* Setup template */ + HyperTemplatePte.u.Hard.Valid = HyperTemplatePte.u.Hard.Access = 1; + + /* Loop the 2GB of address space which belong to the kernel */ + for (i = MiGetPdeOffset(MmSystemRangeStart); i < 2048; i++) + { + /* Check if we have an entry for this already */ + if ((i != MiGetPdeOffset(PTE_BASE)) && + (i != MiGetPdeOffset(HYPER_SPACE)) && + (!MmGlobalKernelPageDirectory[i]) && + (CurrentPageDirectory[i])) + { + /* We don't, link it in our global page directory */ + MmGlobalKernelPageDirectory[i] = CurrentPageDirectory[i]; + } + } +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * @implemented + */ +PHYSICAL_ADDRESS +NTAPI +MmGetPhysicalAddress(IN PVOID Address) +{ + PHYSICAL_ADDRESS PhysicalAddress; + PhysicalAddress.QuadPart = 0; + + UNIMPLEMENTED; + while (TRUE); + + return PhysicalAddress; +} diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 1c6a6da7d53..2a308d433b5 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -365,7 +365,7 @@ - stubs.c + page.c