Changeset da52547 in mainline for kernel/generic


Ignore:
Timestamp:
2010-07-02T10:16:38Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b5382d4f
Parents:
ad8f03d2
Message:

add early_putchar() which can be used to do early kernel console output for debugging purposes
(the availability of this feature depends on each platform and specific configuration, currently it works only on ia32/amd64 with EGA and no framebuffer)
instrument more kernel functions
mark some functions as no_instrument (context_restore(), overlaps(), main_bsp())

Location:
kernel/generic
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/console/console.h

    rad8f03d2 rda52547  
    5656extern outdev_t *stdout;
    5757
     58extern void early_putchar(wchar_t);
     59
    5860extern indev_t *stdin_wire(void);
    5961extern void stdout_wire(outdev_t *outdev);
  • kernel/generic/include/context.h

    rad8f03d2 rda52547  
    8787 *
    8888 * @param ctx Context structure.
     89 *
    8990 */
    90 static inline void context_restore(context_t *ctx)
     91static inline void __attribute__((no_instrument_function))
     92    context_restore(context_t *ctx)
    9193{
    9294        context_restore_arch(ctx);
  • kernel/generic/include/debug.h

    rad8f03d2 rda52547  
    9898        } while (0)
    9999
    100 extern void __cyg_profile_func_enter(void *, void *);
    101 extern void __cyg_profile_func_exit(void *, void *);
    102 
    103100#else /* CONFIG_LOG */
    104101
     
    107104#endif /* CONFIG_LOG */
    108105
     106#ifdef CONFIG_TRACE
     107
     108extern void __cyg_profile_func_enter(void *, void *);
     109extern void __cyg_profile_func_exit(void *, void *);
     110
     111#endif /* CONFIG_TRACE */
     112
    109113#endif
    110114
  • kernel/generic/include/macros.h

    rad8f03d2 rda52547  
    4747 * @param sz2 Size of the second interval.
    4848 */
    49 static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2)
     49static inline int __attribute__((no_instrument_function))
     50    overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2)
    5051{
    5152        uintptr_t e1 = s1 + sz1;
  • kernel/generic/src/console/console.c

    rad8f03d2 rda52547  
    294294                stdout->op->write(stdout, ch, silent);
    295295        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               
    297309                if (klog_stored < klog_len)
    298310                        klog_stored++;
  • kernel/generic/src/debug/debug.c

    rad8f03d2 rda52547  
    3636 */
    3737
    38 #ifdef CONFIG_LOG
     38#ifdef CONFIG_TRACE
    3939
    4040#include <debug.h>
     
    5252        if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym,
    5353            &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);
    5556        else
    5657                printf("->%s\n", fn_sym);
     
    6667        if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym,
    6768            &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);
    6971        else
    7072                printf("<-%s\n", fn_sym);
    7173}
    7274
    73 #endif /* CONFIG_LOG */
     75#endif /* CONFIG_TRACE */
    7476
    7577/** @}
  • kernel/generic/src/main/main.c

    rad8f03d2 rda52547  
    131131 *
    132132 */
    133 void main_bsp(void)
     133void __attribute__((no_instrument_function)) main_bsp(void)
    134134{
    135135        config.cpu_count = 1;
     
    183183        version_print();
    184184       
    185         LOG("\nconfig.base=%#" PRIp " config.kernel_size=%" PRIs
    186             "\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,
    187187            config.base, config.kernel_size, config.stack_base,
    188188            config.stack_size);
     
    241241                size_t i;
    242242                for (i = 0; i < init.cnt; i++)
    243                         LOG("init[%" PRIs "].addr=%#" PRIp ", init[%" PRIs
    244                             "].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,
    245245                            init.tasks[i].size);
    246246        } else
Note: See TracChangeset for help on using the changeset viewer.