Changeset d5d2a3f in mainline for src/main/main.c


Ignore:
Timestamp:
2005-05-25T12:29:18Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2998046
Parents:
c23fd6b1
Message:

Add context_set() macro to support extended behaviour for architectures with more than one stack (e.g. IA-64).
Now there is one generic context_set() defined in include/context.h and one IA-64 specific defined in arch/ia64/include/context.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/main.c

    rc23fd6b1 rd5d2a3f  
    2828
    2929#include <arch/asm.h>
    30 #include <arch/context.h>
     30#include <context.h>
    3131#include <print.h>
    3232#include <panic.h>
     
    9595
    9696        context_save(&ctx);
    97         ctx.sp = config.base + config.kernel_size - SP_DELTA;
    98         ctx.pc = FADDR(main_bsp_separated_stack);
     97        context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE, CONFIG_STACK_SIZE);
    9998        context_restore(&ctx);
    10099        /* not reached */
     
    193192         * switch to this cpu's private stack prior to waking kmp up.
    194193         */
    195         CPU->saved_context.sp = (__address) &CPU->stack[CPU_STACK_SIZE-SP_DELTA];
    196         CPU->saved_context.pc = FADDR(main_ap_separated_stack);
     194        context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), CPU->stack, CPU_STACK_SIZE);
    197195        context_restore(&CPU->saved_context);
    198196        /* not reached */
Note: See TracChangeset for help on using the changeset viewer.