Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/ddi/ddi-bitmap.c

    ra35b458 r1b20da0  
    6262        if (elements > IO_PORTS)
    6363                return ENOENT;
    64 
     64       
    6565        if (task->arch.iomap.elements < elements) {
    6666                /*
    6767                 * The I/O permission bitmap is too small and needs to be grown.
    6868                 */
    69 
     69               
    7070                void *store = malloc(bitmap_size(elements), FRAME_ATOMIC);
    7171                if (!store)
    7272                        return ENOMEM;
    73 
     73               
    7474                bitmap_t oldiomap;
    7575                bitmap_initialize(&oldiomap, task->arch.iomap.elements,
    7676                    task->arch.iomap.bits);
    77 
     77               
    7878                bitmap_initialize(&task->arch.iomap, elements, store);
    79 
     79               
    8080                /*
    8181                 * Mark the new range inaccessible.
     
    8383                bitmap_set_range(&task->arch.iomap, oldiomap.elements,
    8484                    elements - oldiomap.elements);
    85 
     85               
    8686                /*
    8787                 * In case there really existed smaller iomap,
     
    9191                        bitmap_copy(&task->arch.iomap, &oldiomap,
    9292                            oldiomap.elements);
    93 
     93                       
    9494                        free(oldiomap.bits);
    9595                }
    9696        }
    97 
     97       
    9898        /*
    9999         * Enable the range and we are done.
    100100         */
    101101        bitmap_clear_range(&task->arch.iomap, (size_t) ioaddr, size);
    102 
     102       
    103103        /*
    104104         * Increment I/O Permission bitmap generation counter.
    105105         */
    106106        task->arch.iomapver++;
    107 
     107       
    108108        return EOK;
    109109}
     
    125125        if (elements > IO_PORTS)
    126126                return ENOENT;
    127 
     127       
    128128        if (ioaddr >= task->arch.iomap.elements)
    129129                return EINVAL;
     
    136136         */
    137137        bitmap_set_range(&task->arch.iomap, (size_t) ioaddr, size);
    138 
     138       
    139139        /*
    140140         * Increment I/O Permission bitmap generation counter.
    141141         */
    142142        task->arch.iomapver++;
    143 
     143       
    144144        return 0;
    145145}
Note: See TracChangeset for help on using the changeset viewer.