Changeset 6c441cf8 in mainline for kernel/generic/src/mm
- Timestamp:
- 2008-02-27T11:49:17Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 56976a17
- Parents:
- fdb7795
- Location:
- kernel/generic/src/mm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
rfdb7795 r6c441cf8 432 432 count_t c = 433 433 (count_t) node->value[node->keys - 1]; 434 int i = 0;434 unsigned int i = 0; 435 435 436 436 if (overlaps(b, c * PAGE_SIZE, area->base, … … 562 562 cur != &area->used_space.leaf_head; cur = cur->next) { 563 563 btree_node_t *node; 564 int i;564 unsigned int i; 565 565 566 566 node = list_get_instance(cur, btree_node_t, leaf_link); … … 1098 1098 as_area_t *a; 1099 1099 btree_node_t *leaf, *lnode; 1100 int i;1100 unsigned int i; 1101 1101 1102 1102 a = (as_area_t *) btree_search(&as->as_area_btree, va, &leaf); … … 1156 1156 as_area_t *a; 1157 1157 btree_node_t *leaf, *node; 1158 int i;1158 unsigned int i; 1159 1159 1160 1160 /* … … 1265 1265 btree_node_t *leaf, *node; 1266 1266 count_t pages; 1267 int i;1267 unsigned int i; 1268 1268 1269 1269 ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE)); … … 1547 1547 btree_node_t *leaf, *node; 1548 1548 count_t pages; 1549 int i;1549 unsigned int i; 1550 1550 1551 1551 ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE)); … … 1735 1735 cur != &sh_info->pagemap.leaf_head; cur = cur->next) { 1736 1736 btree_node_t *node; 1737 int i;1737 unsigned int i; 1738 1738 1739 1739 node = list_get_instance(cur, btree_node_t, leaf_link); … … 1796 1796 node = list_get_instance(cur, btree_node_t, leaf_link); 1797 1797 1798 int i;1798 unsigned int i; 1799 1799 for (i = 0; i < node->keys; i++) { 1800 1800 as_area_t *area = node->value[i]; -
kernel/generic/src/mm/backend_anon.c
rfdb7795 r6c441cf8 99 99 if (!frame) { 100 100 bool allocate = true; 101 int i;101 unsigned int i; 102 102 103 103 /* … … 194 194 cur != &area->used_space.leaf_head; cur = cur->next) { 195 195 btree_node_t *node; 196 int i;196 unsigned int i; 197 197 198 198 node = list_get_instance(cur, btree_node_t, leaf_link); … … 200 200 uintptr_t base = node->key[i]; 201 201 count_t count = (count_t) node->value[i]; 202 int j;202 unsigned int j; 203 203 204 204 for (j = 0; j < count; j++) { -
kernel/generic/src/mm/backend_elf.c
rfdb7795 r6c441cf8 104 104 ALIGN_DOWN(addr, PAGE_SIZE) - area->base, &leaf); 105 105 if (!frame) { 106 int i;106 unsigned int i; 107 107 108 108 /* … … 291 291 for (cur = &node->leaf_link; cur != &area->used_space.leaf_head; 292 292 cur = cur->next) { 293 int i;293 unsigned int i; 294 294 295 295 node = list_get_instance(cur, btree_node_t, leaf_link); … … 298 298 uintptr_t base = node->key[i]; 299 299 count_t count = (count_t) node->value[i]; 300 int j;300 unsigned int j; 301 301 302 302 /* -
kernel/generic/src/mm/frame.c
rfdb7795 r6c441cf8 121 121 static inline int frame_index_valid(zone_t *zone, index_t index) 122 122 { 123 return (index >= 0) && (index< zone->count);123 return (index < zone->count); 124 124 } 125 125 … … 211 211 spinlock_lock(&zones.lock); 212 212 213 if (hint >= zones.count || hint < 0)213 if (hint >= zones.count) 214 214 hint = 0; 215 215 … … 720 720 spinlock_lock(&zones.lock); 721 721 722 if ( z1 < 0 || z1 >= zones.count || z2 < 0 || z2 >= zones.count)722 if ((z1 >= zones.count) || (z2 >= zones.count)) 723 723 goto errout; 724 724 /* We can join only 2 zones with none existing inbetween */ -
kernel/generic/src/mm/slab.c
rfdb7795 r6c441cf8 173 173 slab_t *slab; 174 174 size_t fsize; 175 int i;175 unsigned int i; 176 176 unsigned int zone = 0; 177 177 … … 192 192 193 193 /* Fill in slab structures */ 194 for (i =0; i < (1 << cache->order); i++)195 frame_set_parent(ADDR2PFN(KA2PA(data)) +i, slab, zone);194 for (i = 0; i < ((unsigned int) 1 << cache->order); i++) 195 frame_set_parent(ADDR2PFN(KA2PA(data)) + i, slab, zone); 196 196 197 197 slab->start = data; … … 200 200 slab->cache = cache; 201 201 202 for (i =0; i<cache->objects;i++)202 for (i = 0; i < cache->objects; i++) 203 203 *((int *) (slab->start + i*cache->size)) = i+1; 204 204 … … 372 372 slab_magazine_t *mag) 373 373 { 374 int i;374 unsigned int i; 375 375 count_t frames = 0; 376 376 377 for (i =0;i < mag->busy; i++) {377 for (i = 0; i < mag->busy; i++) { 378 378 frames += slab_obj_destroy(cache, mag->objs[i], NULL); 379 379 atomic_dec(&cache->cached_objs); … … 528 528 529 529 /** Return number of objects that fit in certain cache size */ 530 static int comp_objects(slab_cache_t *cache)530 static unsigned int comp_objects(slab_cache_t *cache) 531 531 { 532 532 if (cache->flags & SLAB_CACHE_SLINSIDE) … … 537 537 538 538 /** Return wasted space in slab */ 539 static int badness(slab_cache_t *cache)540 { 541 int objects;542 int ssize;539 static unsigned int badness(slab_cache_t *cache) 540 { 541 unsigned int objects; 542 unsigned int ssize; 543 543 544 544 objects = comp_objects(cache); … … 546 546 if (cache->flags & SLAB_CACHE_SLINSIDE) 547 547 ssize -= sizeof(slab_t); 548 return ssize - objects *cache->size;548 return ssize - objects * cache->size; 549 549 } 550 550 … … 554 554 static void make_magcache(slab_cache_t *cache) 555 555 { 556 int i;556 unsigned int i; 557 557 558 558 ASSERT(_slab_initialized >= 2); 559 559 560 560 cache->mag_cache = malloc(sizeof(slab_mag_cache_t)*config.cpu_count,0); 561 for (i =0; i < config.cpu_count; i++) {561 for (i = 0; i < config.cpu_count; i++) { 562 562 memsetb((uintptr_t)&cache->mag_cache[i], 563 563 sizeof(cache->mag_cache[i]), 0); 564 spinlock_initialize(&cache->mag_cache[i].lock, 565 "slab_maglock_cpu"); 564 spinlock_initialize(&cache->mag_cache[i].lock, "slab_maglock_cpu"); 566 565 } 567 566 } … … 655 654 static count_t _slab_reclaim(slab_cache_t *cache, int flags) 656 655 { 657 int i;656 unsigned int i; 658 657 slab_magazine_t *mag; 659 658 count_t frames = 0; … … 676 675 /* Free cpu-bound magazines */ 677 676 /* Destroy CPU magazines */ 678 for (i =0; i<config.cpu_count; i++) {677 for (i = 0; i < config.cpu_count; i++) { 679 678 spinlock_lock(&cache->mag_cache[i].lock); 680 679 -
kernel/generic/src/mm/tlb.c
rfdb7795 r6c441cf8 82 82 uintptr_t page, count_t count) 83 83 { 84 int i;84 unsigned int i; 85 85 86 86 CPU->tlb_active = 0; … … 145 145 uintptr_t page; 146 146 count_t count; 147 int i;147 unsigned int i; 148 148 149 149 ASSERT(CPU);
Note:
See TracChangeset
for help on using the changeset viewer.