Changeset 7fc092a in mainline for uspace/lib/c/generic/as.c


Ignore:
Timestamp:
2011-01-27T22:09:29Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
db7ed07
Parents:
9ee87f6 (diff), 6265a2b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Changes from development branch

File:
1 edited

Legend:

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

    r9ee87f6 r7fc092a  
    3535#include <as.h>
    3636#include <libc.h>
     37#include <errno.h>
    3738#include <unistd.h>
    3839#include <align.h>
     
    128129}
    129130
     131/** Find mapping to physical address.
     132 *
     133 * @param address Virtual address in question (virtual).
     134 * @param[out] frame Frame address (physical).
     135 * @return Error code.
     136 * @retval EOK No error, @p frame holds the translation.
     137 * @retval ENOENT Mapping not found.
     138 */
     139int as_get_physical_mapping(void *address, uintptr_t *frame)
     140{
     141        uintptr_t tmp_frame;
     142        uintptr_t virt = (uintptr_t) address;
     143       
     144        int rc = (int) __SYSCALL2(SYS_PAGE_FIND_MAPPING,
     145            (sysarg_t) virt, (sysarg_t) &tmp_frame);
     146        if (rc != EOK) {
     147                return rc;
     148        }
     149       
     150        if (frame != NULL) {
     151                *frame = tmp_frame;
     152        }
     153       
     154        return EOK;
     155}
     156
    130157/** @}
    131158 */
Note: See TracChangeset for help on using the changeset viewer.