Move some profile stuff to NDK and fix some bugs in the executive implementation...
[reactos.git] / reactos / ntoskrnl / mm / kmap.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/mm/kmap.c
6 * PURPOSE: Implements the kernel memory pool
7 *
8 * PROGRAMMERS: David Welch (welch@cwcom.net)
9 */
10
11 /* INCLUDES ****************************************************************/
12
13 #include <ntoskrnl.h>
14 #define NDEBUG
15 #include <internal/debug.h>
16
17 /* GLOBALS *****************************************************************/
18
19 /* FUNCTIONS ***************************************************************/
20 NTSTATUS
21 NTAPI
22 MiZeroPage(PFN_TYPE Page)
23 {
24 PVOID TempAddress;
25
26 TempAddress = MmCreateHyperspaceMapping(Page);
27 if (TempAddress == NULL)
28 {
29 return(STATUS_NO_MEMORY);
30 }
31 memset(TempAddress, 0, PAGE_SIZE);
32 MmDeleteHyperspaceMapping(TempAddress);
33 return(STATUS_SUCCESS);
34 }
35
36 NTSTATUS
37 NTAPI
38 MiCopyFromUserPage(PFN_TYPE DestPage, PVOID SourceAddress)
39 {
40 PVOID TempAddress;
41
42 TempAddress = MmCreateHyperspaceMapping(DestPage);
43 if (TempAddress == NULL)
44 {
45 return(STATUS_NO_MEMORY);
46 }
47 memcpy(TempAddress, SourceAddress, PAGE_SIZE);
48 MmDeleteHyperspaceMapping(TempAddress);
49 return(STATUS_SUCCESS);
50 }
51