Changeset 516adce in mainline for kernel/generic/src/mm/frame.c


Ignore:
Timestamp:
2010-04-07T10:24:00Z (14 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36b5b0f
Parents:
1ba37fa
Message:

top echoes also physical memory overview

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/frame.c

    r1ba37fa r516adce  
    12181218}
    12191219
     1220void zone_busy_and_free(uint64_t *out_busy, uint64_t *out_free)
     1221{
     1222        ipl_t ipl = interrupts_disable();
     1223        spinlock_lock(&zones.lock);
     1224
     1225        uint64_t busy = 0, free = 0;
     1226        size_t i;
     1227        for (i = 0; i < zones.count; i++) {
     1228                bool available = zone_flags_available(zones.info[i].flags);
     1229                /* Do not count reserved memory */
     1230                if (available) {
     1231                        busy += (uint64_t) FRAMES2SIZE(zones.info[i].busy_count);
     1232                        free += (uint64_t) FRAMES2SIZE(zones.info[i].free_count);
     1233                }
     1234        }
     1235
     1236        spinlock_unlock(&zones.lock);
     1237        interrupts_restore(ipl);
     1238        *out_busy = busy;
     1239        *out_free = free;
     1240}
     1241
    12201242/** Prints list of zones. */
    12211243void zone_print_list(void)
Note: See TracChangeset for help on using the changeset viewer.