Ignore:
File:
1 edited

Legend:

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

    rfd6bd6d r28f8f170  
    7575}
    7676
    77 int 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 
    84 int dmamem_unmap(dmamem_t *dmamem)
    85 {
    86         // FIXME TODO
    87         return -1;
    88 }
    89 
    90 int dmamem_lock(void *virt, void **phys, size_t pages)
    91 {
    92         // FIXME TODO
    93         return -1;
    94 }
    95 
    96 int dmamem_unlock(void *virt, size_t pages)
    97 {
    98         // FIXME TODO
    99         return -1;
    100 }
    101 
    10277/** Enable I/O space range to task.
    10378 *
    10479 * Caller of this function must have the IO_MEM_MANAGER capability.
    10580 *
    106  * @param id     Task ID.
    107  * @param ioaddr Starting address of the I/O range.
    108  * @param size   Size of the range.
     81 * @param id            Task ID.
     82 * @param ioaddr        Starting address of the I/O range.
     83 * @param size          Size of the range.
    10984 *
    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  *
     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.
    11589 */
    11690int iospace_enable(task_id_t id, void *ioaddr, unsigned long size)
    11791{
    11892        ddi_ioarg_t arg;
    119        
     93
    12094        arg.task_id = id;
    12195        arg.ioaddr = ioaddr;
    12296        arg.size = size;
    123        
     97
    12498        return __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
    12599}
     
    127101/** Enable PIO for specified I/O range.
    128102 *
    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.
     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.
    133107 *
    134  * @return Zero on success or negative error code.
    135  *
     108 * @return              Zero on success or negative error code.
    136109 */
    137110int pio_enable(void *pio_addr, size_t size, void **use_addr)
     
    141114        size_t offset;
    142115        unsigned int pages;
    143        
     116
    144117#ifdef IO_SPACE_BOUNDARY
    145118        if (pio_addr < IO_SPACE_BOUNDARY) {
     
    148121        }
    149122#endif
    150        
     123
    151124        phys = (void *) ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE);
    152125        offset = pio_addr - phys;
Note: See TracChangeset for help on using the changeset viewer.