Changeset e0cdb7b6 in mainline
- Timestamp:
- 2005-10-10T11:15:50Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a016b63
- Parents:
- ac5665a
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/include/context.h
rac5665a re0cdb7b6 31 31 32 32 #include <arch/types.h> 33 #include <align.h> 33 34 34 35 #define STACK_ITEM_SIZE 16 36 #define STACK_ALIGNMENT 16 35 37 36 38 /* … … 46 48 #endif 47 49 48 #define context_set(c, _pc, stack, size) \49 (c)->pc = (__address) _pc; \50 (c)->bsp = ((__address) stack) + ( sizeof(the_t)); \50 #define context_set(c, _pc, stack, size) \ 51 (c)->pc = (__address) _pc; \ 52 (c)->bsp = ((__address) stack) + (ALIGN(sizeof(the_t), STACK_ALIGNMENT)); \ 51 53 (c)->sp = ((__address) stack) + (size) - SP_DELTA; 52 54 -
src/main/main.c
rac5665a re0cdb7b6 38 38 #include <main/kinit.h> 39 39 #include <cpu.h> 40 #include <align.h> 40 41 41 42 #ifdef __SMP__ … … 86 87 static size_t heap_size; 87 88 88 /* 89 * Extra space on heap to make the stack start on page boundary. 89 90 /* 91 * Extra space between heap and stack 92 * enforced by alignment requirements. 90 93 */ 91 94 static size_t heap_delta; … … 118 121 119 122 heap_size = CONFIG_HEAP_SIZE + (config.memory_size/FRAME_SIZE)*sizeof(frame_t); 120 121 kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + heap_size; 122 heap_delta = PAGE_SIZE - ((hardcoded_load_address + kernel_size) % PAGE_SIZE); 123 heap_delta = (heap_delta == PAGE_SIZE) ? 0 : heap_delta; 124 kernel_size += heap_delta; 123 kernel_size = ALIGN(hardcoded_ktext_size + hardcoded_kdata_size + heap_size, PAGE_SIZE); 124 heap_delta = kernel_size - (hardcoded_ktext_size + hardcoded_kdata_size + heap_size); 125 125 126 126 config.kernel_size = kernel_size + CONFIG_STACK_SIZE; 127 127 128 128 context_save(&ctx); 129 early_mapping(config.base + hardcoded_ktext_size + hardcoded_kdata_size + heap_delta, CONFIG_STACK_SIZE + heap_size);129 early_mapping(config.base + hardcoded_ktext_size + hardcoded_kdata_size, CONFIG_STACK_SIZE + heap_size + heap_delta); 130 130 context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + kernel_size, CONFIG_STACK_SIZE); 131 131 context_restore(&ctx);
Note:
See TracChangeset
for help on using the changeset viewer.