Changeset 64c2ad5 in mainline


Ignore:
Timestamp:
2006-10-08T14:47:54Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7ba7c6d
Parents:
8d4a577
Message:

Add function for printing out info about address space.

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/as.h

    r8d4a577 r64c2ad5  
    217217extern unative_t sys_as_area_destroy(uintptr_t address);
    218218
     219/* Introspection functions. */
     220extern void as_print(as_t *as);
     221
    219222#endif /* KERNEL */
    220223
  • kernel/generic/src/mm/as.c

    r8d4a577 r64c2ad5  
    15791579}
    15801580
     1581/** Print out information about address space.
     1582 *
     1583 * @param as Address space.
     1584 */
     1585void as_print(as_t *as)
     1586{
     1587        ipl_t ipl;
     1588       
     1589        ipl = interrupts_disable();
     1590        mutex_lock(&as->lock);
     1591       
     1592        /* print out info about address space areas */
     1593        link_t *cur;
     1594        for (cur = as->as_area_btree.leaf_head.next; cur != &as->as_area_btree.leaf_head; cur = cur->next) {
     1595                as_area_t *area;
     1596                btree_node_t *node;
     1597               
     1598                node = list_get_instance(cur, btree_node_t, leaf_link);
     1599               
     1600                int i;
     1601                for (i = 0; i < node->keys; i++) {
     1602                        area = node->value[i];
     1603               
     1604                        mutex_lock(&area->lock);
     1605                        printf("as_area: %p, base=%p, pages=%d (%p - %p)\n",
     1606                                area, area->base, area->pages, area->base, area->base + area->pages*PAGE_SIZE);
     1607                        mutex_unlock(&area->lock);
     1608                }
     1609        }
     1610       
     1611        mutex_unlock(&as->lock);
     1612        interrupts_restore(ipl);
     1613}
     1614
    15811615/** @}
    15821616 */
Note: See TracChangeset for help on using the changeset viewer.