Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset bf3dd35 in mainline


Ignore:
Timestamp:
2012-01-31T22:03:21Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
03cdd2b
Parents:
20de14d
Message:

There is no need to have km_map() for aligned addresses and
km_map_structure() for unaligned addresses.

  • Make km_map() static and rename it to km_map_aligned().
  • Rename km_map_structure() to km_map().
Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/acpi/acpi.c

    r20de14d rbf3dd35  
    102102
    103103        /* Start with mapping the header only. */
    104         vhdr = (struct acpi_sdt_header *) km_map_structure((uintptr_t) psdt,
     104        vhdr = (struct acpi_sdt_header *) km_map((uintptr_t) psdt,
    105105            sizeof(struct acpi_sdt_header), PAGE_READ | PAGE_NOT_CACHEABLE);
    106106
    107107        /* Now we can map the entire structure. */
    108         vsdt = (struct acpi_sdt_header *) km_map_structure((uintptr_t) psdt,
     108        vsdt = (struct acpi_sdt_header *) km_map((uintptr_t) psdt,
    109109            vhdr->length, PAGE_WRITE | PAGE_NOT_CACHEABLE);
    110110       
  • kernel/generic/include/mm/km.h

    r20de14d rbf3dd35  
    5050
    5151extern uintptr_t km_map(uintptr_t, size_t, unsigned int);
    52 extern uintptr_t km_map_structure(uintptr_t, size_t, unsigned int);
    5352
    5453extern uintptr_t km_temporary_page_get(uintptr_t *, frame_flags_t);
  • kernel/generic/src/mm/km.c

    r20de14d rbf3dd35  
    124124}
    125125
    126 uintptr_t km_map(uintptr_t paddr, size_t size, unsigned int flags)
     126static uintptr_t
     127km_map_aligned(uintptr_t paddr, size_t size, unsigned int flags)
    127128{
    128129        uintptr_t vaddr;
     
    145146}
    146147
    147 uintptr_t km_map_structure(uintptr_t paddr, size_t size, unsigned int flags)
     148uintptr_t km_map(uintptr_t paddr, size_t size, unsigned int flags)
    148149{
    149150        size_t offs = paddr - ALIGN_DOWN(paddr, FRAME_SIZE);
    150151        uintptr_t page;
    151152
    152         page = km_map(ALIGN_DOWN(paddr, FRAME_SIZE), size + offs, flags);
     153        page = km_map_aligned(ALIGN_DOWN(paddr, FRAME_SIZE), size + offs,
     154            flags);
    153155        return page + offs;
    154156}
Note: See TracChangeset for help on using the changeset viewer.