Changeset bd48f4c in mainline for kernel/arch/ppc32/src/mm/frame.c


Ignore:
Timestamp:
2010-07-12T10:53:30Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd11d3e
Parents:
c40e6ef (diff), bee2d4c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/mm/frame.c

    rc40e6ef rbd48f4c  
    4545void physmem_print(void)
    4646{
    47         printf("Base       Size\n");
    48         printf("---------- ----------\n");
     47        printf("[base    ] [size    ]\n");
    4948       
    5049        size_t i;
     
    6160       
    6261        for (i = 0; i < memmap.cnt; i++) {
    63                 pfn_t start = ADDR2PFN(ALIGN_UP((uintptr_t) memmap.zones[i].start,
    64                     FRAME_SIZE));
    65                 size_t size = SIZE2FRAMES(ALIGN_DOWN(memmap.zones[i].size, FRAME_SIZE));
     62                /* To be safe, make the available zone possibly smaller */
     63                uintptr_t new_start = ALIGN_UP((uintptr_t) memmap.zones[i].start,
     64                    FRAME_SIZE);
     65                size_t new_size = ALIGN_DOWN(memmap.zones[i].size -
     66                    (new_start - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE);
     67               
     68                pfn_t pfn = ADDR2PFN(new_start);
     69                size_t count = SIZE2FRAMES(new_size);
    6670               
    6771                pfn_t conf;
    68                 if ((minconf < start) || (minconf >= start + size))
    69                         conf = start;
     72                if ((minconf < pfn) || (minconf >= pfn + count))
     73                        conf = pfn;
    7074                else
    7175                        conf = minconf;
    7276               
    73                 zone_create(start, size, conf, 0);
    74                 if (last_frame < ALIGN_UP((uintptr_t) memmap.zones[i].start
    75                     + memmap.zones[i].size, FRAME_SIZE))
    76                         last_frame = ALIGN_UP((uintptr_t) memmap.zones[i].start
    77                             + memmap.zones[i].size, FRAME_SIZE);
     77                zone_create(pfn, count, conf, 0);
     78               
     79                if (last_frame < ALIGN_UP(new_start + new_size, FRAME_SIZE))
     80                        last_frame = ALIGN_UP(new_start + new_size, FRAME_SIZE);
    7881        }
    7982       
Note: See TracChangeset for help on using the changeset viewer.