Changeset aed4eca in mainline


Ignore:
Timestamp:
2005-09-21T19:19:16Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74b2f5bf
Parents:
84dd253
Message:

The more physical frames, the more memory allocated for heap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/main.c

    r84dd253 raed4eca  
    8181
    8282/*
     83 * Size of heap.
     84 */
     85static size_t heap_size;
     86
     87/*
    8388 * Extra space on heap to make the stack start on page boundary.
    8489 */
     
    108113        config.cpu_count = 1;
    109114        config.cpu_active = 1;
    110        
    111         kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE;   
     115        config.base = hardcoded_load_address;
     116        config.memory_size = get_memory_size();
     117
     118        heap_size = CONFIG_HEAP_SIZE + (config.memory_size/FRAME_SIZE)*sizeof(frame_t);
     119       
     120        kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + heap_size;
    112121        heap_delta = PAGE_SIZE - ((hardcoded_load_address + kernel_size) % PAGE_SIZE);
    113122        heap_delta = (heap_delta == PAGE_SIZE) ? 0 : heap_delta;
    114123        kernel_size += heap_delta;
    115124       
    116         config.base = hardcoded_load_address;
    117         config.memory_size = get_memory_size();
    118125        config.kernel_size = kernel_size + CONFIG_STACK_SIZE;
    119126       
    120127        context_save(&ctx);
    121         early_mapping(config.base + hardcoded_ktext_size + hardcoded_kdata_size + heap_delta, CONFIG_STACK_SIZE + CONFIG_HEAP_SIZE);
     128        early_mapping(config.base + hardcoded_ktext_size + hardcoded_kdata_size + heap_delta, CONFIG_STACK_SIZE + heap_size);
    122129        context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + kernel_size, CONFIG_STACK_SIZE);
    123130        context_restore(&ctx);
     
    140147       
    141148        arch_pre_mm_init();
    142         heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, CONFIG_HEAP_SIZE + heap_delta);
     149        heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, heap_size + heap_delta);
    143150        frame_init();
    144151        page_init();
Note: See TracChangeset for help on using the changeset viewer.