Changeset ad12b5ea in mainline for kernel/arch/ia32/src/mm/frame.c


Ignore:
Timestamp:
2011-11-20T16:53:04Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2686705
Parents:
a55ddc64
Message:

Factor out the amd64/ia32 code which calculates the bounds of
a zone after considering the low/hich memory split to a new
generic function frame_adjust_zone_bounds().

File:
1 edited

Legend:

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

    ra55ddc64 rad12b5ea  
    5757       
    5858        for (i = 0; i < e820counter; i++) {
    59                 uint64_t base = e820table[i].base_address;
    60                 uint64_t size = e820table[i].size;
    61                 uintptr_t limit = config.identity_size;
     59                uintptr_t base = (uintptr_t) e820table[i].base_address;
     60                size_t size = (size_t) e820table[i].size;
    6261               
    63                 if (low) {
    64                         if (base > limit)
    65                                 continue;
    66                         if (base + size > limit)
    67                                 size = limit - base;
    68                 } else {
    69                         if (base + size <= limit)
    70                                 continue;
    71                         if (base <= limit) {
    72                                 size -= limit - base;
    73                                 base = limit;
    74                         }
    75                 }
     62                if (!frame_adjust_zone_bounds(low, &base, &size))
     63                        continue;
    7664               
    7765                if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) {
     
    9381                                    ZONE_AVAILABLE | ZONE_LOWMEM);
    9482                        } else {
    95                                 printf("count=%lld\n", (long long int) count);
    9683                                conf = zone_external_conf_alloc(count);
    9784                                zone_create(pfn, count, conf,
Note: See TracChangeset for help on using the changeset viewer.