Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/as.c

    rc6ae4c2 r8d70937  
    117117/** Find mapping to physical address.
    118118 *
    119  * @param      virt Virtual address to find mapping for.
    120  * @param[out] phys Physical adress.
    121  *
    122  * @return EOK on no error.
    123  * @retval ENOENT if no mapping was found.
    124  *
     119 * @param address Virtual address in question (virtual).
     120 * @param[out] frame Frame address (physical).
     121 * @return Error code.
     122 * @retval EOK No error, @p frame holds the translation.
     123 * @retval ENOENT Mapping not found.
    125124 */
    126 int as_get_physical_mapping(const void *virt, uintptr_t *phys)
     125int as_get_physical_mapping(const void *address, uintptr_t *frame)
    127126{
    128         return (int) __SYSCALL2(SYS_PAGE_FIND_MAPPING, (sysarg_t) virt,
    129             (sysarg_t) phys);
     127        uintptr_t tmp_frame;
     128        uintptr_t virt = (uintptr_t) address;
     129       
     130        int rc = (int) __SYSCALL2(SYS_PAGE_FIND_MAPPING,
     131            (sysarg_t) virt, (sysarg_t) &tmp_frame);
     132        if (rc != EOK) {
     133                return rc;
     134        }
     135       
     136        if (frame != NULL) {
     137                *frame = tmp_frame;
     138        }
     139       
     140        return EOK;
    130141}
    131142
Note: See TracChangeset for help on using the changeset viewer.