Ignore:
Timestamp:
2013-09-10T17:48:57Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
85147f3
Parents:
86733f3
Message:

new physical memory allocator supporting physical address constrains
the buddy allocator framework is retired and replaced by a two-level bitmap
the allocator can allocate an arbitrary number of frames, not only a power-of-two count

Caution: Change of semantics
The physical memory allocator no longer allocates naturally aligned blocks. If you require an aligned block, specify it as the constraint.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/mm/sun4u/as.c

    r86733f3 rb0c2075  
    6363{
    6464#ifdef CONFIG_TSB
    65         /*
    66          * The order must be calculated with respect to the emulated
    67          * 16K page size.
    68          *
    69          */
    70         uint8_t order = fnzb32(((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) *
    71             sizeof(tsb_entry_t)) >> FRAME_WIDTH);
    72        
    73         uintptr_t tsb = PA2KA(frame_alloc(order, flags, 0));
     65        size_t frames = SIZE2FRAMES((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) *
     66            sizeof(tsb_entry_t));
     67       
     68        uintptr_t tsb = PA2KA(frame_alloc(frames, flags, 0));
    7469        if (!tsb)
    7570                return -1;
    7671       
    7772        as->arch.itsb = (tsb_entry_t *) tsb;
    78         as->arch.dtsb = (tsb_entry_t *) (tsb + ITSB_ENTRY_COUNT *
    79             sizeof(tsb_entry_t));
     73        as->arch.dtsb = (tsb_entry_t *) (tsb +
     74            ITSB_ENTRY_COUNT * sizeof(tsb_entry_t));
    8075       
    8176        memsetb(as->arch.itsb,
Note: See TracChangeset for help on using the changeset viewer.