Changeset f4d5f90 in mainline for uspace/lib/c/generic/ddi.c


Ignore:
Timestamp:
2011-12-15T10:36:34Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9fe4db3
Parents:
d9f8dd13 (diff), 9916841 (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 with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ddi.c

    rd9f8dd13 rf4d5f90  
    7575}
    7676
     77int dmamem_map(dmamem_t *dmamem, size_t pages, unsigned int map_flags,
     78    unsigned int dma_flags)
     79{
     80        // FIXME TODO
     81        return -1;
     82}
     83
     84int dmamem_unmap(dmamem_t *dmamem)
     85{
     86        // FIXME TODO
     87        return -1;
     88}
     89
     90int dmamem_lock(void *virt, void **phys, size_t pages)
     91{
     92        // FIXME TODO
     93        return -1;
     94}
     95
     96int dmamem_unlock(void *virt, size_t pages)
     97{
     98        // FIXME TODO
     99        return -1;
     100}
     101
    77102/** Enable I/O space range to task.
    78103 *
    79104 * Caller of this function must have the IO_MEM_MANAGER capability.
    80105 *
    81  * @param id            Task ID.
    82  * @param ioaddr        Starting address of the I/O range.
    83  * @param size          Size of the range.
     106 * @param id     Task ID.
     107 * @param ioaddr Starting address of the I/O range.
     108 * @param size   Size of the range.
    84109 *
    85  * @return              0 on success, EPERM if the caller lacks the
    86  *                      CAP_IO_MANAGER capability, ENOENT if there is no task
    87  *                      with specified ID and ENOMEM if there was some problem
    88  *                      in allocating memory.
     110 * @return EOK on success
     111 * @return EPERM if the caller lacks the CAP_IO_MANAGER capability
     112 * @return ENOENT if there is no task with specified ID
     113 * @return ENOMEM if there was some problem in allocating memory.
     114 *
    89115 */
    90116int iospace_enable(task_id_t id, void *ioaddr, unsigned long size)
    91117{
    92118        ddi_ioarg_t arg;
    93 
     119       
    94120        arg.task_id = id;
    95121        arg.ioaddr = ioaddr;
    96122        arg.size = size;
    97 
     123       
    98124        return __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
    99125}
     
    101127/** Enable PIO for specified I/O range.
    102128 *
    103  * @param pio_addr      I/O start address.
    104  * @param size          Size of the I/O region.
    105  * @param use_addr      Address where the final address for application's PIO
    106  *                      will be stored.
     129 * @param pio_addr I/O start address.
     130 * @param size     Size of the I/O region.
     131 * @param use_addr Address where the final address for
     132 *                 application's PIO will be stored.
    107133 *
    108  * @return              Zero on success or negative error code.
     134 * @return Zero on success or negative error code.
     135 *
    109136 */
    110137int pio_enable(void *pio_addr, size_t size, void **use_addr)
     
    114141        size_t offset;
    115142        unsigned int pages;
    116 
     143       
    117144#ifdef IO_SPACE_BOUNDARY
    118145        if (pio_addr < IO_SPACE_BOUNDARY) {
     
    121148        }
    122149#endif
    123 
     150       
    124151        phys = (void *) ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE);
    125152        offset = pio_addr - phys;
Note: See TracChangeset for help on using the changeset viewer.