Ignore:
File:
1 edited

Legend:

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

    rfc47885 r7e752b2  
    8686 * Each architecture decides what functions will be used to carry out
    8787 * address space operations such as creating or locking page tables.
     88 *
    8889 */
    8990as_operations_t *as_operations = NULL;
    9091
    91 /** Slab for as_t objects.
     92/**
     93 * Slab for as_t objects.
    9294 *
    9395 */
    9496static slab_cache_t *as_slab;
    9597
    96 /** ASID subsystem lock.
    97  *
    98  * This lock protects:
     98/**
     99 * This lock serializes access to the ASID subsystem.
     100 * It protects:
    99101 * - inactive_as_with_asid_head list
    100102 * - as->asid for each as of the as_t type
     
    105107
    106108/**
    107  * Inactive address spaces (on all processors)
    108  * that have valid ASID.
     109 * This list contains address spaces that are not active on any
     110 * processor and that have valid ASID.
     111 *
    109112 */
    110113LIST_INITIALIZE(inactive_as_with_asid_head);
     
    120123        mutex_initialize(&as->lock, MUTEX_PASSIVE);
    121124       
    122         return as_constructor_arch(as, flags);
     125        int rc = as_constructor_arch(as, flags);
     126       
     127        return rc;
    123128}
    124129
    125130NO_TRACE static size_t as_destructor(void *obj)
    126131{
    127         return as_destructor_arch((as_t *) obj);
     132        as_t *as = (as_t *) obj;
     133        return as_destructor_arch(as);
    128134}
    129135
     
    140146                panic("Cannot create kernel address space.");
    141147       
    142         /*
    143          * Make sure the kernel address space
     148        /* Make sure the kernel address space
    144149         * reference count never drops to zero.
    145150         */
     
    190195{
    191196        DEADLOCK_PROBE_INIT(p_asidlock);
    192        
     197
    193198        ASSERT(as != AS);
    194199        ASSERT(atomic_get(&as->refcount) == 0);
     
    198203         * lock its mutex.
    199204         */
    200        
     205
    201206        /*
    202207         * We need to avoid deadlock between TLB shootdown and asidlock.
     
    205210         * disabled to prevent nested context switches. We also depend on the
    206211         * fact that so far no spinlocks are held.
     212         *
    207213         */
    208214        preemption_disable();
     
    229235        spinlock_unlock(&asidlock);
    230236        interrupts_restore(ipl);
    231        
     237
    232238       
    233239        /*
     
    235241         * The B+tree must be walked carefully because it is
    236242         * also being destroyed.
     243         *
    237244         */
    238245        bool cond = true;
     
    261268/** Hold a reference to an address space.
    262269 *
    263  * Holding a reference to an address space prevents destruction
    264  * of that address space.
     270 * Holding a reference to an address space prevents destruction of that address
     271 * space.
    265272 *
    266273 * @param as Address space to be held.
     
    274281/** Release a reference to an address space.
    275282 *
    276  * The last one to release a reference to an address space
    277  * destroys the address space.
     283 * The last one to release a reference to an address space destroys the address
     284 * space.
    278285 *
    279286 * @param asAddress space to be released.
     
    303310        /*
    304311         * We don't want any area to have conflicts with NULL page.
     312         *
    305313         */
    306314        if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
     
    313321         * record in the left neighbour, the leftmost record in the right
    314322         * neighbour and all records in the leaf node itself.
     323         *
    315324         */
    316325        btree_node_t *leaf;
     
    373382         * So far, the area does not conflict with other areas.
    374383         * Check if it doesn't conflict with kernel address space.
     384         *
    375385         */
    376386        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
     
    427437        area->attributes = attrs;
    428438        area->pages = SIZE2FRAMES(size);
    429         area->resident = 0;
    430439        area->base = base;
    431440        area->sh_info = NULL;
     
    470479         * to find out whether this is a miss or va belongs to an address
    471480         * space area found there.
     481         *
    472482         */
    473483       
     
    489499         * Second, locate the left neighbour and test its last record.
    490500         * Because of its position in the B+tree, it must have base < va.
     501         *
    491502         */
    492503        btree_node_t *lnode = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf);
     
    523534        /*
    524535         * Locate the area.
     536         *
    525537         */
    526538        as_area_t *area = find_area_and_lock(as, address);
     
    534546                 * Remapping of address space areas associated
    535547                 * with memory mapped devices is not supported.
     548                 *
    536549                 */
    537550                mutex_unlock(&area->lock);
     
    544557                 * Remapping of shared address space areas
    545558                 * is not supported.
     559                 *
    546560                 */
    547561                mutex_unlock(&area->lock);
     
    554568                /*
    555569                 * Zero size address space areas are not allowed.
     570                 *
    556571                 */
    557572                mutex_unlock(&area->lock);
     
    566581                 * Shrinking the area.
    567582                 * No need to check for overlaps.
     583                 *
    568584                 */
    569585               
     
    572588                /*
    573589                 * Start TLB shootdown sequence.
     590                 *
    574591                 */
    575592                ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid,
     
    582599                 * is also the right way to remove part of the used_space
    583600                 * B+tree leaf list.
     601                 *
    584602                 */
    585603                bool cond = true;
     
    605623                                                 * completely in the resized
    606624                                                 * address space area.
     625                                                 *
    607626                                                 */
    608627                                                break;
     
    613632                                         * to b and c overlaps with the resized
    614633                                         * address space area.
     634                                         *
    615635                                         */
    616636                                       
     
    653673                /*
    654674                 * Finish TLB shootdown sequence.
     675                 *
    655676                 */
    656677               
     
    660681                /*
    661682                 * Invalidate software translation caches (e.g. TSB on sparc64).
     683                 *
    662684                 */
    663685                as_invalidate_translation_cache(as, area->base +
     
    670692                 * Growing the area.
    671693                 * Check for overlaps with other address space areas.
     694                 *
    672695                 */
    673696                if (!check_area_conflicts(as, address, pages * PAGE_SIZE,
     
    790813        /*
    791814         * Finish TLB shootdown sequence.
     815         *
    792816         */
    793817       
     
    797821         * Invalidate potential software translation caches (e.g. TSB on
    798822         * sparc64).
     823         *
    799824         */
    800825        as_invalidate_translation_cache(as, area->base, area->pages);
     
    814839        /*
    815840         * Remove the empty area from address space.
     841         *
    816842         */
    817843        btree_remove(&as->as_area_btree, base, NULL);
     
    855881                /*
    856882                 * Could not find the source address space area.
     883                 *
    857884                 */
    858885                mutex_unlock(&src_as->lock);
     
    864891                 * There is no backend or the backend does not
    865892                 * know how to share the area.
     893                 *
    866894                 */
    867895                mutex_unlock(&src_area->lock);
     
    890918         * First, prepare the area for sharing.
    891919         * Then it will be safe to unlock it.
     920         *
    892921         */
    893922        share_info_t *sh_info = src_area->sh_info;
     
    901930                /*
    902931                 * Call the backend to setup sharing.
     932                 *
    903933                 */
    904934                src_area->backend->share(src_area);
     
    919949         * The flags of the source area are masked against dst_flags_mask
    920950         * to support sharing in less privileged mode.
     951         *
    921952         */
    922953        as_area_t *dst_area = as_area_create(dst_as, dst_flags_mask, src_size,
     
    935966         * fully initialized. Clear the AS_AREA_ATTR_PARTIAL
    936967         * attribute and set the sh_info.
     968         *
    937969         */
    938970        mutex_lock(&dst_as->lock);
     
    957989NO_TRACE bool as_area_check_access(as_area_t *area, pf_access_t access)
    958990{
    959         ASSERT(mutex_locked(&area->lock));
    960        
    961991        int flagmap[] = {
    962992                [PF_ACCESS_READ] = AS_AREA_READ,
     
    964994                [PF_ACCESS_EXEC] = AS_AREA_EXEC
    965995        };
     996
     997        ASSERT(mutex_locked(&area->lock));
    966998       
    967999        if (!(area->flags & flagmap[access]))
     
    10341066        /*
    10351067         * Compute total number of used pages in the used_space B+tree
     1068         *
    10361069         */
    10371070        size_t used_pages = 0;
     
    10551088        /*
    10561089         * Start TLB shootdown sequence.
     1090         *
    10571091         */
    10581092        ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base,
     
    10621096         * Remove used pages from page tables and remember their frame
    10631097         * numbers.
     1098         *
    10641099         */
    10651100        size_t frame_idx = 0;
     
    10921127        /*
    10931128         * Finish TLB shootdown sequence.
     1129         *
    10941130         */
    10951131       
     
    10991135         * Invalidate potential software translation caches (e.g. TSB on
    11001136         * sparc64).
     1137         *
    11011138         */
    11021139        as_invalidate_translation_cache(as, area->base, area->pages);
     
    11801217                 * No area contained mapping for 'page'.
    11811218                 * Signal page fault to low-level handler.
     1219                 *
    11821220                 */
    11831221                mutex_unlock(&AS->lock);
     
    11991237                 * The address space area is not backed by any backend
    12001238                 * or the backend cannot handle page faults.
     1239                 *
    12011240                 */
    12021241                mutex_unlock(&area->lock);
     
    12101249         * To avoid race condition between two page faults on the same address,
    12111250         * we need to make sure the mapping has not been already inserted.
     1251         *
    12121252         */
    12131253        pte_t *pte;
     
    12271267        /*
    12281268         * Resort to the backend page fault handler.
     1269         *
    12291270         */
    12301271        if (area->backend->page_fault(area, page, access) != AS_PF_OK) {
     
    12811322                 * preemption is disabled. We should not be
    12821323                 * holding any other lock.
     1324                 *
    12831325                 */
    12841326                (void) interrupts_enable();
     
    13001342                         * list of inactive address spaces with assigned
    13011343                         * ASID.
     1344                         *
    13021345                         */
    13031346                        ASSERT(old_as->asid != ASID_INVALID);
     
    13101353                 * Perform architecture-specific tasks when the address space
    13111354                 * is being removed from the CPU.
     1355                 *
    13121356                 */
    13131357                as_deinstall_arch(old_as);
     
    13161360        /*
    13171361         * Second, prepare the new address space.
     1362         *
    13181363         */
    13191364        if ((new_as->cpu_refcount++ == 0) && (new_as != AS_KERNEL)) {
     
    13311376         * Perform architecture-specific steps.
    13321377         * (e.g. write ASID to hardware register etc.)
     1378         *
    13331379         */
    13341380        as_install_arch(new_as);
     
    13491395{
    13501396        ASSERT(mutex_locked(&area->lock));
    1351        
     1397
    13521398        return area_flags_to_page_flags(area->flags);
    13531399}
     
    14701516 * @param count Number of page to be marked.
    14711517 *
    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)
     1518 * @return Zero on failure and non-zero on success.
     1519 *
     1520 */
     1521int used_space_insert(as_area_t *area, uintptr_t page, size_t count)
    14761522{
    14771523        ASSERT(mutex_locked(&area->lock));
     
    14841530                /*
    14851531                 * We hit the beginning of some used space.
    1486                  */
    1487                 return false;
     1532                 *
     1533                 */
     1534                return 0;
    14881535        }
    14891536       
    14901537        if (!leaf->keys) {
    14911538                btree_insert(&area->used_space, page, (void *) count, leaf);
    1492                 goto success;
     1539                return 1;
    14931540        }
    14941541       
     
    15041551                 * somewhere between the rightmost interval of
    15051552                 * the left neigbour and the first interval of the leaf.
     1553                 *
    15061554                 */
    15071555               
     
    15111559                    left_cnt * PAGE_SIZE)) {
    15121560                        /* The interval intersects with the left interval. */
    1513                         return false;
     1561                        return 0;
    15141562                } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    15151563                    right_cnt * PAGE_SIZE)) {
    15161564                        /* The interval intersects with the right interval. */
    1517                         return false;
     1565                        return 0;
    15181566                } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    15191567                    (page + count * PAGE_SIZE == right_pg)) {
     
    15211569                         * The interval can be added by merging the two already
    15221570                         * present intervals.
     1571                         *
    15231572                         */
    15241573                        node->value[node->keys - 1] += count + right_cnt;
    15251574                        btree_remove(&area->used_space, right_pg, leaf);
    1526                         goto success;
     1575                        return 1;
    15271576                } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    15281577                        /*
    15291578                         * The interval can be added by simply growing the left
    15301579                         * interval.
     1580                         *
    15311581                         */
    15321582                        node->value[node->keys - 1] += count;
    1533                         goto success;
     1583                        return 1;
    15341584                } else if (page + count * PAGE_SIZE == right_pg) {
    15351585                        /*
     
    15371587                         * the right interval down and increasing its size
    15381588                         * accordingly.
     1589                         *
    15391590                         */
    15401591                        leaf->value[0] += count;
    15411592                        leaf->key[0] = page;
    1542                         goto success;
     1593                        return 1;
    15431594                } else {
    15441595                        /*
    15451596                         * The interval is between both neigbouring intervals,
    15461597                         * but cannot be merged with any of them.
     1598                         *
    15471599                         */
    15481600                        btree_insert(&area->used_space, page, (void *) count,
    15491601                            leaf);
    1550                         goto success;
     1602                        return 1;
    15511603                }
    15521604        } else if (page < leaf->key[0]) {
     
    15571609                 * Investigate the border case in which the left neighbour does
    15581610                 * not exist but the interval fits from the left.
     1611                 *
    15591612                 */
    15601613               
     
    15621615                    right_cnt * PAGE_SIZE)) {
    15631616                        /* The interval intersects with the right interval. */
    1564                         return false;
     1617                        return 0;
    15651618                } else if (page + count * PAGE_SIZE == right_pg) {
    15661619                        /*
     
    15681621                         * right interval down and increasing its size
    15691622                         * accordingly.
     1623                         *
    15701624                         */
    15711625                        leaf->key[0] = page;
    15721626                        leaf->value[0] += count;
    1573                         goto success;
     1627                        return 1;
    15741628                } else {
    15751629                        /*
    15761630                         * The interval doesn't adjoin with the right interval.
    15771631                         * It must be added individually.
     1632                         *
    15781633                         */
    15791634                        btree_insert(&area->used_space, page, (void *) count,
    15801635                            leaf);
    1581                         goto success;
     1636                        return 1;
    15821637                }
    15831638        }
     
    15941649                 * somewhere between the leftmost interval of
    15951650                 * the right neigbour and the last interval of the leaf.
     1651                 *
    15961652                 */
    15971653               
     
    16011657                    left_cnt * PAGE_SIZE)) {
    16021658                        /* The interval intersects with the left interval. */
    1603                         return false;
     1659                        return 0;
    16041660                } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    16051661                    right_cnt * PAGE_SIZE)) {
    16061662                        /* The interval intersects with the right interval. */
    1607                         return false;
     1663                        return 0;
    16081664                } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    16091665                    (page + count * PAGE_SIZE == right_pg)) {
     
    16111667                         * The interval can be added by merging the two already
    16121668                         * present intervals.
     1669                         *
    16131670                         */
    16141671                        leaf->value[leaf->keys - 1] += count + right_cnt;
    16151672                        btree_remove(&area->used_space, right_pg, node);
    1616                         goto success;
     1673                        return 1;
    16171674                } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    16181675                        /*
    16191676                         * The interval can be added by simply growing the left
    16201677                         * interval.
     1678                         *
    16211679                         */
    1622                         leaf->value[leaf->keys - 1] += count;
    1623                         goto success;
     1680                        leaf->value[leaf->keys - 1] +=  count;
     1681                        return 1;
    16241682                } else if (page + count * PAGE_SIZE == right_pg) {
    16251683                        /*
     
    16271685                         * the right interval down and increasing its size
    16281686                         * accordingly.
     1687                         *
    16291688                         */
    16301689                        node->value[0] += count;
    16311690                        node->key[0] = page;
    1632                         goto success;
     1691                        return 1;
    16331692                } else {
    16341693                        /*
    16351694                         * The interval is between both neigbouring intervals,
    16361695                         * but cannot be merged with any of them.
     1696                         *
    16371697                         */
    16381698                        btree_insert(&area->used_space, page, (void *) count,
    16391699                            leaf);
    1640                         goto success;
     1700                        return 1;
    16411701                }
    16421702        } else if (page >= leaf->key[leaf->keys - 1]) {
     
    16471707                 * Investigate the border case in which the right neighbour
    16481708                 * does not exist but the interval fits from the right.
     1709                 *
    16491710                 */
    16501711               
     
    16521713                    left_cnt * PAGE_SIZE)) {
    16531714                        /* The interval intersects with the left interval. */
    1654                         return false;
     1715                        return 0;
    16551716                } else if (left_pg + left_cnt * PAGE_SIZE == page) {
    16561717                        /*
    16571718                         * The interval can be added by growing the left
    16581719                         * interval.
     1720                         *
    16591721                         */
    16601722                        leaf->value[leaf->keys - 1] += count;
    1661                         goto success;
     1723                        return 1;
    16621724                } else {
    16631725                        /*
    16641726                         * The interval doesn't adjoin with the left interval.
    16651727                         * It must be added individually.
     1728                         *
    16661729                         */
    16671730                        btree_insert(&area->used_space, page, (void *) count,
    16681731                            leaf);
    1669                         goto success;
     1732                        return 1;
    16701733                }
    16711734        }
     
    16751738         * only between two other intervals of the leaf. The two border cases
    16761739         * were already resolved.
     1740         *
    16771741         */
    16781742        btree_key_t i;
     
    16861750                        /*
    16871751                         * The interval fits between left_pg and right_pg.
     1752                         *
    16881753                         */
    16891754                       
     
    16931758                                 * The interval intersects with the left
    16941759                                 * interval.
     1760                                 *
    16951761                                 */
    1696                                 return false;
     1762                                return 0;
    16971763                        } else if (overlaps(page, count * PAGE_SIZE, right_pg,
    16981764                            right_cnt * PAGE_SIZE)) {
     
    17001766                                 * The interval intersects with the right
    17011767                                 * interval.
     1768                                 *
    17021769                                 */
    1703                                 return false;
     1770                                return 0;
    17041771                        } else if ((page == left_pg + left_cnt * PAGE_SIZE) &&
    17051772                            (page + count * PAGE_SIZE == right_pg)) {
     
    17071774                                 * The interval can be added by merging the two
    17081775                                 * already present intervals.
     1776                                 *
    17091777                                 */
    17101778                                leaf->value[i - 1] += count + right_cnt;
    17111779                                btree_remove(&area->used_space, right_pg, leaf);
    1712                                 goto success;
     1780                                return 1;
    17131781                        } else if (page == left_pg + left_cnt * PAGE_SIZE) {
    17141782                                /*
    17151783                                 * The interval can be added by simply growing
    17161784                                 * the left interval.
     1785                                 *
    17171786                                 */
    17181787                                leaf->value[i - 1] += count;
    1719                                 goto success;
     1788                                return 1;
    17201789                        } else if (page + count * PAGE_SIZE == right_pg) {
    17211790                                /*
     
    17231792                                 * base of the right interval down and
    17241793                                 * increasing its size accordingly.
     1794                                 *
    17251795                                 */
    17261796                                leaf->value[i] += count;
    17271797                                leaf->key[i] = page;
    1728                                 goto success;
     1798                                return 1;
    17291799                        } else {
    17301800                                /*
     
    17321802                                 * intervals, but cannot be merged with any of
    17331803                                 * them.
     1804                                 *
    17341805                                 */
    17351806                                btree_insert(&area->used_space, page,
    17361807                                    (void *) count, leaf);
    1737                                 goto success;
     1808                                return 1;
    17381809                        }
    17391810                }
     
    17421813        panic("Inconsistency detected while adding %zu pages of used "
    17431814            "space at %p.", count, (void *) page);
    1744        
    1745 success:
    1746         area->resident += count;
    1747         return true;
    17481815}
    17491816
     
    17561823 * @param count Number of page to be marked.
    17571824 *
    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)
     1825 * @return Zero on failure and non-zero on success.
     1826 *
     1827 */
     1828int used_space_remove(as_area_t *area, uintptr_t page, size_t count)
    17621829{
    17631830        ASSERT(mutex_locked(&area->lock));
     
    17701837                /*
    17711838                 * We are lucky, page is the beginning of some interval.
     1839                 *
    17721840                 */
    17731841                if (count > pages) {
    1774                         return false;
     1842                        return 0;
    17751843                } else if (count == pages) {
    17761844                        btree_remove(&area->used_space, page, leaf);
    1777                         goto success;
     1845                        return 1;
    17781846                } else {
    17791847                        /*
    17801848                         * Find the respective interval.
    17811849                         * Decrease its size and relocate its start address.
     1850                         *
    17821851                         */
    17831852                        btree_key_t i;
     
    17861855                                        leaf->key[i] += count * PAGE_SIZE;
    17871856                                        leaf->value[i] -= count;
    1788                                         goto success;
     1857                                        return 1;
    17891858                                }
    17901859                        }
    1791                        
    17921860                        goto error;
    17931861                }
     
    18081876                                 * removed by updating the size of the bigger
    18091877                                 * interval.
     1878                                 *
    18101879                                 */
    18111880                                node->value[node->keys - 1] -= count;
    1812                                 goto success;
     1881                                return 1;
    18131882                        } else if (page + count * PAGE_SIZE <
    18141883                            left_pg + left_cnt*PAGE_SIZE) {
     
    18191888                                 * the original interval and also inserting a
    18201889                                 * new interval.
     1890                                 *
    18211891                                 */
    18221892                                size_t new_cnt = ((left_pg + left_cnt * PAGE_SIZE) -
     
    18251895                                btree_insert(&area->used_space, page +
    18261896                                    count * PAGE_SIZE, (void *) new_cnt, leaf);
    1827                                 goto success;
     1897                                return 1;
    18281898                        }
    18291899                }
    1830                
    1831                 return false;
     1900                return 0;
    18321901        } else if (page < leaf->key[0])
    1833                 return false;
     1902                return 0;
    18341903       
    18351904        if (page > leaf->key[leaf->keys - 1]) {
     
    18451914                                 * interval of the leaf and can be removed by
    18461915                                 * updating the size of the bigger interval.
     1916                                 *
    18471917                                 */
    18481918                                leaf->value[leaf->keys - 1] -= count;
    1849                                 goto success;
     1919                                return 1;
    18501920                        } else if (page + count * PAGE_SIZE < left_pg +
    18511921                            left_cnt * PAGE_SIZE) {
     
    18561926                                 * original interval and also inserting a new
    18571927                                 * interval.
     1928                                 *
    18581929                                 */
    18591930                                size_t new_cnt = ((left_pg + left_cnt * PAGE_SIZE) -
     
    18621933                                btree_insert(&area->used_space, page +
    18631934                                    count * PAGE_SIZE, (void *) new_cnt, leaf);
    1864                                 goto success;
     1935                                return 1;
    18651936                        }
    18661937                }
    1867                
    1868                 return false;
     1938                return 0;
    18691939        }
    18701940       
    18711941        /*
    18721942         * The border cases have been already resolved.
    1873          * Now the interval can be only between intervals of the leaf.
     1943         * Now the interval can be only between intervals of the leaf. 
    18741944         */
    18751945        btree_key_t i;
     
    18921962                                         * be removed by updating the size of
    18931963                                         * the bigger interval.
     1964                                         *
    18941965                                         */
    18951966                                        leaf->value[i - 1] -= count;
    1896                                         goto success;
     1967                                        return 1;
    18971968                                } else if (page + count * PAGE_SIZE <
    18981969                                    left_pg + left_cnt * PAGE_SIZE) {
     
    19121983                                            count * PAGE_SIZE, (void *) new_cnt,
    19131984                                            leaf);
    1914                                         goto success;
     1985                                        return 1;
    19151986                                }
    19161987                        }
    1917                        
    1918                         return false;
     1988                        return 0;
    19191989                }
    19201990        }
     
    19231993        panic("Inconsistency detected while removing %zu pages of used "
    19241994            "space from %p.", count, (void *) page);
    1925        
    1926 success:
    1927         area->resident -= count;
    1928         return true;
    19291995}
    19301996
     
    19342000
    19352001/** Wrapper for as_area_create(). */
    1936 sysarg_t sys_as_area_create(uintptr_t address, size_t size, unsigned int flags)
     2002unative_t sys_as_area_create(uintptr_t address, size_t size, unsigned int flags)
    19372003{
    19382004        if (as_area_create(AS, flags | AS_AREA_CACHEABLE, size, address,
    19392005            AS_AREA_ATTR_NONE, &anon_backend, NULL))
    1940                 return (sysarg_t) address;
     2006                return (unative_t) address;
    19412007        else
    1942                 return (sysarg_t) -1;
     2008                return (unative_t) -1;
    19432009}
    19442010
    19452011/** Wrapper for as_area_resize(). */
    1946 sysarg_t sys_as_area_resize(uintptr_t address, size_t size, unsigned int flags)
    1947 {
    1948         return (sysarg_t) as_area_resize(AS, address, size, 0);
     2012unative_t sys_as_area_resize(uintptr_t address, size_t size, unsigned int flags)
     2013{
     2014        return (unative_t) as_area_resize(AS, address, size, 0);
    19492015}
    19502016
    19512017/** Wrapper for as_area_change_flags(). */
    1952 sysarg_t sys_as_area_change_flags(uintptr_t address, unsigned int flags)
    1953 {
    1954         return (sysarg_t) as_area_change_flags(AS, flags, address);
     2018unative_t sys_as_area_change_flags(uintptr_t address, unsigned int flags)
     2019{
     2020        return (unative_t) as_area_change_flags(AS, flags, address);
    19552021}
    19562022
    19572023/** Wrapper for as_area_destroy(). */
    1958 sysarg_t sys_as_area_destroy(uintptr_t address)
    1959 {
    1960         return (sysarg_t) as_area_destroy(AS, address);
     2024unative_t sys_as_area_destroy(uintptr_t address)
     2025{
     2026        return (unative_t) as_area_destroy(AS, address);
    19612027}
    19622028
Note: See TracChangeset for help on using the changeset viewer.