Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 692 → Rev 693

/kernel/trunk/arch/ia32/src/smp/smp.c
30,6 → 30,7
#include <arch/smp/smp.h>
#include <arch/smp/mps.h>
#include <arch/smp/ap.h>
#include <arch/boot/boot.h>
#include <genarch/acpi/acpi.h>
#include <genarch/acpi/madt.h>
#include <config.h>
141,9 → 142,10
if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor))))
panic("couldn't allocate memory for GDT\n");
 
memcpy(gdt_new, gdt, GDT_ITEMS*sizeof(struct descriptor));
memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor));
memsetb((__address)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0);
real_bootstrap_gdtr.base = KA2PA((__address) gdt_new);
protected_ap_gdtr.limit = GDT_ITEMS * sizeof(struct descriptor);
protected_ap_gdtr.base = KA2PA((__address) gdt_new);
gdtr.base = (__address) gdt_new;
 
if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) {
/kernel/trunk/arch/ia32/src/smp/ap.S
1,5 → 1,6
#
# Copyright (C) 2001-2004 Jakub Jermar
# Copyright (C) 2005-2006 Martin Decky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
30,11 → 31,16
# Init code for application processors.
#
 
.section K_TEXT_START_2, "ax"
#include <arch/boot/boot.h>
#include <arch/boot/memmap.h>
#include <arch/mm/page.h>
#include <arch/pm.h>
 
.section K_TEXT_START, "ax"
 
#ifdef CONFIG_SMP
 
.global ap_boot
.global unmapped_ap_boot
 
KTEXT=8
KDATA=16
44,18 → 50,18
# requirements.
 
.align 4096
ap_boot:
unmapped_ap_boot:
.code16
cli
xorw %ax, %ax
movw %ax, %ds
 
lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register
lgdt ap_gdtr # initialize Global Descriptor Table register
movl %cr0, %eax
orl $1, %eax
movl %eax, %cr0 # switch to protected mode
jmpl $KTEXT, $jump_to_kernel
jmpl $KTEXT, $jump_to_kernel - BOOT_OFFSET + AP_BOOT_OFFSET
jump_to_kernel:
.code32
63,7 → 69,7
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
movl $(ctx-0x80000000), %eax # KA2PA((__address) &ctx)
movl $KA2PA(ctx), %eax # KA2PA((__address) &ctx)
movl (%eax), %esp
subl $0x80000000, %esp # KA2PA(ctx.sp)
 
74,3 → 80,16
jmpl $KTEXT, $main_ap
 
#endif /* CONFIG_SMP */
 
 
.section K_DATA_START, "ax"
 
#ifdef CONFIG_SMP
 
.global unmapped_ap_gdtr
 
unmapped_ap_gdtr:
.word 0
.long 0
 
#endif /* CONFIG_SMP */
/kernel/trunk/arch/ia32/src/smp/apic.c
30,6 → 30,7
#include <arch/smp/apic.h>
#include <arch/smp/ap.h>
#include <arch/smp/mps.h>
#include <arch/boot/boot.h>
#include <mm/page.h>
#include <time/delay.h>
#include <interrupt.h>