Changeset 7a4202d in mainline


Ignore:
Timestamp:
2008-06-19T12:17:02Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0db266f
Parents:
934b2e0
Message:

Don't print anything before the kernel initializes the first THE
structure. This fixes a regression introduced in r3061. If anything
worked from r3061 until now, it was only due to luck. arm32 was not
that lucky when built with gcc 4.3.1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/main.c

    r934b2e0 r7a4202d  
    132132/** Main kernel routine for bootstrap CPU.
    133133 *
    134  * Initializes the kernel by bootstrap CPU.
    135  * This function passes control directly to
    136  * main_bsp_separated_stack().
     134 * The code here still runs on the boot stack, which knows nothing about
     135 * preemption counts.  Because of that, this function cannot directly call
     136 * functions that disable or enable preemption (e.g. spinlock_lock()). The
     137 * primary task of this function is to calculate address of a new stack and
     138 * switch to it.
    137139 *
    138140 * Assuming interrupts_disable().
     
    141143void main_bsp(void)
    142144{
    143         LOG();
    144        
    145145        config.cpu_count = 1;
    146146        config.cpu_active = 1;
     
    174174                config.stack_base = ALIGN_UP(stack_safe, PAGE_SIZE);
    175175       
    176         version_print();
    177        
    178         LOG("\nconfig.base=%#" PRIp " config.kernel_size=%" PRIs
    179                 "\nconfig.stack_base=%#" PRIp " config.stack_size=%" PRIs,
    180                 config.base, config.kernel_size,
    181                 config.stack_base, config.stack_size);
    182        
    183176        context_save(&ctx);
    184177        context_set(&ctx, FADDR(main_bsp_separated_stack), config.stack_base,
     
    196189void main_bsp_separated_stack(void)
    197190{
     191        /* Keep this the first thing. */
     192        the_initialize(THE);
     193
    198194        LOG();
    199195       
    200         the_initialize(THE);
     196        version_print();
     197       
     198        LOG("\nconfig.base=%#" PRIp " config.kernel_size=%" PRIs
     199            "\nconfig.stack_base=%#" PRIp " config.stack_size=%" PRIs,
     200            config.base, config.kernel_size, config.stack_base,
     201            config.stack_size);
     202       
    201203
    202204        /*
     
    250252                count_t i;
    251253                for (i = 0; i < init.cnt; i++)
    252                         printf("init[%" PRIc "].addr=%#" PRIp
    253                                 ", init[%" PRIc "].size=%#" PRIs "\n",
    254                                 i, init.tasks[i].addr,
    255                                 i, init.tasks[i].size);
     254                        printf("init[%" PRIc "].addr=%#" PRIp ", init[%" PRIc
     255                            "].size=%#" PRIs "\n", i, init.tasks[i].addr,
     256                            i, init.tasks[i].size);
    256257        } else
    257258                printf("No init binaries found\n");
     
    270271         * Create the first thread.
    271272         */
    272         thread_t *kinit_thread = thread_create(kinit, NULL, kernel, 0, "kinit", true);
     273        thread_t *kinit_thread = thread_create(kinit, NULL, kernel, 0, "kinit",
     274            true);
    273275        if (!kinit_thread)
    274276                panic("Can't create kinit thread\n");
Note: See TracChangeset for help on using the changeset viewer.