Changeset aa9f0a4 in mainline
- Timestamp:
- 2011-01-21T13:58:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a088d15, c431a83
- Parents:
- 5d00e40 (diff), b93d637 (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. - Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/page.h
r5d00e40 raa9f0a4 37 37 38 38 #include <typedefs.h> 39 #include <proc/task.h> 39 40 #include <mm/as.h> 40 41 #include <memstr.h> … … 62 63 extern uintptr_t hw_map(uintptr_t, size_t); 63 64 65 extern sysarg_t sys_page_find_mapping(uintptr_t, uintptr_t *); 66 64 67 #endif 65 68 -
kernel/generic/include/syscall/syscall.h
r5d00e40 raa9f0a4 59 59 SYS_AS_AREA_DESTROY, 60 60 61 SYS_PAGE_FIND_MAPPING, 62 61 63 SYS_IPC_CALL_SYNC_FAST, 62 64 SYS_IPC_CALL_SYNC_SLOW, -
kernel/generic/src/mm/page.c
r5d00e40 raa9f0a4 60 60 61 61 #include <mm/page.h> 62 #include <genarch/mm/page_ht.h> 63 #include <genarch/mm/page_pt.h> 62 64 #include <arch/mm/page.h> 63 65 #include <arch/mm/asid.h> … … 70 72 #include <debug.h> 71 73 #include <arch.h> 74 #include <syscall/copy.h> 75 #include <errno.h> 72 76 73 77 /** Virtual operations for page subsystem. */ … … 173 177 } 174 178 179 /** Syscall wrapper for getting mapping of a virtual page. 180 * 181 * @retval EOK Everything went find, @p uspace_frame and @p uspace_node 182 * contains correct values. 183 * @retval ENOENT Virtual address has no mapping. 184 */ 185 sysarg_t sys_page_find_mapping(uintptr_t virt_address, 186 uintptr_t *uspace_frame) 187 { 188 mutex_lock(&AS->lock); 189 190 pte_t *pte = page_mapping_find(AS, virt_address); 191 if (!PTE_VALID(pte) || !PTE_PRESENT(pte)) { 192 mutex_unlock(&AS->lock); 193 194 return (sysarg_t) ENOENT; 195 } 196 197 uintptr_t phys_address = PTE_GET_FRAME(pte); 198 199 mutex_unlock(&AS->lock); 200 201 int rc = copy_to_uspace(uspace_frame, 202 &phys_address, sizeof(phys_address)); 203 if (rc != EOK) { 204 return (sysarg_t) rc; 205 } 206 207 return EOK; 208 } 209 175 210 /** @} 176 211 */ -
kernel/generic/src/syscall/syscall.c
r5d00e40 raa9f0a4 41 41 #include <proc/program.h> 42 42 #include <mm/as.h> 43 #include <mm/page.h> 43 44 #include <print.h> 44 45 #include <arch.h> … … 144 145 (syshandler_t) sys_as_area_destroy, 145 146 147 /* Page mapping related syscalls. */ 148 (syshandler_t) sys_page_find_mapping, 149 146 150 /* IPC related syscalls. */ 147 151 (syshandler_t) sys_ipc_call_sync_fast, -
uspace/app/tester/Makefile
r5d00e40 raa9f0a4 53 53 loop/loop1.c \ 54 54 mm/malloc1.c \ 55 mm/mapping1.c \ 55 56 hw/misc/virtchar1.c \ 56 57 hw/serial/serial1.c -
uspace/app/tester/tester.c
r5d00e40 raa9f0a4 62 62 #include "loop/loop1.def" 63 63 #include "mm/malloc1.def" 64 #include "mm/mapping1.def" 64 65 #include "hw/serial/serial1.def" 65 66 #include "adt/usbaddrkeep.def" -
uspace/app/tester/tester.h
r5d00e40 raa9f0a4 79 79 extern const char *test_loop1(void); 80 80 extern const char *test_malloc1(void); 81 extern const char *test_mapping1(void); 81 82 extern const char *test_serial1(void); 82 83 extern const char *test_usbaddrkeep(void); -
uspace/lib/c/generic/as.c
r5d00e40 raa9f0a4 35 35 #include <as.h> 36 36 #include <libc.h> 37 #include <errno.h> 37 38 #include <unistd.h> 38 39 #include <align.h> … … 128 129 } 129 130 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 */ 139 int 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 130 157 /** @} 131 158 */ -
uspace/lib/c/include/as.h
r5d00e40 raa9f0a4 47 47 extern void *set_maxheapsize(size_t mhs); 48 48 extern void * as_get_mappable_page(size_t sz); 49 extern int as_get_physical_mapping(void *address, uintptr_t *frame); 49 50 50 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.