Changeset da52547 in mainline
- Timestamp:
- 2010-07-02T10:16:38Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5382d4f
- Parents:
- ad8f03d2
- Location:
- kernel
- Files:
-
- 17 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
rad8f03d2 rda52547 364 364 # 365 365 366 ifeq ($(CONFIG_ LOG),y)366 ifeq ($(CONFIG_TRACE),y) 367 367 INSTRUMENTED_SOURCES = \ 368 368 generic/src/cpu/cpu.c \ 369 generic/src/main/kinit.c 369 generic/src/main/main.c \ 370 generic/src/main/kinit.c \ 371 generic/src/proc/the.c 370 372 endif 371 373 -
kernel/arch/abs32le/src/abs32le.c
rad8f03d2 rda52547 151 151 } 152 152 153 void early_putchar(wchar_t ch) 154 { 155 } 156 153 157 /** @} 154 158 */ -
kernel/arch/amd64/Makefile.inc
rad8f03d2 rda52547 71 71 arch/$(KARCH)/src/mm/page.c \ 72 72 arch/$(KARCH)/src/mm/tlb.c \ 73 arch/$(KARCH)/src/asm _utils.S \73 arch/$(KARCH)/src/asm.S \ 74 74 arch/$(KARCH)/src/cpu/cpu.c \ 75 75 arch/$(KARCH)/src/proc/scheduler.c \ -
kernel/arch/amd64/src/asm.S
rad8f03d2 rda52547 64 64 .global memcpy_from_uspace_failover_address 65 65 .global memcpy_to_uspace_failover_address 66 .global early_putchar 66 67 67 68 /* Wrapper for generic memsetb */ … … 339 340 sysretq 340 341 342 /** Print Unicode character to EGA display. 343 * 344 * If CONFIG_EGA is undefined or CONFIG_FB is defined 345 * then this function does nothing. 346 * 347 * Since the EGA can only display Extended ASCII (usually 348 * ISO Latin 1) characters, some of the Unicode characters 349 * can be displayed in a wrong way. Only the newline character 350 * is interpreted, all other characters (even unprintable) are 351 * printed verbatim. 352 * 353 * @param %rdi Unicode character to be printed. 354 * 355 */ 356 early_putchar: 357 358 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB))) 359 360 /* Prologue, save preserved registers */ 361 pushq %rbp 362 movq %rsp, %rbp 363 pushq %rbx 364 365 movq %rdi, %rsi 366 movq $(PA2KA(0xb8000)), %rdi /* base of EGA text mode memory */ 367 xorq %rax, %rax 368 369 /* Read bits 8 - 15 of the cursor address */ 370 movw $0x3d4, %dx 371 movb $0xe, %al 372 outb %al, %dx 373 374 movw $0x3d5, %dx 375 inb %dx, %al 376 shl $8, %ax 377 378 /* Read bits 0 - 7 of the cursor address */ 379 movw $0x3d4, %dx 380 movb $0xf, %al 381 outb %al, %dx 382 383 movw $0x3d5, %dx 384 inb %dx, %al 385 386 /* Sanity check for the cursor on screen */ 387 cmp $2000, %ax 388 jb early_putchar_cursor_ok 389 390 movw $1998, %ax 391 392 early_putchar_cursor_ok: 393 394 movw %ax, %bx 395 shl $1, %rax 396 addq %rax, %rdi 397 398 movq %rsi, %rax 399 400 cmp $0x0a, %al 401 jne early_putchar_print 402 403 /* Interpret newline */ 404 405 movw %bx, %ax /* %bx -> %dx:%ax */ 406 xorw %dx, %dx 407 408 movw $80, %cx 409 idivw %cx, %ax /* %dx = %bx % 80 */ 410 411 /* %bx <- %bx + 80 - (%bx % 80) */ 412 addw %cx, %bx 413 subw %dx, %bx 414 415 jmp early_putchar_newline 416 417 early_putchar_print: 418 419 /* Print character */ 420 421 movb $0x0e, %ah /* black background, yellow foreground */ 422 stosw 423 424 early_putchar_newline: 425 426 /* Sanity check for the cursor on the last line */ 427 inc %bx 428 cmp $2000, %bx 429 jb early_putchar_no_scroll 430 431 /* Scroll the screen (24 rows) */ 432 movq $(PA2KA(0xb80a0)), %rsi 433 movq $(PA2KA(0xb8000)), %rdi 434 movq $1920, %rcx 435 rep movsw 436 437 /* Clear the 24th row */ 438 xorq %rax, %rax 439 movq $80, %rcx 440 rep stosw 441 442 /* Go to row 24 */ 443 movw $1920, %bx 444 445 early_putchar_no_scroll: 446 447 /* Write bits 8 - 15 of the cursor address */ 448 movw $0x3d4, %dx 449 movb $0xe, %al 450 outb %al, %dx 451 452 movw $0x3d5, %dx 453 movb %bh, %al 454 outb %al, %dx 455 456 /* Write bits 0 - 7 of the cursor address */ 457 movw $0x3d4, %dx 458 movb $0xf, %al 459 outb %al, %dx 460 461 movw $0x3d5, %dx 462 movb %bl, %al 463 outb %al, %dx 464 465 /* Epilogue, restore preserved registers */ 466 popq %rbx 467 leave 468 469 #endif 470 471 ret 472 341 473 .data 342 474 .global interrupt_handler_size -
kernel/arch/amd64/src/boot/boot.S
rad8f03d2 rda52547 192 192 * some hints. 193 193 * 194 * @param %esi NULL-terminated string to print. 194 * @param %esi Pointer to the NULL-terminated string 195 * to be print. 195 196 * 196 197 */ … … 295 296 * and CONFIG_FB is disabled. 296 297 * 297 * @param %esi NULL-terminated string to print. 298 * @param %esi Pointer to the NULL-terminated string 299 * to be print. 298 300 * 299 301 */ … … 450 452 * then this function does nothing. 451 453 * 452 * @param %rdi NULL-terminated string to print. 454 * @param %rdi Pointer to the NULL-terminated string 455 * to be printed. 453 456 * 454 457 */ -
kernel/arch/arm32/src/asm.S
rad8f03d2 rda52547 36 36 .global memcpy_from_uspace_failover_address 37 37 .global memcpy_to_uspace_failover_address 38 .global early_putchar 38 39 39 40 memsetb: … … 108 109 mov r0, #0 109 110 ldmia sp!, {r4, r5, pc} 111 112 early_putchar: 113 mov pc, lr -
kernel/arch/ia32/src/asm.S
rad8f03d2 rda52547 38 38 #define ERROR_WORD_INTERRUPT_LIST 0x00027d00 39 39 40 #include <arch/pm.h> 41 #include <arch/mm/page.h> 42 40 43 .text 41 42 44 .global paging_on 43 45 .global enable_l_apic_in_msr … … 50 52 .global memcpy_to_uspace 51 53 .global memcpy_to_uspace_failover_address 52 54 .global early_putchar 53 55 54 56 /* Wrapper for generic memsetb */ … … 405 407 406 408 .align INTERRUPT_ALIGN 407 .if (\n - \i) - 1409 .if (\n - \i) - 1 408 410 handler "(\i + 1)", \n 409 411 .endif … … 411 413 412 414 /* Keep in sync with pm.h! */ 413 IDT_ITEMS =64415 #define IDT_ITEMS 64 414 416 415 417 .align INTERRUPT_ALIGN … … 419 421 h_end: 420 422 423 /** Print Unicode character to EGA display. 424 * 425 * If CONFIG_EGA is undefined or CONFIG_FB is defined 426 * then this function does nothing. 427 * 428 * Since the EGA can only display Extended ASCII (usually 429 * ISO Latin 1) characters, some of the Unicode characters 430 * can be displayed in a wrong way. Only the newline character 431 * is interpreted, all other characters (even unprintable) are 432 * printed verbatim. 433 * 434 * @param %ebp+0x08 Unicode character to be printed. 435 * 436 */ 437 early_putchar: 438 439 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB))) 440 441 /* Prologue, save preserved registers */ 442 pushl %ebp 443 movl %esp, %ebp 444 pushl %ebx 445 pushl %esi 446 pushl %edi 447 448 movl $(PA2KA(0xb8000)), %edi /* base of EGA text mode memory */ 449 xorl %eax, %eax 450 451 /* Read bits 8 - 15 of the cursor address */ 452 movw $0x3d4, %dx 453 movb $0xe, %al 454 outb %al, %dx 455 456 movw $0x3d5, %dx 457 inb %dx, %al 458 shl $8, %ax 459 460 /* Read bits 0 - 7 of the cursor address */ 461 movw $0x3d4, %dx 462 movb $0xf, %al 463 outb %al, %dx 464 465 movw $0x3d5, %dx 466 inb %dx, %al 467 468 /* Sanity check for the cursor on screen */ 469 cmp $2000, %ax 470 jb early_putchar_cursor_ok 471 472 movw $1998, %ax 473 474 early_putchar_cursor_ok: 475 476 movw %ax, %bx 477 shl $1, %eax 478 addl %eax, %edi 479 480 movl 0x08(%ebp), %eax 481 482 cmp $0x0a, %al 483 jne early_putchar_print 484 485 /* Interpret newline */ 486 487 movw %bx, %ax /* %bx -> %dx:%ax */ 488 xorw %dx, %dx 489 490 movw $80, %cx 491 idivw %cx, %ax /* %dx = %bx % 80 */ 492 493 /* %bx <- %bx + 80 - (%bx % 80) */ 494 addw %cx, %bx 495 subw %dx, %bx 496 497 jmp early_putchar_newline 498 499 early_putchar_print: 500 501 /* Print character */ 502 503 movb $0x0e, %ah /* black background, yellow foreground */ 504 stosw 505 506 early_putchar_newline: 507 508 /* Sanity check for the cursor on the last line */ 509 inc %bx 510 cmp $2000, %bx 511 jb early_putchar_no_scroll 512 513 /* Scroll the screen (24 rows) */ 514 movl $(PA2KA(0xb80a0)), %esi 515 movl $(PA2KA(0xb8000)), %edi 516 movl $1920, %ecx 517 rep movsw 518 519 /* Clear the 24th row */ 520 xorl %eax, %eax 521 movl $80, %ecx 522 rep stosw 523 524 /* Go to row 24 */ 525 movw $1920, %bx 526 527 early_putchar_no_scroll: 528 529 /* Write bits 8 - 15 of the cursor address */ 530 movw $0x3d4, %dx 531 movb $0xe, %al 532 outb %al, %dx 533 534 movw $0x3d5, %dx 535 movb %bh, %al 536 outb %al, %dx 537 538 /* Write bits 0 - 7 of the cursor address */ 539 movw $0x3d4, %dx 540 movb $0xf, %al 541 outb %al, %dx 542 543 movw $0x3d5, %dx 544 movb %bl, %al 545 outb %al, %dx 546 547 /* Epilogue, restore preserved registers */ 548 popl %edi 549 popl %esi 550 popl %ebx 551 leave 552 553 #endif 554 555 ret 556 421 557 .data 422 558 .global interrupt_handler_size -
kernel/arch/ia64/src/asm.S
rad8f03d2 rda52547 200 200 201 201 rfi ;; 202 203 .global early_putchar 204 early_putchar: 205 br.ret.sptk.many b0 -
kernel/arch/mips32/src/asm.S
rad8f03d2 rda52547 307 307 j $ra 308 308 nop 309 310 .global early_putchar 311 early_putchar: 312 j $ra 313 nop -
kernel/arch/ppc32/src/asm.S
rad8f03d2 rda52547 284 284 xor r3, r3, r3 285 285 blr 286 287 early_putchar: 288 blr -
kernel/arch/sparc64/src/asm.S
rad8f03d2 rda52547 273 273 ba %xcc, _memsetw 274 274 nop 275 276 .global early_putchar 277 early_putchar: 278 retl 279 nop -
kernel/generic/include/console/console.h
rad8f03d2 rda52547 56 56 extern outdev_t *stdout; 57 57 58 extern void early_putchar(wchar_t); 59 58 60 extern indev_t *stdin_wire(void); 59 61 extern void stdout_wire(outdev_t *outdev); -
kernel/generic/include/context.h
rad8f03d2 rda52547 87 87 * 88 88 * @param ctx Context structure. 89 * 89 90 */ 90 static inline void context_restore(context_t *ctx) 91 static inline void __attribute__((no_instrument_function)) 92 context_restore(context_t *ctx) 91 93 { 92 94 context_restore_arch(ctx); -
kernel/generic/include/debug.h
rad8f03d2 rda52547 98 98 } while (0) 99 99 100 extern void __cyg_profile_func_enter(void *, void *);101 extern void __cyg_profile_func_exit(void *, void *);102 103 100 #else /* CONFIG_LOG */ 104 101 … … 107 104 #endif /* CONFIG_LOG */ 108 105 106 #ifdef CONFIG_TRACE 107 108 extern void __cyg_profile_func_enter(void *, void *); 109 extern void __cyg_profile_func_exit(void *, void *); 110 111 #endif /* CONFIG_TRACE */ 112 109 113 #endif 110 114 -
kernel/generic/include/macros.h
rad8f03d2 rda52547 47 47 * @param sz2 Size of the second interval. 48 48 */ 49 static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2) 49 static inline int __attribute__((no_instrument_function)) 50 overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2) 50 51 { 51 52 uintptr_t e1 = s1 + sz1; -
kernel/generic/src/console/console.c
rad8f03d2 rda52547 294 294 stdout->op->write(stdout, ch, silent); 295 295 else { 296 /* The character is just in the kernel log */ 296 /* 297 * No standard output routine defined yet. 298 * The character is still stored in the kernel log 299 * for possible future output. 300 * 301 * The early_putchar() function is used to output 302 * the character for low-level debugging purposes. 303 * Note that the early_putc() function might be 304 * a no-op on certain hardware configurations. 305 * 306 */ 307 early_putchar(ch); 308 297 309 if (klog_stored < klog_len) 298 310 klog_stored++; -
kernel/generic/src/debug/debug.c
rad8f03d2 rda52547 36 36 */ 37 37 38 #ifdef CONFIG_ LOG38 #ifdef CONFIG_TRACE 39 39 40 40 #include <debug.h> … … 52 52 if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym, 53 53 &call_site_off) == EOK) 54 printf("%s:%p->%s\n", call_site_sym, call_site_off, fn_sym); 54 printf("%s+%" PRIp "->%s\n", call_site_sym, call_site_off, 55 fn_sym); 55 56 else 56 57 printf("->%s\n", fn_sym); … … 66 67 if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym, 67 68 &call_site_off) == EOK) 68 printf("%s:%p<-%s\n", call_site_sym, call_site_off, fn_sym); 69 printf("%s+%" PRIp "<-%s\n", call_site_sym, call_site_off, 70 fn_sym); 69 71 else 70 72 printf("<-%s\n", fn_sym); 71 73 } 72 74 73 #endif /* CONFIG_ LOG*/75 #endif /* CONFIG_TRACE */ 74 76 75 77 /** @} -
kernel/generic/src/main/main.c
rad8f03d2 rda52547 131 131 * 132 132 */ 133 void main_bsp(void)133 void __attribute__((no_instrument_function)) main_bsp(void) 134 134 { 135 135 config.cpu_count = 1; … … 183 183 version_print(); 184 184 185 LOG("\nconfig.base=% #" PRIp "config.kernel_size=%" PRIs186 "\nconfig.stack_base=% #" PRIp "config.stack_size=%" PRIs,185 LOG("\nconfig.base=%p config.kernel_size=%" PRIs 186 "\nconfig.stack_base=%p config.stack_size=%" PRIs, 187 187 config.base, config.kernel_size, config.stack_base, 188 188 config.stack_size); … … 241 241 size_t i; 242 242 for (i = 0; i < init.cnt; i++) 243 LOG("init[%" PRIs "].addr=% #" PRIp ", init[%" PRIs244 "].size=% #" PRIs, i, init.tasks[i].addr, i,243 LOG("init[%" PRIs "].addr=%p, init[%" PRIs 244 "].size=%" PRIs, i, init.tasks[i].addr, i, 245 245 init.tasks[i].size); 246 246 } else
Note:
See TracChangeset
for help on using the changeset viewer.