Changeset 8cd680c in mainline for kernel/arch


Ignore:
Timestamp:
2014-08-18T20:34:28Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6eeb4a3
Parents:
8820544
Message:

Add pio_disable().

  • Implement *iospace_disable*().
  • Implement physmem_unmap().
Location:
kernel/arch
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/src/ddi/ddi.c

    r8820544 r8cd680c  
    4646}
    4747
     48/** Disable I/O space range for task.
     49 *
     50 */
     51int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     52{
     53        return 0;
     54}
     55
    4856/** @}
    4957 */
  • kernel/arch/amd64/src/ddi/ddi.c

    r8820544 r8cd680c  
    5151 *
    5252 * @param task   Task.
    53  * @param ioaddr Startign I/O space address.
     53 * @param ioaddr Starting I/O space address.
    5454 * @param size   Size of the enabled I/O range.
    5555 *
    56  * @return 0 on success or an error code from errno.h.
     56 * @return EOK on success or an error code from errno.h.
    5757 *
    5858 */
     
    106106        task->arch.iomapver++;
    107107       
     108        return EOK;
     109}
     110
     111/** Disable I/O space range for task.
     112 *
     113 * Interrupts are disabled and task is locked.
     114 *
     115 * @param task   Task.
     116 * @param ioaddr Starting I/O space address.
     117 * @param size   Size of the enabled I/O range.
     118 *
     119 * @return EOK on success or an error code from errno.h.
     120 *
     121 */
     122int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     123{
     124        size_t elements = ioaddr + size;
     125        if (elements > IO_PORTS)
     126                return ENOENT;
     127       
     128        if (ioaddr >= task->arch.iomap.elements)
     129                return EINVAL; 
     130
     131        if (task->arch.iomap.elements < elements)
     132                size -= elements - task->arch.iomap.elements;
     133
     134        /*
     135         * Disable the range.
     136         */
     137        bitmap_set_range(&task->arch.iomap, (size_t) ioaddr, size);
     138       
     139        /*
     140         * Increment I/O Permission bitmap generation counter.
     141         */
     142        task->arch.iomapver++;
     143       
    108144        return 0;
    109145}
  • kernel/arch/arm32/src/ddi/ddi.c

    r8820544 r8cd680c  
    5353}
    5454
     55/** Disable I/O space range for task.
     56 *
     57 * Interrupts are disabled and task is locked.
     58 *
     59 * @param task Task.
     60 * @param ioaddr Startign I/O space address.
     61 * @param size Size of the disabled I/O range.
     62 *
     63 * @return 0 on success or an error code from errno.h.
     64 */
     65int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     66{
     67        return 0;
     68}
     69
    5570/** @}
    5671 */
  • kernel/arch/ia32/src/ddi/ddi.c

    r8820544 r8cd680c  
    5151 *
    5252 * @param task   Task.
    53  * @param ioaddr Startign I/O space address.
     53 * @param ioaddr Starting I/O space address.
    5454 * @param size   Size of the enabled I/O range.
    5555 *
     
    109109}
    110110
     111/** Disable I/O space range for task.
     112 *
     113 * Interrupts are disabled and task is locked.
     114 *
     115 * @param task   Task.
     116 * @param ioaddr Starting I/O space address.
     117 * @param size   Size of the enabled I/O range.
     118 *
     119 * @return EOK on success or an error code from errno.h.
     120 *
     121 */
     122int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     123{
     124        size_t elements = ioaddr + size;
     125        if (elements > IO_PORTS)
     126                return ENOENT;
     127       
     128        if (ioaddr >= task->arch.iomap.elements)
     129                return EINVAL; 
     130
     131        if (task->arch.iomap.elements < elements)
     132                size -= elements - task->arch.iomap.elements;
     133
     134        /*
     135         * Disable the range.
     136         */
     137        bitmap_set_range(&task->arch.iomap, (size_t) ioaddr, size);
     138       
     139        /*
     140         * Increment I/O Permission bitmap generation counter.
     141         */
     142        task->arch.iomapver++;
     143       
     144        return 0;
     145}
     146
     147
    111148/** Install I/O Permission bitmap.
    112149 *
  • kernel/arch/ia64/src/ddi/ddi.c

    r8820544 r8cd680c  
    4747 * Interrupts are disabled and task is locked.
    4848 *
    49  * @param task          Task.
    50  * @param ioaddr        Starting I/O space address.
    51  * @param size          Size of the enabled I/O range.
     49 * @param task   Task.
     50 * @param ioaddr Starting I/O space address.
     51 * @param size   Size of the enabled I/O range.
    5252 *
    53  * @return 0 on success or an error code from errno.h.
     53 * @return EOK on success or an error code from errno.h.
    5454 */
    5555int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     
    7272        bitmap_set_range(task->arch.iomap, iopage, size / 4);
    7373       
    74         return 0;
     74        return EOK;
     75}
     76
     77/** Disable I/O space range for task.
     78 *
     79 * Interrupts are disabled and task is locked.
     80 *
     81 * @param task   Task.
     82 * @param ioaddr Starting I/O space address.
     83 * @param size   Size of the disabled I/O range.
     84 *
     85 * @return EOK on success or an error code from errno.h.
     86 */
     87int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     88{
     89        if (!task->arch.iomap)
     90                return EINVAL;
     91
     92        uintptr_t iopage = ioaddr / PORTS_PER_PAGE;
     93        size = ALIGN_UP(size + ioaddr - 4 * iopage, PORTS_PER_PAGE);
     94        bitmap_clear_range(task->arch.iomap, iopage, size / 4);
     95       
     96        return EOK;
    7597}
    7698
  • kernel/arch/mips32/src/ddi/ddi.c

    r8820544 r8cd680c  
    4444 * Interrupts are disabled and task is locked.
    4545 *
    46  * @param task Task.
    47  * @param ioaddr Startign I/O space address.
    48  * @param size Size of the enabled I/O range.
     46 * @param task   Task.
     47 * @param ioaddr Startinig I/O space address.
     48 * @param size   Size of the enabled I/O range.
    4949 *
    5050 * @return 0 on success or an error code from errno.h.
     
    5555}
    5656
     57/** Disable I/O space range for task.
     58 *
     59 * Interrupts are disabled and task is locked.
     60 *
     61 * @param task   Task.
     62 * @param ioaddr Starting I/O space address.
     63 * @param size   Size of the disabled I/O range.
     64 *
     65 * @return 0 on success or an error code from errno.h.
     66 */
     67int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     68{
     69        return 0;
     70}
     71
    5772/** @}
    5873 */
  • kernel/arch/ppc32/src/ddi/ddi.c

    r8820544 r8cd680c  
    4141 * Interrupts are disabled and task is locked.
    4242 *
    43  * @param task Task.
    44  * @param ioaddr Startign I/O space address.
    45  * @param size Size of the enabled I/O range.
     43 * @param task   Task.
     44 * @param ioaddr Starting I/O space address.
     45 * @param size   Size of the enabled I/O range.
    4646 *
    4747 * @return 0 on success or an error code from errno.h.
     
    5353}
    5454
     55/** Disable I/O space range for task.
     56 *
     57 * Interrupts are disabled and task is locked.
     58 *
     59 * @param task   Task.
     60 * @param ioaddr Starting I/O space address.
     61 * @param size   Size of the disabled I/O range.
     62 *
     63 * @return 0 on success or an error code from errno.h.
     64 *
     65 */
     66int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     67{
     68        return 0;
     69}
     70
    5571/** @}
    5672 */
  • kernel/arch/sparc32/src/ddi/ddi.c

    r8820544 r8cd680c  
    4646}
    4747
     48/** Disable I/O space range for task.
     49 *
     50 */
     51int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     52{
     53        return 0;
     54}
     55
    4856/** @}
    4957 */
  • kernel/arch/sparc64/src/ddi/ddi.c

    r8820544 r8cd680c  
    4141 * Interrupts are disabled and task is locked.
    4242 *
    43  * @param task Task.
     43 * @param task   Task.
    4444 * @param ioaddr Starting I/O space address.
    45  * @param size Size of the enabled I/O range.
     45 * @param size   Size of the enabled I/O range.
    4646 *
    47  * @return 0 on success or an error code from errno.h.
     47 * @return EOK on success or an error code from errno.h.
    4848 */
    4949int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     
    5252}
    5353
     54/** Disable I/O space range for task.
     55 *
     56 * Interrupts are disabled and task is locked.
     57 *
     58 * @param task   Task.
     59 * @param ioaddr Starting I/O space address.
     60 * @param size   Size of the disabled I/O range.
     61 *
     62 * @return EOK on success or an error code from errno.h.
     63 */
     64int ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
     65{
     66        return 0;
     67}
     68
    5469/** @}
    5570 */
Note: See TracChangeset for help on using the changeset viewer.