Changeset 8d6c1f1 in mainline for kernel/generic/src/mm/page.c


Ignore:
Timestamp:
2011-06-07T21:31:35Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
75608143
Parents:
ff4f073 (diff), eb522e8 (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 USB support.

Changes from bzr://helenos-usb.bzr.sourceforge.net/bzrroot/helenos-usb/mainline:

  • replaced '-' with '_' in new driver names
  • USB libs are built for each architecture
  • devman starts early
  • sys_thread_udelay() uses generic delay()
  • sys_as_create_area() now creates cacheable areas by default
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/page.c

    rff4f073 r8d6c1f1  
    6060
    6161#include <mm/page.h>
     62#include <genarch/mm/page_ht.h>
     63#include <genarch/mm/page_pt.h>
    6264#include <arch/mm/page.h>
    6365#include <arch/mm/asid.h>
     
    7072#include <debug.h>
    7173#include <arch.h>
     74#include <syscall/copy.h>
     75#include <errno.h>
    7276
    7377/** Virtual operations for page subsystem. */
     
    172176}
    173177
     178/** Syscall wrapper for getting mapping of a virtual page.
     179 *
     180 * @retval EOK Everything went find, @p uspace_frame and @p uspace_node
     181 *             contains correct values.
     182 * @retval ENOENT Virtual address has no mapping.
     183 */
     184sysarg_t sys_page_find_mapping(uintptr_t virt_address,
     185    uintptr_t *uspace_frame)
     186{
     187        mutex_lock(&AS->lock);
     188       
     189        pte_t *pte = page_mapping_find(AS, virt_address, false);
     190        if (!PTE_VALID(pte) || !PTE_PRESENT(pte)) {
     191                mutex_unlock(&AS->lock);
     192               
     193                return (sysarg_t) ENOENT;
     194        }
     195       
     196        uintptr_t phys_address = PTE_GET_FRAME(pte);
     197       
     198        mutex_unlock(&AS->lock);
     199       
     200        int rc = copy_to_uspace(uspace_frame,
     201            &phys_address, sizeof(phys_address));
     202        if (rc != EOK) {
     203                return (sysarg_t) rc;
     204        }
     205       
     206        return EOK;
     207}
     208
    174209/** @}
    175210 */
Note: See TracChangeset for help on using the changeset viewer.