Changeset e3c762cd in mainline for generic/src/ddi/ddi.c


Ignore:
Timestamp:
2006-05-05T11:59:19Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
de07bcf
Parents:
22cf454d
Message:

Complete implementation of copy_from_uspace() and copy_to_uspace()
for amd64 and ia32. Other architectures still compile and run,
but need to implement their own assembly-only memcpy(), memcpy_from_uspace(),
memcpy_to_uspace() and their failover parts. For these architectures
only dummy implementations are provided.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ddi/ddi.c

    r22cf454d re3c762cd  
    4141#include <security/cap.h>
    4242#include <mm/frame.h>
    43 #include <mm/page.h>
    4443#include <mm/as.h>
    4544#include <synch/spinlock.h>
     45#include <syscall/copy.h>
    4646#include <arch.h>
    4747#include <align.h>
     
    184184{
    185185        ddi_memarg_t arg;
    186        
    187         copy_from_uspace(&arg, uspace_mem_arg, sizeof(ddi_memarg_t));
     186        int rc;
     187       
     188        rc = copy_from_uspace(&arg, uspace_mem_arg, sizeof(ddi_memarg_t));
     189        if (rc != 0)
     190                return (__native) rc;
     191               
    188192        return (__native) ddi_physmem_map((task_id_t) arg.task_id, ALIGN_DOWN((__address) arg.phys_base, FRAME_SIZE),
    189193                                          ALIGN_DOWN((__address) arg.virt_base, PAGE_SIZE), (count_t) arg.pages,
     
    200204{
    201205        ddi_ioarg_t arg;
    202        
    203         copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
     206        int rc;
     207       
     208        rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
     209        if (rc != 0)
     210                return (__native) rc;
     211               
    204212        return (__native) ddi_iospace_enable((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);
    205213}
Note: See TracChangeset for help on using the changeset viewer.