Changeset 052da81 in mainline for generic/src/mm/frame.c
- Timestamp:
- 2006-02-18T14:40:15Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- daea4bf
- Parents:
- ede493e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/frame.c
rede493e r052da81 137 137 if (zones.count+1 == ZONES_MAX) 138 138 panic("Maximum zone(%d) count exceeded.", ZONES_MAX); 139 140 139 for (i=0; i < zones.count; i++) { 141 140 /* Check for overflow */ 142 z = zones.info[ zones.count];141 z = zones.info[i]; 143 142 if (overlaps(newzone->base,newzone->count, 144 143 z->base, z->count)) { … … 146 145 return -1; 147 146 } 148 if ( z->base < newzone->base)147 if (newzone->base < z->base) 149 148 break; 150 149 } … … 152 151 for (j=i;j < zones.count;j++) 153 152 zones.info[j+1] = zones.info[j]; 154 155 153 zones.info[i] = newzone; 156 154 zones.count++; 157 158 155 spinlock_unlock(&zones.lock); 159 156 interrupts_restore(ipl); … … 768 765 frame_initialize(&z->frames[i]); 769 766 } 770 767 771 768 /* Stuffing frames */ 772 769 for (i = 0; i < count; i++) { … … 844 841 zone_mark_unavailable(z, i - z->base); 845 842 } 846 847 843 return znum; 848 844 } … … 972 968 zone_t *zone; 973 969 int prefzone = 0; 974 970 975 971 for (i=0; i < count; i++) { 976 972 zone = find_zone_and_lock(start+i,&prefzone); … … 996 992 frame_arch_init(); 997 993 if (config.cpu_active == 1) { 998 frame_mark_unavailable(ADDR2PFN(KA2PA(config.base)), 999 SIZE2FRAMES(config.kernel_size)); 994 pfn_t firstframe = ADDR2PFN(KA2PA(config.base)); 995 pfn_t lastframe = ADDR2PFN(KA2PA(config.base+config.kernel_size)); 996 frame_mark_unavailable(firstframe,lastframe-firstframe+1); 1000 997 if (config.init_size > 0) 1001 998 frame_mark_unavailable(ADDR2PFN(KA2PA(config.init_addr)),
Note:
See TracChangeset
for help on using the changeset viewer.