Subversion Repositories HelenOS

Rev

Rev 71 | Rev 77 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 71 Rev 76
Line 51... Line 51...
51
#include <mm/page.h>
51
#include <mm/page.h>
52
#include <mm/tlb.h>
52
#include <mm/tlb.h>
53
#include <synch/waitq.h>
53
#include <synch/waitq.h>
54
 
54
 
55
#include <arch.h>
55
#include <arch.h>
-
 
56
#include <arch/faddr.h>
56
 
57
 
57
char *project = "SPARTAN kernel";
58
char *project = "SPARTAN kernel";
58
char *copyright = "Copyright (C) 2001-2005 Jakub Jermar, Copyright (C) 2005 HelenOS project";
59
char *copyright = "Copyright (C) 2001-2005 Jakub Jermar, Copyright (C) 2005 HelenOS project";
59
 
60
 
60
config_t config;
61
config_t config;
Line 92... Line 93...
92
    config.memory_size = CONFIG_MEMORY_SIZE;
93
    config.memory_size = CONFIG_MEMORY_SIZE;
93
    config.kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE + CONFIG_STACK_SIZE;
94
    config.kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE + CONFIG_STACK_SIZE;
94
 
95
 
95
    context_save(&ctx);
96
    context_save(&ctx);
96
    ctx.sp = config.base + config.kernel_size - 8;
97
    ctx.sp = config.base + config.kernel_size - 8;
97
    ctx.pc = (__address) main_bsp_separated_stack;
98
    ctx.pc = FADDR(main_bsp_separated_stack);
98
    context_restore(&ctx);
99
    context_restore(&ctx);
99
    /* not reached */
100
    /* not reached */
100
}
101
}
101
 
102
 
102
void main_bsp_separated_stack(void) {
103
void main_bsp_separated_stack(void) {
Line 190... Line 191...
190
     * If we woke kmp up before we left the kernel stack, we could
191
     * If we woke kmp up before we left the kernel stack, we could
191
     * collide with another CPU coming up. To prevent this, we
192
     * collide with another CPU coming up. To prevent this, we
192
     * switch to this cpu's private stack prior to waking kmp up.
193
     * switch to this cpu's private stack prior to waking kmp up.
193
     */
194
     */
194
    CPU->saved_context.sp = (__address) &CPU->stack[CPU_STACK_SIZE-8];
195
    CPU->saved_context.sp = (__address) &CPU->stack[CPU_STACK_SIZE-8];
195
    CPU->saved_context.pc = (__address) main_ap_separated_stack;
196
    CPU->saved_context.pc = FADDR(main_ap_separated_stack);
196
    context_restore(&CPU->saved_context);
197
    context_restore(&CPU->saved_context);
197
    /* not reached */
198
    /* not reached */
198
}
199
}
199
 
200
 
200
void main_ap_separated_stack(void)
201
void main_ap_separated_stack(void)