mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
- Actually it seems MmGetPhysicalMemoryRanges uses the MmPhysicalMemoryBlock, so go ahead and implement that function.
- Thanks to Matthieu Suiche (http://www.msuiche.net/2008/09/17/retrieving-mmphysicalmemoryblock-regardless-of-the-nt-version/). - Move physical.c into ARM3 and call it dynamic.c since these functions are for Dynamic Memory (Hotplug) for Server 2003. - Remove the old copyright header, as copy-pasting 5 DDK function definitions and rewriting them to say UNIMPLEMENTED isn't much of a copyright. svn path=/trunk/; revision=41649
This commit is contained in:
parent
b254273e3b
commit
e52bb6e5ac
3 changed files with 128 additions and 75 deletions
127
reactos/ntoskrnl/mm/ARM3/dynamic.c
Normal file
127
reactos/ntoskrnl/mm/ARM3/dynamic.c
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Kernel
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: ntoskrnl/mm/ARM3/dynamic.c
|
||||||
|
* PURPOSE: ARM Memory Manager Dynamic Physical Memory Support
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *******************************************************************/
|
||||||
|
|
||||||
|
#include <ntoskrnl.h>
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#line 15 "ARM³::DYNAMIC"
|
||||||
|
#define MODULE_INVOLVED_IN_ARM3
|
||||||
|
#include "../ARM3/miarm.h"
|
||||||
|
|
||||||
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MmAddPhysicalMemory (IN PPHYSICAL_ADDRESS StartAddress,
|
||||||
|
IN OUT PLARGE_INTEGER NumberOfBytes)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MmMarkPhysicalMemoryAsBad(IN PPHYSICAL_ADDRESS StartAddress,
|
||||||
|
IN OUT PLARGE_INTEGER NumberOfBytes)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MmMarkPhysicalMemoryAsGood(IN PPHYSICAL_ADDRESS StartAddress,
|
||||||
|
IN OUT PLARGE_INTEGER NumberOfBytes)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MmRemovePhysicalMemory(IN PPHYSICAL_ADDRESS StartAddress,
|
||||||
|
IN OUT PLARGE_INTEGER NumberOfBytes)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
PPHYSICAL_MEMORY_RANGE
|
||||||
|
NTAPI
|
||||||
|
MmGetPhysicalMemoryRanges(VOID)
|
||||||
|
{
|
||||||
|
ULONG Size, i;
|
||||||
|
PPHYSICAL_MEMORY_RANGE Entry, Buffer;
|
||||||
|
KIRQL OldIrql;
|
||||||
|
ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Calculate how much memory we'll need
|
||||||
|
//
|
||||||
|
Size = sizeof(PHYSICAL_MEMORY_RANGE) * (MmPhysicalMemoryBlock->NumberOfRuns + 1);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allocate a copy
|
||||||
|
//
|
||||||
|
Entry = Buffer = ExAllocatePoolWithTag(NonPagedPool, Size, 'hPmM');
|
||||||
|
if (!Buffer) return NULL;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lock the PFN database
|
||||||
|
//
|
||||||
|
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Make sure it hasn't changed before we had acquired the lock
|
||||||
|
//
|
||||||
|
ASSERT(Size == (sizeof(PHYSICAL_MEMORY_RANGE) *
|
||||||
|
(MmPhysicalMemoryBlock->NumberOfRuns + 1)));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Now loop our block
|
||||||
|
//
|
||||||
|
for (i = 0; i < MmPhysicalMemoryBlock->NumberOfRuns; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Copy the data, but format it into bytes
|
||||||
|
//
|
||||||
|
Entry->BaseAddress.QuadPart = MmPhysicalMemoryBlock->Run[i].BasePage << PAGE_SHIFT;
|
||||||
|
Entry->NumberOfBytes.QuadPart = MmPhysicalMemoryBlock->Run[i].PageCount << PAGE_SHIFT;
|
||||||
|
Entry++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Last entry is empty
|
||||||
|
//
|
||||||
|
Entry->BaseAddress.QuadPart = 0;
|
||||||
|
Entry->NumberOfBytes.QuadPart = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Release the lock and return
|
||||||
|
//
|
||||||
|
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
|
||||||
|
return Buffer;
|
||||||
|
}
|
|
@ -1,74 +0,0 @@
|
||||||
/*
|
|
||||||
* PROJECT: ReactOS Kernel
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: ntoskrnl/mm/physical.c
|
|
||||||
* PURPOSE: Physical Memory Manipulation Routines
|
|
||||||
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
|
||||||
|
|
||||||
#include <ntoskrnl.h>
|
|
||||||
#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmAddPhysicalMemory (IN PPHYSICAL_ADDRESS StartAddress,
|
|
||||||
IN OUT PLARGE_INTEGER NumberOfBytes)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmMarkPhysicalMemoryAsBad(IN PPHYSICAL_ADDRESS StartAddress,
|
|
||||||
IN OUT PLARGE_INTEGER NumberOfBytes)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmMarkPhysicalMemoryAsGood(IN PPHYSICAL_ADDRESS StartAddress,
|
|
||||||
IN OUT PLARGE_INTEGER NumberOfBytes)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmRemovePhysicalMemory(IN PPHYSICAL_ADDRESS StartAddress,
|
|
||||||
IN OUT PLARGE_INTEGER NumberOfBytes)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
PPHYSICAL_MEMORY_RANGE
|
|
||||||
NTAPI
|
|
||||||
MmGetPhysicalMemoryRanges(VOID)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -360,6 +360,7 @@
|
||||||
</directory>
|
</directory>
|
||||||
</if>
|
</if>
|
||||||
<directory name="ARM3">
|
<directory name="ARM3">
|
||||||
|
<file>dynamic.c</file>
|
||||||
<file>hypermap.c</file>
|
<file>hypermap.c</file>
|
||||||
<file>init.c</file>
|
<file>init.c</file>
|
||||||
<file>iosup.c</file>
|
<file>iosup.c</file>
|
||||||
|
@ -384,7 +385,6 @@
|
||||||
<file>pagefile.c</file>
|
<file>pagefile.c</file>
|
||||||
<file>pageop.c</file>
|
<file>pageop.c</file>
|
||||||
<file>pe.c</file>
|
<file>pe.c</file>
|
||||||
<file>physical.c</file>
|
|
||||||
<file>pool.c</file>
|
<file>pool.c</file>
|
||||||
<file>ppool.c</file>
|
<file>ppool.c</file>
|
||||||
<file>procsup.c</file>
|
<file>procsup.c</file>
|
||||||
|
|
Loading…
Reference in a new issue