Ignore:
File:
1 edited

Legend:

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

    rfc47885 r6b9e85b  
    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 
    8581/**
    8682 * Each architecture decides what functions will be used to carry out
    8783 * address space operations such as creating or locking page tables.
     84 *
    8885 */
    8986as_operations_t *as_operations = NULL;
    9087
    91 /** Slab for as_t objects.
     88/**
     89 * Slab for as_t objects.
    9290 *
    9391 */
    9492static slab_cache_t *as_slab;
    9593
    96 /** ASID subsystem lock.
    97  *
    98  * This lock protects:
     94/**
     95 * This lock serializes access to the ASID subsystem.
     96 * It protects:
    9997 * - inactive_as_with_asid_head list
    10098 * - as->asid for each as of the as_t type
     
    105103
    106104/**
    107  * Inactive address spaces (on all processors)
    108  * that have valid ASID.
     105 * This list contains address spaces that are not active on any
     106 * processor and that have valid ASID.
     107 *
    109108 */
    110109LIST_INITIALIZE(inactive_as_with_asid_head);
     
    120119        mutex_initialize(&as->lock, MUTEX_PASSIVE);
    121120       
    122         return as_constructor_arch(as, flags);
     121        int rc = as_constructor_arch(as, flags);
     122       
     123        return rc;
    123124}
    124125
    125126NO_TRACE static size_t as_destructor(void *obj)
    126127{
    127         return as_destructor_arch((as_t *) obj);
     128        as_t *as = (as_t *) obj;
     129        return as_destructor_arch(as);
    128130}
    129131
     
    140142                panic("Cannot create kernel address space.");
    141143       
    142         /*
    143          * Make sure the kernel address space
     144        /* Make sure the kernel address space
    144145         * reference count never drops to zero.
    145146         */
     
    190191{
    191192        DEADLOCK_PROBE_INIT(p_asidlock);
    192        
     193
    193194        ASSERT(as != AS);
    194195        ASSERT(atomic_get(&as->refcount) == 0);
     
    198199         * lock its mutex.
    199200         */
    200        
     201
    201202        /*
    202203         * We need to avoid deadlock between TLB shootdown and asidlock.
     
    205206         * disabled to prevent nested context switches. We also depend on the
    206207         * fact that so far no spinlocks are held.
     208         *
    207209         */
    208210        preemption_disable();
     
    229231        spinlock_unlock(&asidlock);
    230232        interrupts_restore(ipl);
    231        
     233
    232234       
    233235        /*
     
    235237         * The B+tree must be walked carefully because it is
    236238         * also being destroyed.
     239         *
    237240         */
    238241        bool cond = true;
     
    261264/** Hold a reference to an address space.
    262265 *
    263  * Holding a reference to an address space prevents destruction
    264  * of that address space.
     266 * Holding a reference to an address space prevents destruction of that address
     267 * space.
    265268 *
    266269 * @param as Address space to be held.
     
    274277/** Release a reference to an address space.
    275278 *
    276  * The last one to release a reference to an address space
    277  * destroys the address space.
     279 * The last one to release a reference to an address space destroys the address
     280 * space.
    278281 *
    279282 * @param asAddress space to be released.
     
    303306        /*
    304307         * We don't want any area to have conflicts with NULL page.
     308         *
    305309         */
    306310        if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
     
    313317         * record in the left neighbour, the leftmost record in the right
    314318         * neighbour and all records in the leaf node itself.
     319         *
    315320         */
    316321        btree_node_t *leaf;
     
    373378         * So far, the area does not conflict with other areas.
    374379         * Check if it doesn't conflict with kernel address space.
     380         *
    375381         */
    376382        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
     
    427433        area->attributes = attrs;
    428434        area->pages = SIZE2FRAMES(size);
    429         area->resident = 0;
    430435        area->base = base;
    431436        area->sh_info = NULL;
     
    470475         * to find out whether this is a miss or va belongs to an address
    471476         * space area found there.
     477         *
    472478         */
    473479       
     
    489495         * Second, locate the left neighbour and test its last record.
    490496         * Because of its position in the B+tree, it must have base < va.
     497         *
    491498         */
    492499        btree_node_t *lnode = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf);
     
    523530        /*
    524531         * Locate the area.
     532         *
    525533         */
    526534        as_area_t *area = find_area_and_lock(as, address);
     
    534542                 * Remapping of address space areas associated
    535543                 * with memory mapped devices is not supported.
     544                 *
    536545                 */
    537546                mutex_unlock(&area->lock);
     
    544553                 * Remapping of shared address space areas
    545554                 * is not supported.
     555                 *
    546556                 */
    547557                mutex_unlock(&area->lock);
     
    554564                /*
    555565                 * Zero size address space areas are not allowed.
     566                 *
    556567                 */
    557568                mutex_unlock(&area->lock);
     
    566577                 * Shrinking the area.
    567578                 * No need to check for overlaps.
     579                 *
    568580                 */
    569581               
     
    572584                /*
    573585                 * Start TLB shootdown sequence.
     586                 *
    574587                 */
    575588                ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid,
     
    582595                 * is also the right way to remove part of the used_space
    583596                 * B+tree leaf list.
     597                 *
    584598                 */
    585599                bool cond = true;
     
    605619                                                 * completely in the resized
    606620                                                 * address space area.
     621                                                 *
    607622                                                 */
    608623                                                break;
     
    613628                                         * to b and c overlaps with the resized
    614629                                         * address space area.
     630                                         *
    615631                                         */
    616632                                       
     
    653669                /*
    654670                 * Finish TLB shootdown sequence.
     671                 *
    655672                 */
    656673               
     
    660677                /*
    661678                 * Invalidate software translation caches (e.g. TSB on sparc64).
     679                 *
    662680                 */
    663681                as_invalidate_translation_cache(as, area->base +
     
    670688                 * Growing the area.
    671689                 * Check for overlaps with other address space areas.
     690                 *
    672691                 */
    673692                if (!check_area_conflicts(as, address, pages * PAGE_SIZE,
     
    790809        /*
    791810         * Finish TLB shootdown sequence.
     811         *
    792812         */
    793813       
     
    797817         * Invalidate potential software translation caches (e.g. TSB on
    798818         * sparc64).
     819         *
    799820         */
    800821        as_invalidate_translation_cache(as, area->base, area->pages);
     
    814835        /*
    815836         * Remove the empty area from address space.
     837         *
    816838         */
    817839        btree_remove(&as->as_area_btree, base, NULL);
     
    855877                /*
    856878                 * Could not find the source address space area.
     879                 *
    857880                 */
    858881                mutex_unlock(&src_as->lock);
     
    864887                 * There is no backend or the backend does not
    865888                 * know how to share the area.
     889                 *
    866890                 */
    867891                mutex_unlock(&src_area->lock);
     
    890914         * First, prepare the area for sharing.
    891915         * Then it will be safe to unlock it.
     916         *
    892917         */
    893918        share_info_t *sh_info = src_area->sh_info;
     
    901926                /*
    902927                 * Call the backend to setup sharing.
     928                 *
    903929                 */
    904930                src_area->backend->share(src_area);
     
    919945         * The flags of the source area are masked against dst_flags_mask
    920946         * to support sharing in less privileged mode.
     947         *
    921948         */
    922949        as_area_t *dst_area = as_area_create(dst_as, dst_flags_mask, src_size,
     
    935962         * fully initialized. Clear the AS_AREA_ATTR_PARTIAL
    936963         * attribute and set the sh_info.
     964         *
    937965         */
    938966        mutex_lock(&dst_as->lock);
     
    957985NO_TRACE bool as_area_check_access(as_area_t *area, pf_access_t access)
    958986{
    959         ASSERT(mutex_locked(&area->lock));
    960        
    961987        int flagmap[] = {
    962988                [PF_ACCESS_READ] = AS_AREA_READ,
     
    964990                [PF_ACCESS_EXEC] = AS_AREA_EXEC
    965991        };
     992
     993        ASSERT(mutex_locked(&area->lock));
    966994       
    967995        if (!(area->flags & flagmap[access]))
     
    10341062        /*
    10351063         * Compute total number of used pages in the used_space B+tree
     1064         *
    10361065         */
    10371066        size_t used_pages = 0;
     
    10551084        /*
    10561085         * Start TLB shootdown sequence.
     1086         *
    10571087         */
    10581088        ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base,
     
    10621092         * Remove used pages from page tables and remember their frame
    10631093         * numbers.
     1094         *
    10641095         */
    10651096        size_t frame_idx = 0;
     
    10921123        /*
    10931124         * Finish TLB shootdown sequence.
     1125         *
    10941126         */
    10951127       
     
    10991131         * Invalidate potential software translation caches (e.g. TSB on
    11001132         * sparc64).
     1133         *
    11011134         */
    11021135        as_invalidate_translation_cache(as, area->base, area->pages);
     
    11801213                 * No area contained mapping for 'page'.
    11811214                 * Signal page fault to low-level handler.
     1215                 *
    11821216                 */
    11831217                mutex_unlock(&AS->lock);
     
    11991233                 * The address space area is not backed by any backend
    12001234                 * or the backend cannot handle page faults.
     1235                 *
    12011236                 */
    12021237                mutex_unlock(&area->lock);
     
    12101245         * To avoid race condition between two page faults on the same address,
    12111246         * we need to make sure the mapping has not been already inserted.
     1247         *
    12121248         */
    12131249        pte_t *pte;
     
    12271263        /*
    12281264         * Resort to the backend page fault handler.
     1265         *
    12291266         */
    12301267        if (area->backend->page_fault(area, page, access) != AS_PF_OK) {
     
    12811318                 * preemption is disabled. We should not be
    12821319                 * holding any other lock.
     1320                 *
    12831321                 */
    12841322                (void) interrupts_enable();
     
    13001338                         * list of inactive address spaces with assigned
    13011339                         * ASID.
     1340                         *
    13021341                         */
    13031342                        ASSERT(old_as->asid != ASID_INVALID);
     
    13101349                 * Perform architecture-specific tasks when the address space
    13111350                 * is being removed from the CPU.
     1351                 *
    13121352                 */
    13131353                as_deinstall_arch(old_as);
     
    13161356        /*
    13171357         * Second, prepare the new address space.
     1358         *
    13181359         */
    13191360        if ((new_as->cpu_refcount++ == 0) && (new_as != AS_KERNEL)) {
     
    13311372         * Perform architecture-specific steps.
    13321373         * (e.g. write ASID to hardware register etc.)
     1374         *
    13331375         */
    13341376        as_install_arch(new_as);
     
    13491391{
    13501392        ASSERT(mutex_locked(&area->lock));
    1351        
     1393
    13521394        return area_flags_to_page_flags(area->flags);
    13531395}
     
    14701512 * @param count Number of page to be marked.
    14711513 *
    1472  * @return False on failure or true on success.
    1473  *
    1474  */
    1475 bool used_space_insert(as_area_t *area, uintptr_t page, size_t count)
     1514 * @return Zero on failure and non-zero on success.
     1515 *
     1516 */
     1517int used_space_insert(as_area_t *area, uintptr_t page, size_t count)
    14761518{
    14771519        ASSERT(mutex_locked(&area->lock));
     
    14841526                /*
    14851527                 * We hit the beginning of some used space.
    1486                  */
    1487                 return false;
     1528                 *
     1529                 */
     1530                return 0;
    14881531        }
    14891532       
    14901533        if (!leaf->keys) {
    14911534                btree_insert(&area->used_space, page, (void *) count, leaf);
    1492                 goto success;
     1535                return 1;
    14931536        }
    14941537       
     
    15041547                 * somewhere between the rightmost interval of
    15051548                 * the left neigbour and the first interval of the leaf.
     1549                 *
    15061550                 */
    15071551               
     
    15111555                    left_cnt * PAGE_SIZE)) {
    15121556                        /* The interval intersects with the left interval. */
    1513                         return false;
     1557                        return 0;
    15141558                } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    15151559                    right_cnt * PAGE_SIZE)) {
    15161560                        /* The interval intersects with the right interval. */
    1517                         return false;
     1561                        return 0;
    15181562                } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    15191563                    (page + count * PAGE_SIZE == right_pg)) {
     
    15211565                         * The interval can be added by merging the two already
    15221566                         * present intervals.
     1567                         *
    15231568                         */
    15241569                        node->value[node->keys - 1] += count + right_cnt;
    15251570                        btree_remove(&area->used_space, right_pg, leaf);
    1526                         goto success;
     1571                        return 1;
    15271572                } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    15281573                        /*
    15291574                         * The interval can be added by simply growing the left
    15301575                         * interval.
     1576                         *
    15311577                         */
    15321578                        node->value[node->keys - 1] += count;
    1533                         goto success;
     1579                        return 1;
    15341580                } else if (page + count * PAGE_SIZE == right_pg) {
    15351581                        /*
     
    15371583                         * the right interval down and increasing its size
    15381584                         * accordingly.
     1585                         *
    15391586                         */
    15401587                        leaf->value[0] += count;
    15411588                        leaf->key[0] = page;
    1542                         goto success;
     1589                        return 1;
    15431590                } else {
    15441591                        /*
    15451592                         * The interval is between both neigbouring intervals,
    15461593                         * but cannot be merged with any of them.
     1594                         *
    15471595                         */
    15481596                        btree_insert(&area->used_space, page, (void *) count,
    15491597                            leaf);
    1550                         goto success;
     1598                        return 1;
    15511599                }
    15521600        } else if (page < leaf->key[0]) {
     
    15571605                 * Investigate the border case in which the left neighbour does
    15581606                 * not exist but the interval fits from the left.
     1607                 *
    15591608                 */
    15601609               
     
    15621611                    right_cnt * PAGE_SIZE)) {
    15631612                        /* The interval intersects with the right interval. */
    1564                         return false;
     1613                        return 0;
    15651614                } else if (page + count * PAGE_SIZE == right_pg) {
    15661615                        /*
     
    15681617                         * right interval down and increasing its size
    15691618                         * accordingly.
     1619                         *
    15701620                         */
    15711621                        leaf->key[0] = page;
    15721622                        leaf->value[0] += count;
    1573                         goto success;
     1623                        return 1;
    15741624                } else {
    15751625                        /*
    15761626                         * The interval doesn't adjoin with the right interval.
    15771627                         * It must be added individually.
     1628                         *
    15781629                         */
    15791630                        btree_insert(&area->used_space, page, (void *) count,
    15801631                            leaf);
    1581                         goto success;
     1632                        return 1;
    15821633                }
    15831634        }
     
    15941645                 * somewhere between the leftmost interval of
    15951646                 * the right neigbour and the last interval of the leaf.
     1647                 *
    15961648                 */
    15971649               
     
    16011653                    left_cnt * PAGE_SIZE)) {
    16021654                        /* The interval intersects with the left interval. */
    1603                         return false;
     1655                        return 0;
    16041656                } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    16051657                    right_cnt * PAGE_SIZE)) {
    16061658                        /* The interval intersects with the right interval. */
    1607                         return false;
     1659                        return 0;
    16081660                } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    16091661                    (page + count * PAGE_SIZE == right_pg)) {
     
    16111663                         * The interval can be added by merging the two already
    16121664                         * present intervals.
     1665                         *
    16131666                         */
    16141667                        leaf->value[leaf->keys - 1] += count + right_cnt;
    16151668                        btree_remove(&area->used_space, right_pg, node);
    1616                         goto success;
     1669                        return 1;
    16171670                } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    16181671                        /*
    16191672                         * The interval can be added by simply growing the left
    16201673                         * interval.
     1674                         *
    16211675                         */
    1622                         leaf->value[leaf->keys - 1] += count;
    1623                         goto success;
     1676                        leaf->value[leaf->keys - 1] +=  count;
     1677                        return 1;
    16241678                } else if (page + count * PAGE_SIZE == right_pg) {
    16251679                        /*
     
    16271681                         * the right interval down and increasing its size
    16281682                         * accordingly.
     1683                         *
    16291684                         */
    16301685                        node->value[0] += count;
    16311686                        node->key[0] = page;
    1632                         goto success;
     1687                        return 1;
    16331688                } else {
    16341689                        /*
    16351690                         * The interval is between both neigbouring intervals,
    16361691                         * but cannot be merged with any of them.
     1692                         *
    16371693                         */
    16381694                        btree_insert(&area->used_space, page, (void *) count,
    16391695                            leaf);
    1640                         goto success;
     1696                        return 1;
    16411697                }
    16421698        } else if (page >= leaf->key[leaf->keys - 1]) {
     
    16471703                 * Investigate the border case in which the right neighbour
    16481704                 * does not exist but the interval fits from the right.
     1705                 *
    16491706                 */
    16501707               
     
    16521709                    left_cnt * PAGE_SIZE)) {
    16531710                        /* The interval intersects with the left interval. */
    1654                         return false;
     1711                        return 0;
    16551712                } else if (left_pg + left_cnt * PAGE_SIZE == page) {
    16561713                        /*
    16571714                         * The interval can be added by growing the left
    16581715                         * interval.
     1716                         *
    16591717                         */
    16601718                        leaf->value[leaf->keys - 1] += count;
    1661                         goto success;
     1719                        return 1;
    16621720                } else {
    16631721                        /*
    16641722                         * The interval doesn't adjoin with the left interval.
    16651723                         * It must be added individually.
     1724                         *
    16661725                         */
    16671726                        btree_insert(&area->used_space, page, (void *) count,
    16681727                            leaf);
    1669                         goto success;
     1728                        return 1;
    16701729                }
    16711730        }
     
    16751734         * only between two other intervals of the leaf. The two border cases
    16761735         * were already resolved.
     1736         *
    16771737         */
    16781738        btree_key_t i;
     
    16861746                        /*
    16871747                         * The interval fits between left_pg and right_pg.
     1748                         *
    16881749                         */
    16891750                       
     
    16931754                                 * The interval intersects with the left
    16941755                                 * interval.
     1756                                 *
    16951757                                 */
    1696                                 return false;
     1758                                return 0;
    16971759                        } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    16981760                            right_cnt * PAGE_SIZE)) {
     
    17001762                                 * The interval intersects with the right
    17011763                                 * interval.
     1764                                 *
    17021765                                 */
    1703                                 return false;
     1766                                return 0;
    17041767                        } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    17051768                            (page + count * PAGE_SIZE == right_pg)) {
     
    17071770                                 * The interval can be added by merging the two
    17081771                                 * already present intervals.
     1772                                 *
    17091773                                 */
    17101774                                leaf->value[i - 1] += count + right_cnt;
    17111775                                btree_remove(&area->used_space, right_pg, leaf);
    1712                                 goto success;
     1776                                return 1;
    17131777                        } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    17141778                                /*
    17151779                                 * The interval can be added by simply growing
    17161780                                 * the left interval.
     1781                                 *
    17171782                                 */
    17181783                                leaf->value[i - 1] += count;
    1719                                 goto success;
     1784                                return 1;
    17201785                        } else if (page + count * PAGE_SIZE == right_pg) {
    17211786                                /*
     
    17231788                                 * base of the right interval down and
    17241789                                 * increasing its size accordingly.
     1790                                 *
    17251791                                 */
    17261792                                leaf->value[i] += count;
    17271793                                leaf->key[i] = page;
    1728                                 goto success;
     1794                                return 1;
    17291795                        } else {
    17301796                                /*
     
    17321798                                 * intervals, but cannot be merged with any of
    17331799                                 * them.
     1800                                 *
    17341801                                 */
    17351802                                btree_insert(&area->used_space, page,
    17361803                                    (void *) count, leaf);
    1737                                 goto success;
     1804                                return 1;
    17381805                        }
    17391806                }
     
    17421809        panic("Inconsistency detected while adding %zu pages of used "
    17431810            "space at %p.", count, (void *) page);
    1744        
    1745 success:
    1746         area->resident += count;
    1747         return true;
    17481811}
    17491812
     
    17561819 * @param count Number of page to be marked.
    17571820 *
    1758  * @return False on failure or true on success.
    1759  *
    1760  */
    1761 bool used_space_remove(as_area_t *area, uintptr_t page, size_t count)
     1821 * @return Zero on failure and non-zero on success.
     1822 *
     1823 */
     1824int used_space_remove(as_area_t *area, uintptr_t page, size_t count)
    17621825{
    17631826        ASSERT(mutex_locked(&area->lock));
     
    17701833                /*
    17711834                 * We are lucky, page is the beginning of some interval.
     1835                 *
    17721836                 */
    17731837                if (count > pages) {
    1774                         return false;
     1838                        return 0;
    17751839                } else if (count == pages) {
    17761840                        btree_remove(&area->used_space, page, leaf);
    1777                         goto success;
     1841                        return 1;
    17781842                } else {
    17791843                        /*
    17801844                         * Find the respective interval.
    17811845                         * Decrease its size and relocate its start address.
     1846                         *
    17821847                         */
    17831848                        btree_key_t i;
     
    17861851                                        leaf->key[i] += count * PAGE_SIZE;
    17871852                                        leaf->value[i] -= count;
    1788                                         goto success;
     1853                                        return 1;
    17891854                                }
    17901855                        }
    1791                        
    17921856                        goto error;
    17931857                }
     
    18081872                                 * removed by updating the size of the bigger
    18091873                                 * interval.
     1874                                 *
    18101875                                 */
    18111876                                node->value[node->keys - 1] -= count;
    1812                                 goto success;
     1877                                return 1;
    18131878                        } else if (page + count * PAGE_SIZE <
    18141879                            left_pg + left_cnt*PAGE_SIZE) {
     
    18191884                                 * the original interval and also inserting a
    18201885                                 * new interval.
     1886                                 *
    18211887                                 */
    18221888                                size_t new_cnt = ((left_pg + left_cnt * PAGE_SIZE) -
     
    18251891                                btree_insert(&area->used_space, page +
    18261892                                    count * PAGE_SIZE, (void *) new_cnt, leaf);
    1827                                 goto success;
     1893                                return 1;
    18281894                        }
    18291895                }
    1830                
    1831                 return false;
     1896                return 0;
    18321897        } else if (page < leaf->key[0])
    1833                 return false;
     1898                return 0;
    18341899       
    18351900        if (page > leaf->key[leaf->keys - 1]) {
     
    18451910                                 * interval of the leaf and can be removed by
    18461911                                 * updating the size of the bigger interval.
     1912                                 *
    18471913                                 */
    18481914                                leaf->value[leaf->keys - 1] -= count;
    1849                                 goto success;
     1915                                return 1;
    18501916                        } else if (page + count * PAGE_SIZE < left_pg +
    18511917                            left_cnt * PAGE_SIZE) {
     
    18561922                                 * original interval and also inserting a new
    18571923                                 * interval.
     1924                                 *
    18581925                                 */
    18591926                                size_t new_cnt = ((left_pg + left_cnt * PAGE_SIZE) -
     
    18621929                                btree_insert(&area->used_space, page +
    18631930                                    count * PAGE_SIZE, (void *) new_cnt, leaf);
    1864                                 goto success;
     1931                                return 1;
    18651932                        }
    18661933                }
    1867                
    1868                 return false;
     1934                return 0;
    18691935        }
    18701936       
    18711937        /*
    18721938         * The border cases have been already resolved.
    1873          * Now the interval can be only between intervals of the leaf.
     1939         * Now the interval can be only between intervals of the leaf. 
    18741940         */
    18751941        btree_key_t i;
     
    18921958                                         * be removed by updating the size of
    18931959                                         * the bigger interval.
     1960                                         *
    18941961                                         */
    18951962                                        leaf->value[i - 1] -= count;
    1896                                         goto success;
     1963                                        return 1;
    18971964                                } else if (page + count * PAGE_SIZE <
    18981965                                    left_pg + left_cnt * PAGE_SIZE) {
     
    19121979                                            count * PAGE_SIZE, (void *) new_cnt,
    19131980                                            leaf);
    1914                                         goto success;
     1981                                        return 1;
    19151982                                }
    19161983                        }
    1917                        
    1918                         return false;
     1984                        return 0;
    19191985                }
    19201986        }
     
    19231989        panic("Inconsistency detected while removing %zu pages of used "
    19241990            "space from %p.", count, (void *) page);
    1925        
    1926 success:
    1927         area->resident -= count;
    1928         return true;
    19291991}
    19301992
Note: See TracChangeset for help on using the changeset viewer.