Changeset c47e1a8 in mainline for kernel/generic/src/mm/frame.c
- Timestamp:
- 2010-05-21T07:50:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d51ee2b
- Parents:
- cf8cc36 (diff), 15b592b (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
rcf8cc36 rc47e1a8 43 43 */ 44 44 45 #include < arch/types.h>45 #include <typedefs.h> 46 46 #include <mm/frame.h> 47 47 #include <mm/as.h> … … 1033 1033 spinlock_unlock(&zones.lock); 1034 1034 interrupts_restore(ipl); 1035 1036 if (!THREAD) 1037 panic("Cannot wait for memory to become available."); 1035 1038 1036 1039 /* … … 1202 1205 1203 1206 /** Return total size of all zones. */ 1204 uint64_t zone _total_size(void)1207 uint64_t zones_total_size(void) 1205 1208 { 1206 1209 ipl_t ipl = interrupts_disable(); … … 1218 1221 } 1219 1222 1223 void zones_stats(uint64_t *total, uint64_t *unavail, uint64_t *busy, 1224 uint64_t *free) 1225 { 1226 ASSERT(total != NULL); 1227 ASSERT(unavail != NULL); 1228 ASSERT(busy != NULL); 1229 ASSERT(free != NULL); 1230 1231 ipl_t ipl = interrupts_disable(); 1232 spinlock_lock(&zones.lock); 1233 1234 *total = 0; 1235 *unavail = 0; 1236 *busy = 0; 1237 *free = 0; 1238 1239 size_t i; 1240 for (i = 0; i < zones.count; i++) { 1241 *total += (uint64_t) FRAMES2SIZE(zones.info[i].count); 1242 1243 if (zone_flags_available(zones.info[i].flags)) { 1244 *busy += (uint64_t) FRAMES2SIZE(zones.info[i].busy_count); 1245 *free += (uint64_t) FRAMES2SIZE(zones.info[i].free_count); 1246 } else 1247 *unavail += (uint64_t) FRAMES2SIZE(zones.info[i].count); 1248 } 1249 1250 spinlock_unlock(&zones.lock); 1251 interrupts_restore(ipl); 1252 } 1253 1220 1254 /** Prints list of zones. */ 1221 void zone _print_list(void)1255 void zones_print_list(void) 1222 1256 { 1223 1257 #ifdef __32_BITS__
Note:
See TracChangeset
for help on using the changeset viewer.