Changeset 263bda2 in mainline
- Timestamp:
- 2010-06-30T09:10:04Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4edd57fd
- Parents:
- 793cf029
- Location:
- kernel
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r793cf029 r263bda2 160 160 CFLAGS = $(GCC_CFLAGS) 161 161 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 162 INSTRUMENTATION = -finstrument-functions 162 163 endif 163 164 … … 165 166 CFLAGS = $(GCC_CFLAGS) 166 167 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 168 INSTRUMENTATION = -finstrument-functions 167 169 endif 168 170 … … 170 172 CFLAGS = $(ICC_CFLAGS) 171 173 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 174 INSTRUMENTATION = 172 175 endif 173 176 … … 176 179 DEFS += $(CONFIG_DEFS) 177 180 DEPEND_DEFS = $(DEFS) 181 INSTRUMENTATION = 178 182 endif 179 183 … … 181 185 CFLAGS = $(CLANG_CFLAGS) 182 186 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 187 INSTRUMENTATION = 183 188 endif 184 189 … … 202 207 generic/src/debug/stacktrace.c \ 203 208 generic/src/debug/panic.c \ 209 generic/src/debug/debug.c \ 204 210 generic/src/interrupt/interrupt.c \ 205 211 generic/src/main/main.c \ … … 355 361 endif 356 362 363 ## Sources where instrumentation is enabled 364 # 365 366 ifeq ($(CONFIG_LOG),y) 367 INSTRUMENTED_SOURCES = \ 368 generic/src/cpu/cpu.c \ 369 generic/src/main/kinit.c 370 endif 371 357 372 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) 358 373 ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) … … 414 429 415 430 %.o: %.c $(DEPEND) 416 $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c -o $@ $<431 $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION)) -c -o $@ $< 417 432 ifeq ($(PRECHECK),y) 418 433 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -
kernel/generic/include/debug.h
r793cf029 r263bda2 93 93 #define LOG(format, ...) \ 94 94 do { \ 95 printf("%s->%s() at %s:%u: " format "\n", symtab_fmt_name_lookup(CALLER), \ 96 __func__, __FILE__, __LINE__, ##__VA_ARGS__); \ 95 printf("%s() from %s at %s:%u: " format "\n", __func__, \ 96 symtab_fmt_name_lookup(CALLER), __FILE__, __LINE__, \ 97 ##__VA_ARGS__); \ 97 98 } while (0) 98 99 99 /** Extensive logging execute macro 100 * 101 * If CONFIG_LOG is set, the LOG_EXEC() macro 102 * will print an information about calling a given 103 * function and call it. 104 * 105 */ 106 #define LOG_EXEC(fnc) \ 107 do { \ 108 printf("%s->%s() at %s:%u: " #fnc "\n", symtab_fmt_name_lookup(CALLER), \ 109 __func__, __FILE__, __LINE__); \ 110 fnc; \ 111 } while (0) 100 extern void __cyg_profile_func_enter(void *, void *); 101 extern void __cyg_profile_func_exit(void *, void *); 112 102 113 103 #else /* CONFIG_LOG */ 114 104 115 105 #define LOG(format, ...) 116 #define LOG_EXEC(fnc) fnc117 106 118 #endif /* CONF OG_LOG */107 #endif /* CONFIG_LOG */ 119 108 120 109 #endif -
kernel/generic/src/main/main.c
r793cf029 r263bda2 104 104 105 105 /** Lowest safe stack virtual address. */ 106 uintptr_t stack_safe = 0; 106 uintptr_t stack_safe = 0; 107 107 108 108 /* … … 113 113 */ 114 114 static void main_bsp_separated_stack(void); 115 115 116 #ifdef CONFIG_SMP 116 117 static void main_ap_separated_stack(void); 117 118 #endif 118 119 119 #define CONFIG_STACK_SIZE 120 #define CONFIG_STACK_SIZE ((1 << STACK_FRAMES) * STACK_SIZE) 120 121 121 122 /** Main kernel routine for bootstrap CPU. … … 151 152 init.tasks[i].size, config.stack_size); 152 153 } 153 154 154 155 /* Avoid placing stack on top of boot allocations. */ 155 156 if (ballocs.size) { … … 170 171 } 171 172 172 173 173 /** Main kernel routine for bootstrap CPU using new stack. 174 174 * … … 176 176 * 177 177 */ 178 void main_bsp_separated_stack(void) 178 void main_bsp_separated_stack(void) 179 179 { 180 180 /* Keep this the first thing. */ … … 194 194 * commands. 195 195 */ 196 LOG_EXEC(kconsole_init());196 kconsole_init(); 197 197 #endif 198 198 … … 201 201 * starts adding its own handlers 202 202 */ 203 LOG_EXEC(exc_init());203 exc_init(); 204 204 205 205 /* 206 206 * Memory management subsystems initialization. 207 207 */ 208 LOG_EXEC(arch_pre_mm_init());209 LOG_EXEC(frame_init());208 arch_pre_mm_init(); 209 frame_init(); 210 210 211 211 /* Initialize at least 1 memory segment big enough for slab to work. */ 212 LOG_EXEC(slab_cache_init());213 LOG_EXEC(sysinfo_init());214 LOG_EXEC(btree_init());215 LOG_EXEC(as_init());216 LOG_EXEC(page_init());217 LOG_EXEC(tlb_init());218 LOG_EXEC(ddi_init());219 LOG_EXEC(tasklet_init());220 LOG_EXEC(arch_post_mm_init());221 LOG_EXEC(arch_pre_smp_init());222 LOG_EXEC(smp_init());212 slab_cache_init(); 213 sysinfo_init(); 214 btree_init(); 215 as_init(); 216 page_init(); 217 tlb_init(); 218 ddi_init(); 219 tasklet_init(); 220 arch_post_mm_init(); 221 arch_pre_smp_init(); 222 smp_init(); 223 223 224 224 /* Slab must be initialized after we know the number of processors. */ 225 LOG_EXEC(slab_enable_cpucache());225 slab_enable_cpucache(); 226 226 227 227 printf("Detected %" PRIs " CPU(s), %" PRIu64" MiB free memory\n", 228 228 config.cpu_count, SIZE2MB(zones_total_size())); 229 230 LOG_EXEC(cpu_init());231 232 LOG_EXEC(calibrate_delay_loop());233 LOG_EXEC(clock_counter_init());234 LOG_EXEC(timeout_init());235 LOG_EXEC(scheduler_init());236 LOG_EXEC(task_init());237 LOG_EXEC(thread_init());238 LOG_EXEC(futex_init());229 230 cpu_init(); 231 232 calibrate_delay_loop(); 233 clock_counter_init(); 234 timeout_init(); 235 scheduler_init(); 236 task_init(); 237 thread_init(); 238 futex_init(); 239 239 240 240 if (init.cnt > 0) { … … 247 247 printf("No init binaries found.\n"); 248 248 249 LOG_EXEC(ipc_init());250 LOG_EXEC(event_init());251 LOG_EXEC(klog_init());252 LOG_EXEC(stats_init());249 ipc_init(); 250 event_init(); 251 klog_init(); 252 stats_init(); 253 253 254 254 /* … … 266 266 if (!kinit_thread) 267 267 panic("Cannot create kinit thread."); 268 LOG_EXEC(thread_ready(kinit_thread));268 thread_ready(kinit_thread); 269 269 270 270 /* … … 276 276 } 277 277 278 279 278 #ifdef CONFIG_SMP 279 280 280 /** Main kernel routine for application CPUs. 281 281 * … … 296 296 */ 297 297 config.cpu_active++; 298 298 299 299 /* 300 300 * The THE structure is well defined because ctx.sp is used as stack. … … 311 311 calibrate_delay_loop(); 312 312 arch_post_cpu_init(); 313 313 314 314 the_copy(THE, (the_t *) CPU->stack); 315 315 316 316 /* 317 317 * If we woke kmp up before we left the kernel stack, we could … … 326 326 } 327 327 328 329 328 /** Main kernel routine for application CPUs using new stack. 330 329 * … … 338 337 */ 339 338 timeout_init(); 340 339 341 340 waitq_wakeup(&ap_completion_wq, WAKEUP_FIRST); 342 341 scheduler(); 343 342 /* not reached */ 344 343 } 344 345 345 #endif /* CONFIG_SMP */ 346 346
Note:
See TracChangeset
for help on using the changeset viewer.