Changeset 1affcdf3 in mainline for uspace/lib/c/generic/as.c
- Timestamp:
- 2011-06-10T19:33:41Z (13 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/as.c
r13ecdac9 r1affcdf3 35 35 #include <as.h> 36 36 #include <libc.h> 37 #include <errno.h> 37 38 #include <unistd.h> 38 39 #include <align.h> … … 51 52 * 52 53 */ 53 void *as_area_create(void *address, size_t size, int flags)54 void *as_area_create(void *address, size_t size, unsigned int flags) 54 55 { 55 56 return (void *) __SYSCALL3(SYS_AS_AREA_CREATE, (sysarg_t) address, … … 67 68 * 68 69 */ 69 int as_area_resize(void *address, size_t size, int flags)70 int as_area_resize(void *address, size_t size, unsigned int flags) 70 71 { 71 72 return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t) address, … … 95 96 * 96 97 */ 97 int as_area_change_flags(void *address, int flags)98 int as_area_change_flags(void *address, unsigned int flags) 98 99 { 99 100 return __SYSCALL2(SYS_AS_AREA_CHANGE_FLAGS, (sysarg_t) address, … … 114 115 } 115 116 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 */ 125 int 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 116 143 /** @} 117 144 */
Note:
See TracChangeset
for help on using the changeset viewer.