Changeset 93165be in mainline for arch/amd64/src/mm/page.c
- Timestamp:
- 2006-03-16T23:54:05Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5fceec7
- Parents:
- ff14c520
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/mm/page.c
rff14c520 r93165be 40 40 #include <print.h> 41 41 #include <panic.h> 42 #include <align.h> 42 43 43 44 /* Definitions for identity page mapper */ … … 71 72 SET_FRAME_FLAGS_ARCH(ptl3, PTL3_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \ 72 73 } 73 74 74 void page_arch_init(void) 75 75 { 76 76 __address cur; 77 int flags; 77 int i; 78 int identity_flags = PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL; 78 79 79 80 if (config.cpu_active == 1) { … … 84 85 */ 85 86 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { 86 flags = PAGE_CACHEABLE | PAGE_EXEC; 87 if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) 88 flags |= PAGE_GLOBAL; 89 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 87 /* Standard identity mapping */ 88 page_mapping_insert(AS_KERNEL, PA2KA_IDENT(cur), cur, identity_flags); 90 89 } 90 /* Upper kernel mapping 91 * - from zero to top of kernel (include bottom addresses 92 * because some are needed for init ) 93 */ 94 for (cur = PA2KA_CODE(0); cur < config.base+config.kernel_size; cur += FRAME_SIZE) { 95 page_mapping_insert(AS_KERNEL, cur, KA2PA(cur), identity_flags); 96 } 97 for (i=0; i < init.cnt; i++) { 98 for (cur=init.tasks[i].addr;cur < init.tasks[i].size; cur += FRAME_SIZE) { 99 page_mapping_insert(AS_KERNEL, PA2KA_CODE(KA2PA(cur)), KA2PA(cur), identity_flags); 100 } 101 } 102 91 103 exc_register(14, "page_fault", (iroutine)page_fault); 92 104 write_cr3((__address) AS_KERNEL->page_table);
Note:
See TracChangeset
for help on using the changeset viewer.