Changes in kernel/generic/src/mm/frame.c [af96dd57:97bdb4a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
raf96dd57 r97bdb4a 121 121 * 122 122 */ 123 NO_TRACE static size_t zones_insert_zone(pfn_t base, size_t count, 124 zone_flags_t flags) 123 NO_TRACE static size_t zones_insert_zone(pfn_t base, size_t count) 125 124 { 126 125 if (zones.count + 1 == ZONES_MAX) { … … 132 131 for (i = 0; i < zones.count; i++) { 133 132 /* Check for overlap */ 134 if (overlaps(zones.info[i].base, zones.info[i].count, 135 base, count)) { 136 137 /* 138 * If the overlaping zones are of the same type 139 * and the new zone is completely within the previous 140 * one, then quietly ignore the new zone. 141 * 142 */ 143 144 if ((zones.info[i].flags != flags) || 145 (!iswithin(zones.info[i].base, zones.info[i].count, 146 base, count))) { 147 printf("Zone (%p, %p) overlaps with previous zone (%p, %p)!\n", 148 PFN2ADDR(base), PFN2ADDR(count), 149 PFN2ADDR(zones.info[i].base), 150 PFN2ADDR(zones.info[i].count)); 151 } 152 133 if (overlaps(base, count, 134 zones.info[i].base, zones.info[i].count)) { 135 printf("Zone (%p, %p) overlaps with zone (%p, %p)!\n", 136 PFN2ADDR(base), PFN2ADDR(base + count), 137 PFN2ADDR(zones.info[i].base), 138 PFN2ADDR(zones.info[i].base + zones.info[i].count)); 153 139 return (size_t) -1; 154 140 } … … 161 147 for (j = zones.count; j > i; j--) { 162 148 zones.info[j] = zones.info[j - 1]; 163 if (zones.info[j].buddy_system != NULL) 164 zones.info[j].buddy_system->data = 165 (void *) &zones.info[j]; 149 zones.info[j].buddy_system->data = 150 (void *) &zones.info[j - 1]; 166 151 } 167 152 … … 763 748 for (i = z2 + 1; i < zones.count; i++) { 764 749 zones.info[i - 1] = zones.info[i]; 765 if (zones.info[i - 1].buddy_system != NULL) 766 zones.info[i - 1].buddy_system->data = 767 (void *) &zones.info[i - 1]; 750 zones.info[i - 1].buddy_system->data = 751 (void *) &zones.info[i - 1]; 768 752 } 769 753 … … 914 898 } 915 899 916 size_t znum = zones_insert_zone(start, count , flags);900 size_t znum = zones_insert_zone(start, count); 917 901 if (znum == (size_t) -1) { 918 902 irq_spinlock_unlock(&zones.lock, true); … … 937 921 938 922 /* Non-available zone */ 939 size_t znum = zones_insert_zone(start, count , flags);923 size_t znum = zones_insert_zone(start, count); 940 924 if (znum == (size_t) -1) { 941 925 irq_spinlock_unlock(&zones.lock, true);
Note:
See TracChangeset
for help on using the changeset viewer.