Changeset d6e8529 in mainline


Ignore:
Timestamp:
2005-12-20T00:34:12Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fa7450c
Parents:
75e1db0
Message:

remove arch/$ARCH/boot where not needed, change global Makefile accordingly
remove early_mapping() (breaks ppc32 for now)
change early heap initialization (required for init to work)

Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r75e1db0 rd6e8529  
    178178
    179179depend: archlinks
    180         -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) >Makefile.depend 2>/dev/null
    181         #$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
     180        -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
    182181
    183182arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
     
    195194        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
    196195        tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin
    197        
    198196
    199197generic/src/debug/real_map.o: generic/src/debug/real_map.bin
     
    207205
    208206boot: kernel.bin
    209         $(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`" CC=$(CC) AS=$(AS) LD=$(LD)
     207        if [ -d arch/$(ARCH)/boot ] ; then $(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`" CC=$(CC) AS=$(AS) LD=$(LD) ; fi
    210208
    211209disasm: kernel.raw
  • arch/ppc32/include/arch.h

    r75e1db0 rd6e8529  
    3232#include <genarch/ofw/ofw.h>
    3333
    34 #ifdef early_mapping
    35 #undef early_mapping
    3634#endif
    37 
    38 #define early_mapping(stack, size) \
    39         ofw_claim((void *) stack, size, 0);
    40 
    41 #endif
  • generic/include/arch.h

    r75e1db0 rd6e8529  
    4343#define PREEMPTION_DISABLED     THE->preemption_disabled
    4444
    45 #ifndef early_mapping
    46 #define early_mapping(stack, size)
    47 #endif /* early_mapping */
    48 
    4945/**
    5046 * For each possible kernel stack, structure
  • generic/include/config.h

    r75e1db0 rd6e8529  
    4141
    4242struct config {
     43        count_t cpu_count;
     44        volatile count_t cpu_active;
     45
    4346        __address base;
    4447        size_t memory_size;
    45         size_t kernel_size;
    4648       
    4749        __address init_addr;
    4850        size_t init_size;
    49 
    50         count_t cpu_count;
    51         volatile count_t cpu_active;
     51       
     52        __address heap_addr;
     53        size_t heap_size;
     54        size_t heap_delta;            /**< Extra space between heap and stack (enforced by alignment requirements) */
     55       
     56        size_t kernel_size;           /**< Size of memory in bytes taken by kernel, heap and stack */
    5257};
    5358
  • generic/src/main/main.c

    r75e1db0 rd6e8529  
    8383#endif
    8484
    85 
    8685config_t config;
    8786context_t ctx;
     
    9897__address init_addr = 0;
    9998size_t init_size = 0;
    100 
    101 /**
    102  * Size of memory in bytes taken by kernel and heap.
    103  */
    104 static size_t kernel_size;
    105 
    106 /**
    107  * Size of heap.
    108  */
    109 static size_t heap_size;
    110 
    111 
    112 /**
    113  * Extra space between heap and stack
    114  * enforced by alignment requirements.
    115  */
    116 static size_t heap_delta;
    11799
    118100void main_bsp(void);
     
    141123        config.cpu_count = 1;
    142124        config.cpu_active = 1;
     125       
    143126        config.base = hardcoded_load_address;
    144127        config.memory_size = get_memory_size();
    145128        config.init_addr = init_addr;
    146129        config.init_size = init_size;
    147 
    148         heap_size = CONFIG_HEAP_SIZE + (config.memory_size/FRAME_SIZE)*sizeof(frame_t);
    149         kernel_size = ALIGN_UP(hardcoded_ktext_size + hardcoded_kdata_size + heap_size, PAGE_SIZE);
    150         heap_delta = kernel_size - (hardcoded_ktext_size + hardcoded_kdata_size + heap_size);
    151        
    152         config.kernel_size = kernel_size + CONFIG_STACK_SIZE;
     130       
     131        if (init_size > 0)
     132                config.heap_addr = init_addr + init_size;
     133        else
     134                config.heap_addr = hardcoded_load_address + hardcoded_ktext_size + hardcoded_kdata_size;
     135       
     136        config.heap_size = CONFIG_HEAP_SIZE + (config.memory_size / FRAME_SIZE) * sizeof(frame_t);
     137       
     138        config.kernel_size = ALIGN_UP(config.heap_addr - hardcoded_load_address + config.heap_size, PAGE_SIZE);
     139        config.heap_delta = config.kernel_size - (config.heap_addr - hardcoded_load_address + config.heap_size);
     140        config.kernel_size = config.kernel_size + CONFIG_STACK_SIZE;
    153141       
    154142        context_save(&ctx);
    155         early_mapping(config.base + hardcoded_ktext_size + hardcoded_kdata_size, CONFIG_STACK_SIZE + heap_size + heap_delta);
    156         context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + kernel_size, CONFIG_STACK_SIZE);
     143        context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + config.kernel_size, CONFIG_STACK_SIZE);
    157144        context_restore(&ctx);
    158145        /* not reached */
     
    186173       
    187174        arch_pre_mm_init();
    188         early_heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, heap_size + heap_delta);
     175        early_heap_init(config.heap_addr, config.heap_size + config.heap_delta);
    189176        frame_init();
    190177        page_init();
    191178        tlb_init();
    192179        arch_post_mm_init();
    193 
     180       
    194181        printf("%s, release %s (%s)%s\nBuilt%s for %s\n%s\n", project, release, name, revision, timestamp, arch, copyright);
    195182        printf("%P: hardcoded_ktext_size=%dK, hardcoded_kdata_size=%dK\n",
Note: See TracChangeset for help on using the changeset viewer.