Changeset 80d301ab in mainline for kernel/arch/amd64/src/mm/page.c
- Timestamp:
- 2011-11-17T12:45:37Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9d4e170
- Parents:
- ce940da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/mm/page.c
rce940da r80d301ab 46 46 #include <panic.h> 47 47 #include <align.h> 48 #include <macros.h> 48 49 49 50 void page_arch_init(void) 50 51 { 51 if (config.cpu_active == 1) { 52 uintptr_t cur; 53 unsigned int identity_flags = 54 PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL | PAGE_WRITE; 52 if (config.cpu_active > 1) { 53 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 54 return; 55 } 56 57 uintptr_t cur; 58 unsigned int identity_flags = 59 PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL | PAGE_WRITE; 55 60 56 61 page_mapping_operations = &pt_mapping_operations; 57 62 58 63 page_table_lock(AS_KERNEL, true); 59 64 60 /* 61 * PA2KA(identity) mapping for all frames. 62 */ 63 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) 64 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, identity_flags); 65 /* 66 * PA2KA(identity) mapping for all frames. 67 */ 68 for (cur = 0; cur < min(config.identity_size, last_frame); 69 cur += FRAME_SIZE) 70 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, identity_flags); 65 71 66 72 page_table_unlock(AS_KERNEL, true); 67 73 68 exc_register(14, "page_fault", true, (iroutine_t) page_fault); 69 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 70 } else 71 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 74 exc_register(14, "page_fault", true, (iroutine_t) page_fault); 75 write_cr3((uintptr_t) AS_KERNEL->genarch.page_table); 72 76 } 73 77
Note:
See TracChangeset
for help on using the changeset viewer.