Changeset a1b9f63 in mainline for kernel/arch/ia32/src


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.

Location:
kernel/arch/ia32/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/smp/smp.c

    rb1834a01 ra1b9f63  
    7676        if (config.cpu_count > 1) {
    7777                l_apic = (uint32_t *) km_map((uintptr_t) l_apic, PAGE_SIZE,
    78                     PAGE_WRITE | PAGE_NOT_CACHEABLE);
     78                    PAGE_SIZE, PAGE_WRITE | PAGE_NOT_CACHEABLE);
    7979                io_apic = (uint32_t *) km_map((uintptr_t) io_apic, PAGE_SIZE,
    80                     PAGE_WRITE | PAGE_NOT_CACHEABLE);
     80                    PAGE_SIZE, PAGE_WRITE | PAGE_NOT_CACHEABLE);
    8181        }
    8282}
  • kernel/arch/ia32/src/vreg.c

    rb1834a01 ra1b9f63  
    6767                panic("Cannot allocate VREG frame.");
    6868
    69         page = (uint32_t *) km_map(frame, PAGE_SIZE,
     69        page = (uint32_t *) km_map(frame, PAGE_SIZE, PAGE_SIZE,
    7070            PAGE_READ | PAGE_WRITE | PAGE_USER | PAGE_CACHEABLE);
    7171
Note: See TracChangeset for help on using the changeset viewer.