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