Changeset 1affcdf3 in mainline for uspace/lib/c/generic/as.c


Ignore:
Timestamp:
2011-06-10T19:33:41Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1878386
Parents:
13ecdac9 (diff), 79a141a (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:

Merge mainline changes

File:
1 edited

Legend:

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

    r13ecdac9 r1affcdf3  
    3535#include <as.h>
    3636#include <libc.h>
     37#include <errno.h>
    3738#include <unistd.h>
    3839#include <align.h>
     
    5152 *
    5253 */
    53 void *as_area_create(void *address, size_t size, int flags)
     54void *as_area_create(void *address, size_t size, unsigned int flags)
    5455{
    5556        return (void *) __SYSCALL3(SYS_AS_AREA_CREATE, (sysarg_t) address,
     
    6768 *
    6869 */
    69 int as_area_resize(void *address, size_t size, int flags)
     70int as_area_resize(void *address, size_t size, unsigned int flags)
    7071{
    7172        return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t) address,
     
    9596 *
    9697 */
    97 int as_area_change_flags(void *address, int flags)
     98int as_area_change_flags(void *address, unsigned int flags)
    9899{
    99100        return __SYSCALL2(SYS_AS_AREA_CHANGE_FLAGS, (sysarg_t) address,
     
    114115}
    115116
     117/** Find mapping to physical address.
     118 *
     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.
     124 */
     125int as_get_physical_mapping(void *address, uintptr_t *frame)
     126{
     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;
     141}
     142
    116143/** @}
    117144 */
Note: See TracChangeset for help on using the changeset viewer.