Ignore:
Timestamp:
2018-08-31T10:52:51Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
516e780
Parents:
6bf5b8c
git-author:
Jakub Jermar <jakub@…> (2018-08-31 10:52:43)
git-committer:
Jakub Jermar <jakub@…> (2018-08-31 10:52:51)
Message:

Let km_map() handle the unaligned addresses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/kbd.c

    r6bf5b8c r7f7d642  
    109109        }
    110110
    111         /*
    112          * We need to pass aligned address to hw_map().
    113          * However, the physical keyboard address can
    114          * be pretty much unaligned, depending on the
    115          * underlying controller.
    116          */
    117         uintptr_t aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE);
    118         size_t offset = pa - aligned_addr;
    119 
    120         ioport8_t *ns16550 = (ioport8_t *) (km_map(aligned_addr, offset + size,
    121             KM_NATURAL_ALIGNMENT, PAGE_WRITE | PAGE_NOT_CACHEABLE) + offset);
     111        ioport8_t *ns16550 = (ioport8_t *) km_map(pa, size,
     112            KM_NATURAL_ALIGNMENT, PAGE_WRITE | PAGE_NOT_CACHEABLE);
    122113
    123114        ns16550_instance_t *ns16550_instance = ns16550_init(ns16550, 0, inr, cir,
Note: See TracChangeset for help on using the changeset viewer.