Changeset 666773c in mainline for kernel/arch/ia64/src/ddi/ddi.c


Ignore:
Timestamp:
2008-12-31T15:33:29Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9805cde
Parents:
d8c0dc5
Message:

Humanitarian facelift for ia64.

File:
1 edited

Legend:

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

    rd8c0dc5 r666773c  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar, Jakub vana
     2 * Copyright (c) 2006 Jakub Jermar
     3 * Copyright (c) 2008 Jakub vana
    34 * All rights reserved.
    45 *
     
    3940#include <errno.h>
    4041
    41 #define IO_MEMMAP_PAGES 16384
    42 #define PORTS_PER_PAGE 4
     42#define IO_MEMMAP_PAGES 16384
     43#define PORTS_PER_PAGE  4
    4344
    4445/** Enable I/O space range for task.
     
    4647 * Interrupts are disabled and task is locked.
    4748 *
    48  * @param task Task.
    49  * @param ioaddr Startign I/O space address.
    50  * @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.
    5152 *
    5253 * @return 0 on success or an error code from errno.h.
     
    5455int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size)
    5556{
     57        if (!task->arch.iomap) {
     58                uint8_t *map;
    5659
    57         if(!task->arch.iomap)
    58         {
    59                 uint8_t *map;
    60                 task->arch.iomap=malloc(sizeof(bitmap_t),0);
    61                 map=malloc(BITS2BYTES(IO_MEMMAP_PAGES),0);
     60                task->arch.iomap = malloc(sizeof(bitmap_t), 0);
     61                map = malloc(BITS2BYTES(IO_MEMMAP_PAGES), 0);
    6262                if(!map)
    6363                        return ENOMEM;
    64                 bitmap_initialize(task->arch.iomap,map,IO_MEMMAP_PAGES);       
    65                 bitmap_clear_range(task->arch.iomap,0,IO_MEMMAP_PAGES);
     64                bitmap_initialize(task->arch.iomap, map, IO_MEMMAP_PAGES);
     65                bitmap_clear_range(task->arch.iomap, 0, IO_MEMMAP_PAGES);
    6666        }
    6767       
    6868        uintptr_t iopage = ioaddr / PORTS_PER_PAGE;
    69         size = ALIGN_UP (size+ioaddr-4*iopage,PORTS_PER_PAGE);
    70         bitmap_set_range(task->arch.iomap,iopage,size/4);
    71 
     69        size = ALIGN_UP(size + ioaddr - 4 * iopage, PORTS_PER_PAGE);
     70        bitmap_set_range(task->arch.iomap, iopage, size / 4);
    7271
    7372        return 0;
Note: See TracChangeset for help on using the changeset viewer.