Rev 814 | Rev 1051 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 814 | Rev 825 | ||
|---|---|---|---|
| Line 39... | Line 39... | ||
| 39 | #include <interrupt.h> |
39 | #include <interrupt.h> |
| 40 | 40 | ||
| 41 | void page_arch_init(void) |
41 | void page_arch_init(void) |
| 42 | { |
42 | { |
| 43 | __address cur; |
43 | __address cur; |
| - | 44 | int flags; |
|
| 44 | 45 | ||
| 45 | if (config.cpu_active == 1) { |
46 | if (config.cpu_active == 1) { |
| 46 | page_mapping_operations = &pt_mapping_operations; |
47 | page_mapping_operations = &pt_mapping_operations; |
| 47 | 48 | ||
| 48 | /* |
49 | /* |
| 49 | * PA2KA(identity) mapping for all frames. |
50 | * PA2KA(identity) mapping for all frames. |
| 50 | */ |
51 | */ |
| 51 | for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { |
52 | for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { |
| - | 53 | flags = PAGE_CACHEABLE | PAGE_EXEC; |
|
| - | 54 | if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) |
|
| - | 55 | flags |= PAGE_GLOBAL; |
|
| 52 | page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE | PAGE_EXEC); |
56 | page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); |
| 53 | } |
57 | } |
| 54 | exc_register(14, "page_fault", (iroutine)page_fault); |
58 | exc_register(14, "page_fault", (iroutine)page_fault); |
| 55 | write_cr3((__address) AS_KERNEL->page_table); |
59 | write_cr3((__address) AS_KERNEL->page_table); |
| 56 | } |
60 | } |
| 57 | else { |
61 | else { |