Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendynamic.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS Kernel 00003 * LICENSE: BSD - See COPYING.ARM in the top level directory 00004 * FILE: ntoskrnl/mm/ARM3/dynamic.c 00005 * PURPOSE: ARM Memory Manager Dynamic Physical Memory Support 00006 * PROGRAMMERS: ReactOS Portable Systems Group 00007 */ 00008 00009 /* INCLUDES *******************************************************************/ 00010 00011 #include <ntoskrnl.h> 00012 #define NDEBUG 00013 #include <debug.h> 00014 00015 #define MODULE_INVOLVED_IN_ARM3 00016 #include "../ARM3/miarm.h" 00017 00018 /* FUNCTIONS *****************************************************************/ 00019 00020 /* 00021 * @unimplemented 00022 */ 00023 NTSTATUS 00024 NTAPI 00025 MmAddPhysicalMemory (IN PPHYSICAL_ADDRESS StartAddress, 00026 IN OUT PLARGE_INTEGER NumberOfBytes) 00027 { 00028 UNIMPLEMENTED; 00029 return STATUS_NOT_IMPLEMENTED; 00030 } 00031 00032 /* 00033 * @unimplemented 00034 */ 00035 NTSTATUS 00036 NTAPI 00037 MmMarkPhysicalMemoryAsBad(IN PPHYSICAL_ADDRESS StartAddress, 00038 IN OUT PLARGE_INTEGER NumberOfBytes) 00039 { 00040 UNIMPLEMENTED; 00041 return STATUS_NOT_IMPLEMENTED; 00042 } 00043 00044 /* 00045 * @unimplemented 00046 */ 00047 NTSTATUS 00048 NTAPI 00049 MmMarkPhysicalMemoryAsGood(IN PPHYSICAL_ADDRESS StartAddress, 00050 IN OUT PLARGE_INTEGER NumberOfBytes) 00051 { 00052 UNIMPLEMENTED; 00053 return STATUS_NOT_IMPLEMENTED; 00054 } 00055 00056 /* 00057 * @unimplemented 00058 */ 00059 NTSTATUS 00060 NTAPI 00061 MmRemovePhysicalMemory(IN PPHYSICAL_ADDRESS StartAddress, 00062 IN OUT PLARGE_INTEGER NumberOfBytes) 00063 { 00064 UNIMPLEMENTED; 00065 return STATUS_NOT_IMPLEMENTED; 00066 } 00067 00068 /* 00069 * @implemented 00070 */ 00071 PPHYSICAL_MEMORY_RANGE 00072 NTAPI 00073 MmGetPhysicalMemoryRanges(VOID) 00074 { 00075 ULONG Size, i; 00076 PPHYSICAL_MEMORY_RANGE Entry, Buffer; 00077 KIRQL OldIrql; 00078 ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); 00079 00080 // 00081 // Calculate how much memory we'll need 00082 // 00083 Size = sizeof(PHYSICAL_MEMORY_RANGE) * (MmPhysicalMemoryBlock->NumberOfRuns + 1); 00084 00085 // 00086 // Allocate a copy 00087 // 00088 Entry = Buffer = ExAllocatePoolWithTag(NonPagedPool, Size, 'hPmM'); 00089 if (!Buffer) return NULL; 00090 00091 // 00092 // Lock the PFN database 00093 // 00094 OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); 00095 00096 // 00097 // Make sure it hasn't changed before we had acquired the lock 00098 // 00099 ASSERT(Size == (sizeof(PHYSICAL_MEMORY_RANGE) * 00100 (MmPhysicalMemoryBlock->NumberOfRuns + 1))); 00101 00102 // 00103 // Now loop our block 00104 // 00105 for (i = 0; i < MmPhysicalMemoryBlock->NumberOfRuns; i++) 00106 { 00107 // 00108 // Copy the data, but format it into bytes 00109 // 00110 Entry->BaseAddress.QuadPart = MmPhysicalMemoryBlock->Run[i].BasePage << PAGE_SHIFT; 00111 Entry->NumberOfBytes.QuadPart = MmPhysicalMemoryBlock->Run[i].PageCount << PAGE_SHIFT; 00112 Entry++; 00113 } 00114 00115 // 00116 // Last entry is empty 00117 // 00118 Entry->BaseAddress.QuadPart = 0; 00119 Entry->NumberOfBytes.QuadPart = 0; 00120 00121 // 00122 // Release the lock and return 00123 // 00124 KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); 00125 return Buffer; 00126 } Generated on Fri May 25 2012 04:35:57 for ReactOS by
1.7.6.1
|