lib/aos/paging.c
errval_t paging_region_init(struct paging_state *st, struct paging_region *pr,
                            size_t size)
{
    void *base;
    errval_t err = paging_alloc(st, &base, size);
    if (err_is_fail(err)) {
        debug_printf("paging_region_init: paging_alloc failed\n");
        return err_push(err, LIB_ERR_VSPACE_MMU_AWARE_INIT);
    }
    pr->base_addr    = (lvaddr_t)base;
    pr->current_addr = pr->base_addr;
    pr->region_size  = size;

    // TODO: maybe add paging regions to paging state?
    return SYS_ERR_OK;
}
/**
 * \brief return a pointer to a bit of the paging region `pr`.
 * This function gets used in some of the code that is responsible
 * for allocating Frame (and other) capabilities.
 */
\brief return a pointer to a bit of the paging region `pr`.
This function gets used in some of the code that is responsible
for allocating Frame (and other) capabilities.
\ brief return a pointer to a bit of the paging region ` pr ` . This function gets used in some of the code that is responsible for allocating Frame ( and other ) capabilities .
errval_t paging_region_init(struct paging_state *st, struct paging_region *pr,
                            size_t size)
{
    void *base;
    errval_t err = paging_alloc(st, &base, size);
    if (err_is_fail(err)) {
        debug_printf("paging_region_init: paging_alloc failed\n");
        return err_push(err, LIB_ERR_VSPACE_MMU_AWARE_INIT);
    }
    pr->base_addr    = (lvaddr_t)base;
    pr->current_addr = pr->base_addr;
    pr->region_size  = size;
    return SYS_ERR_OK;
}
errval_t paging_region_init ( struct paging_state * st , struct paging_region * pr , size_t size ) { void * base ; errval_t err = paging_alloc ( st , & base , size ) ; if ( err_is_fail ( err ) ) { debug_printf ( " \n " ) ; return err_push ( err , LIB_ERR_VSPACE_MMU_AWARE_INIT ) ; } pr -> base_addr = ( lvaddr_t ) base ; pr -> current_addr = pr -> base_addr ; pr -> region_size = size ; return SYS_ERR_OK ; }
\brief return a pointer to a bit of the paging region `pr`.
\ brief return a pointer to a bit of the paging region ` pr ` .
// TODO: maybe add paging regions to paging state?