Author: ros-arm-bringup Date: Fri Oct 16 02:28:33 2009 New Revision: 43508
URL: http://svn.reactos.org/svn/reactos?rev=43508&view=rev Log: - Move some unimplemented Ex* Pool routines into ARM3's expool.c. - Move some unimplemented Mm* Pool routines into ARM3's pool.c.
Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c trunk/reactos/ntoskrnl/mm/ARM3/pool.c trunk/reactos/ntoskrnl/mm/pool.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/expool.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] Fri Oct 16 02:28:33 2009 @@ -15,6 +15,9 @@ #line 15 "ARM³::EXPOOL" #define MODULE_INVOLVED_IN_ARM3 #include "../ARM3/miarm.h" + +#undef ExAllocatePoolWithQuota +#undef ExAllocatePoolWithQuotaTag
/* GLOBALS ********************************************************************/
@@ -637,4 +640,67 @@ ExFreeArmPoolWithTag(P, 0); }
+/* + * @unimplemented + */ +SIZE_T +NTAPI +ExQueryPoolBlockSize(IN PVOID PoolBlock, + OUT PBOOLEAN QuotaCharged) +{ + // + // Not implemented + // + UNIMPLEMENTED; + return FALSE; +} + +/* + * @implemented + */ + +PVOID +NTAPI +ExAllocatePoolWithQuota(IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes) +{ + // + // Allocate the pool + // + return ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, 'enoN'); +} + +/* + * @implemented + */ +PVOID +NTAPI +ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag, + IN EX_POOL_PRIORITY Priority) +{ + // + // Allocate the pool + // + UNIMPLEMENTED; + return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); +} + +/* + * @implemented + */ +PVOID +NTAPI +ExAllocatePoolWithQuotaTag(IN POOL_TYPE PoolType, + IN ULONG NumberOfBytes, + IN ULONG Tag) +{ + // + // Allocate the pool + // + UNIMPLEMENTED; + return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); +} + /* EOF */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Fri Oct 16 02:28:33 2009 @@ -711,4 +711,44 @@ return NumberOfPages; }
+ +BOOLEAN +NTAPI +MiRaisePoolQuota(IN POOL_TYPE PoolType, + IN ULONG CurrentMaxQuota, + OUT PULONG NewMaxQuota) +{ + // + // Not implemented + // + UNIMPLEMENTED; + *NewMaxQuota = CurrentMaxQuota + 65536; + return TRUE; +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * @unimplemented + */ +PVOID +NTAPI +MmAllocateMappingAddress(IN SIZE_T NumberOfBytes, + IN ULONG PoolTag) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @unimplemented + */ +VOID +NTAPI +MmFreeMappingAddress(IN PVOID BaseAddress, + IN ULONG PoolTag) +{ + UNIMPLEMENTED; +} + /* EOF */
Modified: trunk/reactos/ntoskrnl/mm/pool.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pool.c?rev=4350... ============================================================================== --- trunk/reactos/ntoskrnl/mm/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/pool.c [iso-8859-1] Fri Oct 16 02:28:33 2009 @@ -165,79 +165,6 @@ return(Block); }
- -/* - * @implemented - */ -#undef ExAllocatePoolWithQuota -#undef ExAllocatePoolWithQuotaTag -PVOID NTAPI -ExAllocatePoolWithQuota (POOL_TYPE PoolType, ULONG NumberOfBytes) -{ - return(ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, TAG_NONE)); -} - -/* - * @implemented - */ -PVOID -NTAPI -ExAllocatePoolWithTagPriority( - IN POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag, - IN EX_POOL_PRIORITY Priority - ) -{ - /* Do the allocation */ - UNIMPLEMENTED; - return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); -} - -/* - * @implemented - */ -PVOID -NTAPI -ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType, - IN ULONG NumberOfBytes, - IN ULONG Tag) -{ - PEPROCESS Process; - PVOID Block; - - /* Allocate the Pool First */ - Block = EiAllocatePool(PoolType, - NumberOfBytes, - Tag, - &ExAllocatePoolWithQuotaTag); - - /* "Quota is not charged to the thread for allocations >= PAGE_SIZE" - OSR Docs */ - if (!(NumberOfBytes >= PAGE_SIZE)) - { - /* Get the Current Process */ - Process = PsGetCurrentProcess(); - - /* PsChargePoolQuota returns an exception, so this needs SEH */ - _SEH2_TRY - { - /* FIXME: Is there a way to get the actual Pool size allocated from the pool header? */ - PsChargePoolQuota(Process, - PoolType & PAGED_POOL_MASK, - NumberOfBytes); - } - _SEH2_EXCEPT((ExFreePool(Block), EXCEPTION_CONTINUE_SEARCH)) - { - /* Quota Exceeded and the caller had no SEH! */ - KeBugCheck(STATUS_QUOTA_EXCEEDED); - } - _SEH2_END; - } - - /* Return the allocated block */ - return Block; -} - /* * @implemented */ @@ -307,77 +234,4 @@ } }
-/* - * @unimplemented - */ -SIZE_T -NTAPI -ExQueryPoolBlockSize ( - IN PVOID PoolBlock, - OUT PBOOLEAN QuotaCharged - ) -{ - UNIMPLEMENTED; - return FALSE; -} - -/* - * @unimplemented - */ -PVOID -NTAPI -MmAllocateMappingAddress ( - IN SIZE_T NumberOfBytes, - IN ULONG PoolTag - ) -{ - UNIMPLEMENTED; - return 0; -} - - -/* - * @unimplemented - */ -VOID -NTAPI -MmFreeMappingAddress ( - IN PVOID BaseAddress, - IN ULONG PoolTag - ) -{ - UNIMPLEMENTED; -} - -BOOLEAN -NTAPI -MiRaisePoolQuota( - IN POOL_TYPE PoolType, - IN ULONG CurrentMaxQuota, - OUT PULONG NewMaxQuota - ) -{ - /* Different quota raises depending on the type (64K vs 512K) */ - if (PoolType == PagedPool) { - - /* Make sure that 4MB is still left */ - if ((MM_PAGED_POOL_SIZE >> 12) < ((MmPagedPoolSize + 4194304) >> 12)) { - return FALSE; - } - - /* Increase Paged Pool Quota by 512K */ - MmTotalPagedPoolQuota += 524288; - *NewMaxQuota = CurrentMaxQuota + 524288; - return TRUE; - - } else { /* Nonpaged Pool */ - - /* Check if we still have 200 pages free*/ - if (MmStats.NrFreePages < 200) return FALSE; - - *NewMaxQuota = CurrentMaxQuota + 65536; - return TRUE; - } -} - /* EOF */