Changeset 7f7d642 in mainline


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

Location:
kernel/arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/ppc32.c

    r6bf5b8c r7f7d642  
    237237#ifdef CONFIG_MAC_KBD
    238238                uintptr_t pa = assigned_address[0].addr + 0x16000;
    239                 uintptr_t aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE);
    240                 size_t offset = pa - aligned_addr;
    241239                size_t size = 2 * PAGE_SIZE;
    242240
    243                 cuda_t *cuda = (cuda_t *) (km_map(aligned_addr, offset + size,
    244                     KM_NATURAL_ALIGNMENT,
    245                     PAGE_WRITE | PAGE_NOT_CACHEABLE) + offset);
     241                cuda_t *cuda = (cuda_t *) km_map(pa, size, KM_NATURAL_ALIGNMENT,
     242                    PAGE_WRITE | PAGE_NOT_CACHEABLE);
    246243
    247244                /* Initialize I/O controller */
  • 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.