Changes in / [aa9f0a4:5d00e40] in mainline
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/page.h
raa9f0a4 r5d00e40 37 37 38 38 #include <typedefs.h> 39 #include <proc/task.h>40 39 #include <mm/as.h> 41 40 #include <memstr.h> … … 63 62 extern uintptr_t hw_map(uintptr_t, size_t); 64 63 65 extern sysarg_t sys_page_find_mapping(uintptr_t, uintptr_t *);66 67 64 #endif 68 65 -
kernel/generic/include/syscall/syscall.h
raa9f0a4 r5d00e40 59 59 SYS_AS_AREA_DESTROY, 60 60 61 SYS_PAGE_FIND_MAPPING,62 63 61 SYS_IPC_CALL_SYNC_FAST, 64 62 SYS_IPC_CALL_SYNC_SLOW, -
kernel/generic/src/mm/page.c
raa9f0a4 r5d00e40 60 60 61 61 #include <mm/page.h> 62 #include <genarch/mm/page_ht.h>63 #include <genarch/mm/page_pt.h>64 62 #include <arch/mm/page.h> 65 63 #include <arch/mm/asid.h> … … 72 70 #include <debug.h> 73 71 #include <arch.h> 74 #include <syscall/copy.h>75 #include <errno.h>76 72 77 73 /** Virtual operations for page subsystem. */ … … 177 173 } 178 174 179 /** Syscall wrapper for getting mapping of a virtual page.180 *181 * @retval EOK Everything went find, @p uspace_frame and @p uspace_node182 * 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 210 175 /** @} 211 176 */ -
kernel/generic/src/syscall/syscall.c
raa9f0a4 r5d00e40 41 41 #include <proc/program.h> 42 42 #include <mm/as.h> 43 #include <mm/page.h>44 43 #include <print.h> 45 44 #include <arch.h> … … 145 144 (syshandler_t) sys_as_area_destroy, 146 145 147 /* Page mapping related syscalls. */148 (syshandler_t) sys_page_find_mapping,149 150 146 /* IPC related syscalls. */ 151 147 (syshandler_t) sys_ipc_call_sync_fast, -
uspace/app/tester/Makefile
raa9f0a4 r5d00e40 53 53 loop/loop1.c \ 54 54 mm/malloc1.c \ 55 mm/mapping1.c \56 55 hw/misc/virtchar1.c \ 57 56 hw/serial/serial1.c -
uspace/app/tester/tester.c
raa9f0a4 r5d00e40 62 62 #include "loop/loop1.def" 63 63 #include "mm/malloc1.def" 64 #include "mm/mapping1.def"65 64 #include "hw/serial/serial1.def" 66 65 #include "adt/usbaddrkeep.def" -
uspace/app/tester/tester.h
raa9f0a4 r5d00e40 79 79 extern const char *test_loop1(void); 80 80 extern const char *test_malloc1(void); 81 extern const char *test_mapping1(void);82 81 extern const char *test_serial1(void); 83 82 extern const char *test_usbaddrkeep(void); -
uspace/lib/c/generic/as.c
raa9f0a4 r5d00e40 35 35 #include <as.h> 36 36 #include <libc.h> 37 #include <errno.h>38 37 #include <unistd.h> 39 38 #include <align.h> … … 129 128 } 130 129 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 157 130 /** @} 158 131 */ -
uspace/lib/c/include/as.h
raa9f0a4 r5d00e40 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);50 49 51 50 #endif
Note:
See TracChangeset
for help on using the changeset viewer.