Changeset 20235a3 in mainline for kernel/generic/src/mm/frame.c
- Timestamp:
- 2010-09-02T20:55:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c39b96
- Parents:
- 0c61955 (diff), 3249673 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
r0c61955 r20235a3 121 121 * 122 122 */ 123 NO_TRACE static size_t zones_insert_zone(pfn_t base, size_t count) 123 NO_TRACE static size_t zones_insert_zone(pfn_t base, size_t count, 124 zone_flags_t flags) 124 125 { 125 126 if (zones.count + 1 == ZONES_MAX) { … … 131 132 for (i = 0; i < zones.count; i++) { 132 133 /* Check for overlap */ 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)); 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 139 153 return (size_t) -1; 140 154 } … … 147 161 for (j = zones.count; j > i; j--) { 148 162 zones.info[j] = zones.info[j - 1]; 149 zones.info[j].buddy_system->data = 150 (void *) &zones.info[j - 1]; 163 if (zones.info[j].buddy_system != NULL) 164 zones.info[j].buddy_system->data = 165 (void *) &zones.info[j]; 151 166 } 152 167 … … 748 763 for (i = z2 + 1; i < zones.count; i++) { 749 764 zones.info[i - 1] = zones.info[i]; 750 zones.info[i - 1].buddy_system->data = 751 (void *) &zones.info[i - 1]; 765 if (zones.info[i - 1].buddy_system != NULL) 766 zones.info[i - 1].buddy_system->data = 767 (void *) &zones.info[i - 1]; 752 768 } 753 769 … … 898 914 } 899 915 900 size_t znum = zones_insert_zone(start, count );916 size_t znum = zones_insert_zone(start, count, flags); 901 917 if (znum == (size_t) -1) { 902 918 irq_spinlock_unlock(&zones.lock, true); … … 921 937 922 938 /* Non-available zone */ 923 size_t znum = zones_insert_zone(start, count );939 size_t znum = zones_insert_zone(start, count, flags); 924 940 if (znum == (size_t) -1) { 925 941 irq_spinlock_unlock(&zones.lock, true);
Note:
See TracChangeset
for help on using the changeset viewer.