Changeset a1b9f63 in mainline for kernel/test/mm/mapping1.c


Ignore:
Timestamp:
2018-08-31T10:32:40Z (6 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/test/mm/mapping1.c

    rb1834a01 ra1b9f63  
    4343        uintptr_t frame = frame_alloc(1, FRAME_NONE, 0);
    4444
    45         uintptr_t page0 = km_map(frame, FRAME_SIZE,
     45        uintptr_t page0 = km_map(frame, FRAME_SIZE, FRAME_SIZE,
    4646            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    4747        TPRINTF("Virtual address %p mapped to physical address %p.\n",
    4848            (void *) page0, (void *) frame);
    4949
    50         uintptr_t page1 = km_map(frame, FRAME_SIZE,
     50        uintptr_t page1 = km_map(frame, FRAME_SIZE, FRAME_SIZE,
    5151            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    5252        TPRINTF("Virtual address %p mapped to physical address %p.\n",
Note: See TracChangeset for help on using the changeset viewer.