Rev 2323 | Rev 2349 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2323 | Rev 2339 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | #include "types.h" |
42 | #include "types.h" |
43 | #endif |
43 | #endif |
44 | 44 | ||
45 | 45 | ||
46 | /** Frame width. */ |
46 | /** Frame width. */ |
47 | #define FRAME_WIDTH 12 /* 4KB frames */ |
47 | #define FRAME_WIDTH 20 /* 4KB frames */ |
48 | 48 | ||
49 | /** Frame size. */ |
49 | /** Frame size. */ |
50 | #define FRAME_SIZE (1 << FRAME_WIDTH) |
50 | #define FRAME_SIZE (1 << FRAME_WIDTH) |
51 | 51 | ||
52 | /** Page size in 2-level paging which is switched on later in the kernel initialization. */ |
52 | /** Page size in 2-level paging which is switched on later in the kernel initialization. */ |
53 | #define PAGE_SIZE FRAME_SIZE |
53 | #define PAGE_SIZE (1 << 12) |
54 | 54 | ||
55 | 55 | ||
56 | #ifndef __ASM__ |
56 | #ifndef __ASM__ |
57 | # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) |
57 | # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) |
58 | # define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) |
58 | # define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) |
Line 66... | Line 66... | ||
66 | #define PTL0_ENTRIES (1<<12) /* 4096 */ |
66 | #define PTL0_ENTRIES (1<<12) /* 4096 */ |
67 | 67 | ||
68 | /** Size of an entry in PTL0. */ |
68 | /** Size of an entry in PTL0. */ |
69 | #define PTL0_ENTRY_SIZE 4 |
69 | #define PTL0_ENTRY_SIZE 4 |
70 | 70 | ||
71 | /** Number of frames per 1MB section. */ |
- | |
72 | #define FRAMES_PER_SECTION ( ( 1 << 20 ) / FRAME_SIZE ) |
- | |
73 | - | ||
74 | /** Returns number of frame the address belongs to. */ |
71 | /** Returns number of frame the address belongs to. */ |
75 | #define ADDR2PFN( addr ) ( ((uintptr_t)(addr)) >> FRAME_WIDTH ) |
72 | #define ADDR2PFN( addr ) ( ((uintptr_t)(addr)) >> FRAME_WIDTH ) |
76 | 73 | ||
77 | /** Describes "section" page table entry (one-level paging with 1MB sized pages). */ |
74 | /** Describes "section" page table entry (one-level paging with 1MB sized pages). */ |
78 | #define PTE_DESCRIPTOR_SECTION 0x2 |
75 | #define PTE_DESCRIPTOR_SECTION 0x2 |