Changeset b52da8d7 in mainline for src/main/main.c


Ignore:
Timestamp:
2005-08-29T11:57:26Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c245372b
Parents:
229d5fc1
Message:

Add some comments to IA-32 src/boot/boot.S and src/smp.S.

Make the boot stack start on page boundary.
This is required by get_stack_base().

Define 'THE' macro.

Implement preemption_disable() and preemption_enable().

Add memory barrier macros.
IA-32 macros need support for older processors.
Non IA-32 macros are dummy.

Reduction of many #include paths.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/main.c

    r229d5fc1 rb52da8d7  
    9898        config.cpu_count = 1;
    9999        config.cpu_active = 1;
     100        size_t size, delta;
     101
     102        /*
     103         * Calculate 'size' that kernel and heap occupies in memory.
     104         */
     105        size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE;   
     106         
     107        /*
     108         * We need the boot stack to start on page boundary.
     109         * That is why 'delta' is calculated.
     110         */
     111        delta = PAGE_SIZE - ((hardcoded_load_address + size) % PAGE_SIZE);
     112        delta = (delta == PAGE_SIZE) ? 0 : delta;
     113       
     114        size += delta;
    100115
    101116        config.base = hardcoded_load_address;
    102117        config.memory_size = get_memory_size();
    103         config.kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE + CONFIG_STACK_SIZE;
     118        config.kernel_size = size + CONFIG_STACK_SIZE;
    104119
    105120        context_save(&ctx);
    106         context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE, CONFIG_STACK_SIZE);
     121        context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + size, CONFIG_STACK_SIZE);
    107122        context_restore(&ctx);
    108123        /* not reached */
Note: See TracChangeset for help on using the changeset viewer.