Changeset 720db0c in mainline for kernel/arch/ia32/src/mm/frame.c
- Timestamp:
- 2010-06-26T23:00:54Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68667ce
- Parents:
- cae5404
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/mm/frame.c
rcae5404 r720db0c 47 47 #include <print.h> 48 48 49 #define PHYSMEM_LIMIT 0x7C000000 49 #define PHYSMEM_LIMIT 0x7C000000ull 50 50 51 51 size_t hardcoded_unmapped_ktext_size = 0; … … 88 88 #endif 89 89 90 pfn_t pfn;91 size_t count;92 93 90 if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) { 94 /* To be safe, make available zone possibly smaller */ 95 pfn = ADDR2PFN(ALIGN_UP(base, FRAME_SIZE)); 96 count = SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)); 91 /* To be safe, make the available zone possibly smaller */ 92 uint64_t new_base = ALIGN_UP(base, FRAME_SIZE); 93 uint64_t new_size = ALIGN_DOWN(size - (new_base - base), 94 FRAME_SIZE); 95 96 pfn_t pfn = ADDR2PFN(new_base); 97 size_t count = SIZE2FRAMES(new_size); 97 98 98 99 pfn_t conf; … … 105 106 106 107 // XXX this has to be removed 107 if (last_frame < ALIGN_UP( base +size, FRAME_SIZE))108 last_frame = ALIGN_UP( base +size, FRAME_SIZE);108 if (last_frame < ALIGN_UP(new_base + new_size, FRAME_SIZE)) 109 last_frame = ALIGN_UP(new_base + new_size, FRAME_SIZE); 109 110 } 110 111 111 112 if (e820table[i].type == MEMMAP_MEMORY_RESERVED) { 112 /* To be safe, make reserved zone possibly larger */ 113 pfn = ADDR2PFN(ALIGN_DOWN(base, FRAME_SIZE)); 114 count = SIZE2FRAMES(ALIGN_UP(size, FRAME_SIZE)); 113 /* To be safe, make the reserved zone possibly larger */ 114 uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE); 115 uint64_t new_size = ALIGN_UP(size + (base - new_base), 116 FRAME_SIZE); 115 117 116 zone_create(pfn, count, 0, ZONE_RESERVED); 118 zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0, 119 ZONE_RESERVED); 117 120 } 118 121 119 122 if (e820table[i].type == MEMMAP_MEMORY_ACPI) { 120 /* To be safe, make firmware zone possibly larger */ 121 pfn = ADDR2PFN(ALIGN_DOWN(base, (uintptr_t) FRAME_SIZE)); 122 count = SIZE2FRAMES(ALIGN_UP(size, (uintptr_t) FRAME_SIZE)); 123 /* To be safe, make the firmware zone possibly larger */ 124 uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE); 125 uint64_t new_size = ALIGN_UP(size + (base - new_base), 126 FRAME_SIZE); 123 127 124 zone_create(pfn, count, 0, ZONE_FIRMWARE); 128 zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0, 129 ZONE_FIRMWARE); 125 130 } 126 131 }
Note:
See TracChangeset
for help on using the changeset viewer.