Ignore:
File:
1 edited

Legend:

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

    r6b9e85b rfc47885  
    7979#include <arch/interrupt.h>
    8080
     81#ifdef CONFIG_VIRT_IDX_DCACHE
     82#include <arch/mm/cache.h>
     83#endif /* CONFIG_VIRT_IDX_DCACHE */
     84
    8185/**
    8286 * Each architecture decides what functions will be used to carry out
    8387 * address space operations such as creating or locking page tables.
    84  *
    8588 */
    8689as_operations_t *as_operations = NULL;
    8790
    88 /**
    89  * Slab for as_t objects.
     91/** Slab for as_t objects.
    9092 *
    9193 */
    9294static slab_cache_t *as_slab;
    9395
    94 /**
    95  * This lock serializes access to the ASID subsystem.
    96  * It protects:
     96/** ASID subsystem lock.
     97 *
     98 * This lock protects:
    9799 * - inactive_as_with_asid_head list
    98100 * - as->asid for each as of the as_t type
     
    103105
    104106/**
    105  * This list contains address spaces that are not active on any
    106  * processor and that have valid ASID.
    107  *
     107 * Inactive address spaces (on all processors)
     108 * that have valid ASID.
    108109 */
    109110LIST_INITIALIZE(inactive_as_with_asid_head);
     
    119120        mutex_initialize(&as->lock, MUTEX_PASSIVE);
    120121       
    121         int rc = as_constructor_arch(as, flags);
    122        
    123         return rc;
     122        return as_constructor_arch(as, flags);
    124123}
    125124
    126125NO_TRACE static size_t as_destructor(void *obj)
    127126{
    128         as_t *as = (as_t *) obj;
    129         return as_destructor_arch(as);
     127        return as_destructor_arch((as_t *) obj);
    130128}
    131129
     
    142140                panic("Cannot create kernel address space.");
    143141       
    144         /* Make sure the kernel address space
     142        /*
     143         * Make sure the kernel address space
    145144         * reference count never drops to zero.
    146145         */
     
    191190{
    192191        DEADLOCK_PROBE_INIT(p_asidlock);
    193 
     192       
    194193        ASSERT(as != AS);
    195194        ASSERT(atomic_get(&as->refcount) == 0);
     
    199198         * lock its mutex.
    200199         */
    201 
     200       
    202201        /*
    203202         * We need to avoid deadlock between TLB shootdown and asidlock.
     
    206205         * disabled to prevent nested context switches. We also depend on the
    207206         * fact that so far no spinlocks are held.
    208          *
    209207         */
    210208        preemption_disable();
     
    231229        spinlock_unlock(&asidlock);
    232230        interrupts_restore(ipl);
    233 
     231       
    234232       
    235233        /*
     
    237235         * The B+tree must be walked carefully because it is
    238236         * also being destroyed.
    239          *
    240237         */
    241238        bool cond = true;
     
    264261/** Hold a reference to an address space.
    265262 *
    266  * Holding a reference to an address space prevents destruction of that address
    267  * space.
     263 * Holding a reference to an address space prevents destruction
     264 * of that address space.
    268265 *
    269266 * @param as Address space to be held.
     
    277274/** Release a reference to an address space.
    278275 *
    279  * The last one to release a reference to an address space destroys the address
    280  * space.
     276 * The last one to release a reference to an address space
     277 * destroys the address space.
    281278 *
    282279 * @param asAddress space to be released.
     
    306303        /*
    307304         * We don't want any area to have conflicts with NULL page.
    308          *
    309305         */
    310306        if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
     
    317313         * record in the left neighbour, the leftmost record in the right
    318314         * neighbour and all records in the leaf node itself.
    319          *
    320315         */
    321316        btree_node_t *leaf;
     
    378373         * So far, the area does not conflict with other areas.
    379374         * Check if it doesn't conflict with kernel address space.
    380          *
    381375         */
    382376        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
     
    433427        area->attributes = attrs;
    434428        area->pages = SIZE2FRAMES(size);
     429        area->resident = 0;
    435430        area->base = base;
    436431        area->sh_info = NULL;
     
    475470         * to find out whether this is a miss or va belongs to an address
    476471         * space area found there.
    477          *
    478472         */
    479473       
     
    495489         * Second, locate the left neighbour and test its last record.
    496490         * Because of its position in the B+tree, it must have base < va.
    497          *
    498491         */
    499492        btree_node_t *lnode = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf);
     
    530523        /*
    531524         * Locate the area.
    532          *
    533525         */
    534526        as_area_t *area = find_area_and_lock(as, address);
     
    542534                 * Remapping of address space areas associated
    543535                 * with memory mapped devices is not supported.
    544                  *
    545536                 */
    546537                mutex_unlock(&area->lock);
     
    553544                 * Remapping of shared address space areas
    554545                 * is not supported.
    555                  *
    556546                 */
    557547                mutex_unlock(&area->lock);
     
    564554                /*
    565555                 * Zero size address space areas are not allowed.
    566                  *
    567556                 */
    568557                mutex_unlock(&area->lock);
     
    577566                 * Shrinking the area.
    578567                 * No need to check for overlaps.
    579                  *
    580568                 */
    581569               
     
    584572                /*
    585573                 * Start TLB shootdown sequence.
    586                  *
    587574                 */
    588575                ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid,
     
    595582                 * is also the right way to remove part of the used_space
    596583                 * B+tree leaf list.
    597                  *
    598584                 */
    599585                bool cond = true;
     
    619605                                                 * completely in the resized
    620606                                                 * address space area.
    621                                                  *
    622607                                                 */
    623608                                                break;
     
    628613                                         * to b and c overlaps with the resized
    629614                                         * address space area.
    630                                          *
    631615                                         */
    632616                                       
     
    669653                /*
    670654                 * Finish TLB shootdown sequence.
    671                  *
    672655                 */
    673656               
     
    677660                /*
    678661                 * Invalidate software translation caches (e.g. TSB on sparc64).
    679                  *
    680662                 */
    681663                as_invalidate_translation_cache(as, area->base +
     
    688670                 * Growing the area.
    689671                 * Check for overlaps with other address space areas.
    690                  *
    691672                 */
    692673                if (!check_area_conflicts(as, address, pages * PAGE_SIZE,
     
    809790        /*
    810791         * Finish TLB shootdown sequence.
    811          *
    812792         */
    813793       
     
    817797         * Invalidate potential software translation caches (e.g. TSB on
    818798         * sparc64).
    819          *
    820799         */
    821800        as_invalidate_translation_cache(as, area->base, area->pages);
     
    835814        /*
    836815         * Remove the empty area from address space.
    837          *
    838816         */
    839817        btree_remove(&as->as_area_btree, base, NULL);
     
    877855                /*
    878856                 * Could not find the source address space area.
    879                  *
    880857                 */
    881858                mutex_unlock(&src_as->lock);
     
    887864                 * There is no backend or the backend does not
    888865                 * know how to share the area.
    889                  *
    890866                 */
    891867                mutex_unlock(&src_area->lock);
     
    914890         * First, prepare the area for sharing.
    915891         * Then it will be safe to unlock it.
    916          *
    917892         */
    918893        share_info_t *sh_info = src_area->sh_info;
     
    926901                /*
    927902                 * Call the backend to setup sharing.
    928                  *
    929903                 */
    930904                src_area->backend->share(src_area);
     
    945919         * The flags of the source area are masked against dst_flags_mask
    946920         * to support sharing in less privileged mode.
    947          *
    948921         */
    949922        as_area_t *dst_area = as_area_create(dst_as, dst_flags_mask, src_size,
     
    962935         * fully initialized. Clear the AS_AREA_ATTR_PARTIAL
    963936         * attribute and set the sh_info.
    964          *
    965937         */
    966938        mutex_lock(&dst_as->lock);
     
    985957NO_TRACE bool as_area_check_access(as_area_t *area, pf_access_t access)
    986958{
     959        ASSERT(mutex_locked(&area->lock));
     960       
    987961        int flagmap[] = {
    988962                [PF_ACCESS_READ] = AS_AREA_READ,
     
    990964                [PF_ACCESS_EXEC] = AS_AREA_EXEC
    991965        };
    992 
    993         ASSERT(mutex_locked(&area->lock));
    994966       
    995967        if (!(area->flags & flagmap[access]))
     
    10621034        /*
    10631035         * Compute total number of used pages in the used_space B+tree
    1064          *
    10651036         */
    10661037        size_t used_pages = 0;
     
    10841055        /*
    10851056         * Start TLB shootdown sequence.
    1086          *
    10871057         */
    10881058        ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base,
     
    10921062         * Remove used pages from page tables and remember their frame
    10931063         * numbers.
    1094          *
    10951064         */
    10961065        size_t frame_idx = 0;
     
    11231092        /*
    11241093         * Finish TLB shootdown sequence.
    1125          *
    11261094         */
    11271095       
     
    11311099         * Invalidate potential software translation caches (e.g. TSB on
    11321100         * sparc64).
    1133          *
    11341101         */
    11351102        as_invalidate_translation_cache(as, area->base, area->pages);
     
    12131180                 * No area contained mapping for 'page'.
    12141181                 * Signal page fault to low-level handler.
    1215                  *
    12161182                 */
    12171183                mutex_unlock(&AS->lock);
     
    12331199                 * The address space area is not backed by any backend
    12341200                 * or the backend cannot handle page faults.
    1235                  *
    12361201                 */
    12371202                mutex_unlock(&area->lock);
     
    12451210         * To avoid race condition between two page faults on the same address,
    12461211         * we need to make sure the mapping has not been already inserted.
    1247          *
    12481212         */
    12491213        pte_t *pte;
     
    12631227        /*
    12641228         * Resort to the backend page fault handler.
    1265          *
    12661229         */
    12671230        if (area->backend->page_fault(area, page, access) != AS_PF_OK) {
     
    13181281                 * preemption is disabled. We should not be
    13191282                 * holding any other lock.
    1320                  *
    13211283                 */
    13221284                (void) interrupts_enable();
     
    13381300                         * list of inactive address spaces with assigned
    13391301                         * ASID.
    1340                          *
    13411302                         */
    13421303                        ASSERT(old_as->asid != ASID_INVALID);
     
    13491310                 * Perform architecture-specific tasks when the address space
    13501311                 * is being removed from the CPU.
    1351                  *
    13521312                 */
    13531313                as_deinstall_arch(old_as);
     
    13561316        /*
    13571317         * Second, prepare the new address space.
    1358          *
    13591318         */
    13601319        if ((new_as->cpu_refcount++ == 0) && (new_as != AS_KERNEL)) {
     
    13721331         * Perform architecture-specific steps.
    13731332         * (e.g. write ASID to hardware register etc.)
    1374          *
    13751333         */
    13761334        as_install_arch(new_as);
     
    13911349{
    13921350        ASSERT(mutex_locked(&area->lock));
    1393 
     1351       
    13941352        return area_flags_to_page_flags(area->flags);
    13951353}
     
    15121470 * @param count Number of page to be marked.
    15131471 *
    1514  * @return Zero on failure and non-zero on success.
    1515  *
    1516  */
    1517 int used_space_insert(as_area_t *area, uintptr_t page, size_t count)
     1472 * @return False on failure or true on success.
     1473 *
     1474 */
     1475bool used_space_insert(as_area_t *area, uintptr_t page, size_t count)
    15181476{
    15191477        ASSERT(mutex_locked(&area->lock));
     
    15261484                /*
    15271485                 * We hit the beginning of some used space.
    1528                  *
    1529                  */
    1530                 return 0;
     1486                 */
     1487                return false;
    15311488        }
    15321489       
    15331490        if (!leaf->keys) {
    15341491                btree_insert(&area->used_space, page, (void *) count, leaf);
    1535                 return 1;
     1492                goto success;
    15361493        }
    15371494       
     
    15471504                 * somewhere between the rightmost interval of
    15481505                 * the left neigbour and the first interval of the leaf.
    1549                  *
    15501506                 */
    15511507               
     
    15551511                    left_cnt * PAGE_SIZE)) {
    15561512                        /* The interval intersects with the left interval. */
    1557                         return 0;
     1513                        return false;
    15581514                } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    15591515                    right_cnt * PAGE_SIZE)) {
    15601516                        /* The interval intersects with the right interval. */
    1561                         return 0;
     1517                        return false;
    15621518                } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    15631519                    (page + count * PAGE_SIZE == right_pg)) {
     
    15651521                         * The interval can be added by merging the two already
    15661522                         * present intervals.
    1567                          *
    15681523                         */
    15691524                        node->value[node->keys - 1] += count + right_cnt;
    15701525                        btree_remove(&area->used_space, right_pg, leaf);
    1571                         return 1;
     1526                        goto success;
    15721527                } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    15731528                        /*
    15741529                         * The interval can be added by simply growing the left
    15751530                         * interval.
    1576                          *
    15771531                         */
    15781532                        node->value[node->keys - 1] += count;
    1579                         return 1;
     1533                        goto success;
    15801534                } else if (page + count * PAGE_SIZE == right_pg) {
    15811535                        /*
     
    15831537                         * the right interval down and increasing its size
    15841538                         * accordingly.
    1585                          *
    15861539                         */
    15871540                        leaf->value[0] += count;
    15881541                        leaf->key[0] = page;
    1589                         return 1;
     1542                        goto success;
    15901543                } else {
    15911544                        /*
    15921545                         * The interval is between both neigbouring intervals,
    15931546                         * but cannot be merged with any of them.
    1594                          *
    15951547                         */
    15961548                        btree_insert(&area->used_space, page, (void *) count,
    15971549                            leaf);
    1598                         return 1;
     1550                        goto success;
    15991551                }
    16001552        } else if (page < leaf->key[0]) {
     
    16051557                 * Investigate the border case in which the left neighbour does
    16061558                 * not exist but the interval fits from the left.
    1607                  *
    16081559                 */
    16091560               
     
    16111562                    right_cnt * PAGE_SIZE)) {
    16121563                        /* The interval intersects with the right interval. */
    1613                         return 0;
     1564                        return false;
    16141565                } else if (page + count * PAGE_SIZE == right_pg) {
    16151566                        /*
     
    16171568                         * right interval down and increasing its size
    16181569                         * accordingly.
    1619                          *
    16201570                         */
    16211571                        leaf->key[0] = page;
    16221572                        leaf->value[0] += count;
    1623                         return 1;
     1573                        goto success;
    16241574                } else {
    16251575                        /*
    16261576                         * The interval doesn't adjoin with the right interval.
    16271577                         * It must be added individually.
    1628                          *
    16291578                         */
    16301579                        btree_insert(&area->used_space, page, (void *) count,
    16311580                            leaf);
    1632                         return 1;
     1581                        goto success;
    16331582                }
    16341583        }
     
    16451594                 * somewhere between the leftmost interval of
    16461595                 * the right neigbour and the last interval of the leaf.
    1647                  *
    16481596                 */
    16491597               
     
    16531601                    left_cnt * PAGE_SIZE)) {
    16541602                        /* The interval intersects with the left interval. */
    1655                         return 0;
     1603                        return false;
    16561604                } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    16571605                    right_cnt * PAGE_SIZE)) {
    16581606                        /* The interval intersects with the right interval. */
    1659                         return 0;
     1607                        return false;
    16601608                } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    16611609                    (page + count * PAGE_SIZE == right_pg)) {
     
    16631611                         * The interval can be added by merging the two already
    16641612                         * present intervals.
    1665                          *
    16661613                         */
    16671614                        leaf->value[leaf->keys - 1] += count + right_cnt;
    16681615                        btree_remove(&area->used_space, right_pg, node);
    1669                         return 1;
     1616                        goto success;
    16701617                } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    16711618                        /*
    16721619                         * The interval can be added by simply growing the left
    16731620                         * interval.
    1674                          *
    16751621                         */
    1676                         leaf->value[leaf->keys - 1] +=  count;
    1677                         return 1;
     1622                        leaf->value[leaf->keys - 1] += count;
     1623                        goto success;
    16781624                } else if (page + count * PAGE_SIZE == right_pg) {
    16791625                        /*
     
    16811627                         * the right interval down and increasing its size
    16821628                         * accordingly.
    1683                          *
    16841629                         */
    16851630                        node->value[0] += count;
    16861631                        node->key[0] = page;
    1687                         return 1;
     1632                        goto success;
    16881633                } else {
    16891634                        /*
    16901635                         * The interval is between both neigbouring intervals,
    16911636                         * but cannot be merged with any of them.
    1692                          *
    16931637                         */
    16941638                        btree_insert(&area->used_space, page, (void *) count,
    16951639                            leaf);
    1696                         return 1;
     1640                        goto success;
    16971641                }
    16981642        } else if (page >= leaf->key[leaf->keys - 1]) {
     
    17031647                 * Investigate the border case in which the right neighbour
    17041648                 * does not exist but the interval fits from the right.
    1705                  *
    17061649                 */
    17071650               
     
    17091652                    left_cnt * PAGE_SIZE)) {
    17101653                        /* The interval intersects with the left interval. */
    1711                         return 0;
     1654                        return false;
    17121655                } else if (left_pg + left_cnt * PAGE_SIZE == page) {
    17131656                        /*
    17141657                         * The interval can be added by growing the left
    17151658                         * interval.
    1716                          *
    17171659                         */
    17181660                        leaf->value[leaf->keys - 1] += count;
    1719                         return 1;
     1661                        goto success;
    17201662                } else {
    17211663                        /*
    17221664                         * The interval doesn't adjoin with the left interval.
    17231665                         * It must be added individually.
    1724                          *
    17251666                         */
    17261667                        btree_insert(&area->used_space, page, (void *) count,
    17271668                            leaf);
    1728                         return 1;
     1669                        goto success;
    17291670                }
    17301671        }
     
    17341675         * only between two other intervals of the leaf. The two border cases
    17351676         * were already resolved.
    1736          *
    17371677         */
    17381678        btree_key_t i;
     
    17461686                        /*
    17471687                         * The interval fits between left_pg and right_pg.
    1748                          *
    17491688                         */
    17501689                       
     
    17541693                                 * The interval intersects with the left
    17551694                                 * interval.
    1756                                  *
    17571695                                 */
    1758                                 return 0;
     1696                                return false;
    17591697                        } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    17601698                            right_cnt * PAGE_SIZE)) {
     
    17621700                                 * The interval intersects with the right
    17631701                                 * interval.
    1764                                  *
    17651702                                 */
    1766                                 return 0;
     1703                                return false;
    17671704                        } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    17681705                            (page + count * PAGE_SIZE == right_pg)) {
     
    17701707                                 * The interval can be added by merging the two
    17711708                                 * already present intervals.
    1772                                  *
    17731709                                 */
    17741710                                leaf->value[i - 1] += count + right_cnt;
    17751711                                btree_remove(&area->used_space, right_pg, leaf);
    1776                                 return 1;
     1712                                goto success;
    17771713                        } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    17781714                                /*
    17791715                                 * The interval can be added by simply growing
    17801716                                 * the left interval.
    1781                                  *
    17821717                                 */
    17831718                                leaf->value[i - 1] += count;
    1784                                 return 1;
     1719                                goto success;
    17851720                        } else if (page + count * PAGE_SIZE == right_pg) {
    17861721                                /*
     
    17881723                                 * base of the right interval down and
    17891724                                 * increasing its size accordingly.
    1790                                  *
    17911725                                 */
    17921726                                leaf->value[i] += count;
    17931727                                leaf->key[i] = page;
    1794                                 return 1;
     1728                                goto success;
    17951729                        } else {
    17961730                                /*
     
    17981732                                 * intervals, but cannot be merged with any of
    17991733                                 * them.
    1800                                  *
    18011734                                 */
    18021735                                btree_insert(&area->used_space, page,
    18031736                                    (void *) count, leaf);
    1804                                 return 1;
     1737                                goto success;
    18051738                        }
    18061739                }
     
    18091742        panic("Inconsistency detected while adding %zu pages of used "
    18101743            "space at %p.", count, (void *) page);
     1744       
     1745success:
     1746        area->resident += count;
     1747        return true;
    18111748}
    18121749
     
    18191756 * @param count Number of page to be marked.
    18201757 *
    1821  * @return Zero on failure and non-zero on success.
    1822  *
    1823  */
    1824 int used_space_remove(as_area_t *area, uintptr_t page, size_t count)
     1758 * @return False on failure or true on success.
     1759 *
     1760 */
     1761bool used_space_remove(as_area_t *area, uintptr_t page, size_t count)
    18251762{
    18261763        ASSERT(mutex_locked(&area->lock));
     
    18331770                /*
    18341771                 * We are lucky, page is the beginning of some interval.
    1835                  *
    18361772                 */
    18371773                if (count > pages) {
    1838                         return 0;
     1774                        return false;
    18391775                } else if (count == pages) {
    18401776                        btree_remove(&area->used_space, page, leaf);
    1841                         return 1;
     1777                        goto success;
    18421778                } else {
    18431779                        /*
    18441780                         * Find the respective interval.
    18451781                         * Decrease its size and relocate its start address.
    1846                          *
    18471782                         */
    18481783                        btree_key_t i;
     
    18511786                                        leaf->key[i] += count * PAGE_SIZE;
    18521787                                        leaf->value[i] -= count;
    1853                                         return 1;
     1788                                        goto success;
    18541789                                }
    18551790                        }
     1791                       
    18561792                        goto error;
    18571793                }
     
    18721808                                 * removed by updating the size of the bigger
    18731809                                 * interval.
    1874                                  *
    18751810                                 */
    18761811                                node->value[node->keys - 1] -= count;
    1877                                 return 1;
     1812                                goto success;
    18781813                        } else if (page + count * PAGE_SIZE <
    18791814                            left_pg + left_cnt*PAGE_SIZE) {
     
    18841819                                 * the original interval and also inserting a
    18851820                                 * new interval.
    1886                                  *
    18871821                                 */
    18881822                                size_t new_cnt = ((left_pg + left_cnt * PAGE_SIZE) -
     
    18911825                                btree_insert(&area->used_space, page +
    18921826                                    count * PAGE_SIZE, (void *) new_cnt, leaf);
    1893                                 return 1;
     1827                                goto success;
    18941828                        }
    18951829                }
    1896                 return 0;
     1830               
     1831                return false;
    18971832        } else if (page < leaf->key[0])
    1898                 return 0;
     1833                return false;
    18991834       
    19001835        if (page > leaf->key[leaf->keys - 1]) {
     
    19101845                                 * interval of the leaf and can be removed by
    19111846                                 * updating the size of the bigger interval.
    1912                                  *
    19131847                                 */
    19141848                                leaf->value[leaf->keys - 1] -= count;
    1915                                 return 1;
     1849                                goto success;
    19161850                        } else if (page + count * PAGE_SIZE < left_pg +
    19171851                            left_cnt * PAGE_SIZE) {
     
    19221856                                 * original interval and also inserting a new
    19231857                                 * interval.
    1924                                  *
    19251858                                 */
    19261859                                size_t new_cnt = ((left_pg + left_cnt * PAGE_SIZE) -
     
    19291862                                btree_insert(&area->used_space, page +
    19301863                                    count * PAGE_SIZE, (void *) new_cnt, leaf);
    1931                                 return 1;
     1864                                goto success;
    19321865                        }
    19331866                }
    1934                 return 0;
     1867               
     1868                return false;
    19351869        }
    19361870       
    19371871        /*
    19381872         * The border cases have been already resolved.
    1939          * Now the interval can be only between intervals of the leaf. 
     1873         * Now the interval can be only between intervals of the leaf.
    19401874         */
    19411875        btree_key_t i;
     
    19581892                                         * be removed by updating the size of
    19591893                                         * the bigger interval.
    1960                                          *
    19611894                                         */
    19621895                                        leaf->value[i - 1] -= count;
    1963                                         return 1;
     1896                                        goto success;
    19641897                                } else if (page + count * PAGE_SIZE <
    19651898                                    left_pg + left_cnt * PAGE_SIZE) {
     
    19791912                                            count * PAGE_SIZE, (void *) new_cnt,
    19801913                                            leaf);
    1981                                         return 1;
     1914                                        goto success;
    19821915                                }
    19831916                        }
    1984                         return 0;
     1917                       
     1918                        return false;
    19851919                }
    19861920        }
     
    19891923        panic("Inconsistency detected while removing %zu pages of used "
    19901924            "space from %p.", count, (void *) page);
     1925       
     1926success:
     1927        area->resident -= count;
     1928        return true;
    19911929}
    19921930
Note: See TracChangeset for help on using the changeset viewer.