Ignore:
Timestamp:
2018-08-31T10:32:40Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6bf5b8c
Parents:
b1834a01
git-author:
Jakub Jermar <jakub@…> (2018-08-31 09:54:11)
git-committer:
Jakub Jermar <jakub@…> (2018-08-31 10:32:40)
Message:

Add alignment argument to km_map()

km_map() currently always applies alignment requirement equal to the
size of the mapped region. Most of the time, the natural alignment is
unnecessarily strong and especially on 32-bit systems may contribute to
km_map() failures for regions with size in the order of several hundred
megabytes.

This change adds an extra argument to km_map() which allows the caller
to indicate the desired alignment. The old behaviour can be specified
by passing KM_NATURAL_ALIGNMENT as alignment.

This change only adds the alignment argument, but does not change the
alignment requirement anywhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    rb1834a01 ra1b9f63  
    135135void icp_init(void)
    136136{
    137         icp.hw_map.uart = km_map(ICP_UART, PAGE_SIZE,
    138             PAGE_WRITE | PAGE_NOT_CACHEABLE);
    139         icp.hw_map.kbd_ctrl = km_map(ICP_KBD, PAGE_SIZE, PAGE_NOT_CACHEABLE);
     137        icp.hw_map.uart = km_map(ICP_UART, PAGE_SIZE, PAGE_SIZE,
     138            PAGE_WRITE | PAGE_NOT_CACHEABLE);
     139        icp.hw_map.kbd_ctrl = km_map(ICP_KBD, PAGE_SIZE, PAGE_SIZE,
     140            PAGE_NOT_CACHEABLE);
    140141        icp.hw_map.kbd_stat = icp.hw_map.kbd_ctrl + ICP_KBD_STAT;
    141142        icp.hw_map.kbd_data = icp.hw_map.kbd_ctrl + ICP_KBD_DATA;
    142143        icp.hw_map.kbd_intstat = icp.hw_map.kbd_ctrl + ICP_KBD_INTR_STAT;
    143         icp.hw_map.rtc = km_map(ICP_RTC, PAGE_SIZE,
     144        icp.hw_map.rtc = km_map(ICP_RTC, PAGE_SIZE, PAGE_SIZE,
    144145            PAGE_WRITE | PAGE_NOT_CACHEABLE);
    145146        icp.hw_map.rtc1_load = icp.hw_map.rtc + ICP_RTC1_LOAD_OFFSET;
     
    150151        icp.hw_map.rtc1_intrstat = icp.hw_map.rtc + ICP_RTC1_INTRSTAT_OFFSET;
    151152
    152         icp.hw_map.irqc = km_map(ICP_IRQC, PAGE_SIZE,
     153        icp.hw_map.irqc = km_map(ICP_IRQC, PAGE_SIZE, PAGE_SIZE,
    153154            PAGE_WRITE | PAGE_NOT_CACHEABLE);
    154155        icp.hw_map.irqc_mask = icp.hw_map.irqc + ICP_IRQC_MASK_OFFSET;
    155156        icp.hw_map.irqc_unmask = icp.hw_map.irqc + ICP_IRQC_UNMASK_OFFSET;
    156         icp.hw_map.cmcr = km_map(ICP_CMCR, PAGE_SIZE,
     157        icp.hw_map.cmcr = km_map(ICP_CMCR, PAGE_SIZE, PAGE_SIZE,
    157158            PAGE_WRITE | PAGE_NOT_CACHEABLE);
    158159        icp.hw_map.sdramcr = icp.hw_map.cmcr + ICP_SDRAMCR_OFFSET;
    159         icp.hw_map.vga = km_map(ICP_VGA, PAGE_SIZE,
     160        icp.hw_map.vga = km_map(ICP_VGA, PAGE_SIZE, PAGE_SIZE,
    160161            PAGE_WRITE | PAGE_NOT_CACHEABLE);
    161162
Note: See TracChangeset for help on using the changeset viewer.