Changes in / [aa9f0a4:5d00e40] in mainline


Ignore:
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/page.h

    raa9f0a4 r5d00e40  
    3737
    3838#include <typedefs.h>
    39 #include <proc/task.h>
    4039#include <mm/as.h>
    4140#include <memstr.h>
     
    6362extern uintptr_t hw_map(uintptr_t, size_t);
    6463
    65 extern sysarg_t sys_page_find_mapping(uintptr_t, uintptr_t *);
    66 
    6764#endif
    6865
  • kernel/generic/include/syscall/syscall.h

    raa9f0a4 r5d00e40  
    5959        SYS_AS_AREA_DESTROY,
    6060       
    61         SYS_PAGE_FIND_MAPPING,
    62        
    6361        SYS_IPC_CALL_SYNC_FAST,
    6462        SYS_IPC_CALL_SYNC_SLOW,
  • kernel/generic/src/mm/page.c

    raa9f0a4 r5d00e40  
    6060
    6161#include <mm/page.h>
    62 #include <genarch/mm/page_ht.h>
    63 #include <genarch/mm/page_pt.h>
    6462#include <arch/mm/page.h>
    6563#include <arch/mm/asid.h>
     
    7270#include <debug.h>
    7371#include <arch.h>
    74 #include <syscall/copy.h>
    75 #include <errno.h>
    7672
    7773/** Virtual operations for page subsystem. */
     
    177173}
    178174
    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 
    210175/** @}
    211176 */
  • kernel/generic/src/syscall/syscall.c

    raa9f0a4 r5d00e40  
    4141#include <proc/program.h>
    4242#include <mm/as.h>
    43 #include <mm/page.h>
    4443#include <print.h>
    4544#include <arch.h>
     
    145144        (syshandler_t) sys_as_area_destroy,
    146145       
    147         /* Page mapping related syscalls. */
    148         (syshandler_t) sys_page_find_mapping,
    149        
    150146        /* IPC related syscalls. */
    151147        (syshandler_t) sys_ipc_call_sync_fast,
  • uspace/app/tester/Makefile

    raa9f0a4 r5d00e40  
    5353        loop/loop1.c \
    5454        mm/malloc1.c \
    55         mm/mapping1.c \
    5655        hw/misc/virtchar1.c \
    5756        hw/serial/serial1.c
  • uspace/app/tester/tester.c

    raa9f0a4 r5d00e40  
    6262#include "loop/loop1.def"
    6363#include "mm/malloc1.def"
    64 #include "mm/mapping1.def"
    6564#include "hw/serial/serial1.def"
    6665#include "adt/usbaddrkeep.def"
  • uspace/app/tester/tester.h

    raa9f0a4 r5d00e40  
    7979extern const char *test_loop1(void);
    8080extern const char *test_malloc1(void);
    81 extern const char *test_mapping1(void);
    8281extern const char *test_serial1(void);
    8382extern const char *test_usbaddrkeep(void);
  • uspace/lib/c/generic/as.c

    raa9f0a4 r5d00e40  
    3535#include <as.h>
    3636#include <libc.h>
    37 #include <errno.h>
    3837#include <unistd.h>
    3938#include <align.h>
     
    129128}
    130129
    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 
    157130/** @}
    158131 */
  • uspace/lib/c/include/as.h

    raa9f0a4 r5d00e40  
    4747extern void *set_maxheapsize(size_t mhs);
    4848extern void * as_get_mappable_page(size_t sz);
    49 extern int as_get_physical_mapping(void *address, uintptr_t *frame);
    5049
    5150#endif
Note: See TracChangeset for help on using the changeset viewer.