:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / ntoskrnl / include / internal / i386 / mm.h
1 /*
2  * Lowlevel memory managment definitions
3  */
4
5 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H
6 #define __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H
7
8 struct _EPROCESS;
9
10 #if 0
11 /*
12  * Page access attributes (or these together)
13  */
14 #define PA_READ            (1<<0)
15 #define PA_WRITE           ((1<<0)+(1<<1)) 
16 #define PA_EXECUTE         PA_READ
17 #define PA_PCD             (1<<4)
18 #define PA_PWT             (1<<3)
19
20 /*
21  * Page attributes
22  */
23 #define PA_USER            (1<<2)
24 #define PA_SYSTEM          (0)
25 #endif
26
27 #define PAGE_SIZE (4096)
28
29 PULONG MmGetPageEntry(PVOID Address);
30
31 #define KERNEL_BASE        (0xc0000000)
32
33 #define FLUSH_TLB    __asm__("movl %cr3,%eax\n\tmovl %eax,%cr3\n\t")
34
35 PULONG MmGetPageDirectory(VOID);
36
37 #if 0
38 extern inline PULONG get_page_directory(void)
39 {
40         unsigned int page_dir=0;
41         __asm__("movl %%cr3,%0\n\t"
42                 : "=r" (page_dir));
43         return((PULONG)page_dir);
44 }
45 #endif
46
47
48 /*
49  * Amount of memory that can be mapped by a page table
50  */
51 #define PAGE_TABLE_SIZE (4*1024*1024)
52
53 #define PAGE_MASK(x) (x&(~0xfff))
54 #define VADDR_TO_PT_OFFSET(x)  (((x/1024)%4096))
55 #define VADDR_TO_PD_OFFSET(x)  ((x)/(4*1024*1024))
56
57 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H */