Subversion Repositories HelenOS

Rev

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

Rev 279 Rev 294
Line 32... Line 32...
32
#include <arch/smp/ap.h>
32
#include <arch/smp/ap.h>
33
#include <arch/acpi/acpi.h>
33
#include <arch/acpi/acpi.h>
34
#include <arch/acpi/madt.h>
34
#include <arch/acpi/madt.h>
35
#include <config.h>
35
#include <config.h>
36
#include <synch/waitq.h>
36
#include <synch/waitq.h>
-
 
37
#include <synch/synch.h>
37
#include <arch/pm.h>
38
#include <arch/pm.h>
38
#include <func.h>
39
#include <func.h>
39
#include <panic.h>
40
#include <panic.h>
40
#include <debug.h>
41
#include <debug.h>
41
#include <arch/asm.h>
42
#include <arch/asm.h>
Line 109... Line 110...
109
     * BIOS will not do the POST after the INIT signal.
110
     * BIOS will not do the POST after the INIT signal.
110
     */
111
     */
111
    outb(0x70,0xf);
112
    outb(0x70,0xf);
112
    outb(0x71,0xa);
113
    outb(0x71,0xa);
113
 
114
 
114
    cpu_priority_high();
-
 
115
 
-
 
116
    pic_disable_irqs(0xffff);
115
    pic_disable_irqs(0xffff);
117
    apic_init();
116
    apic_init();
118
 
117
 
119
    for (i = 0; i < ops->cpu_count(); i++) {
118
    for (i = 0; i < ops->cpu_count(); i++) {
120
        struct descriptor *gdt_new;
119
        struct descriptor *gdt_new;
Line 130... Line 129...
130
         */
129
         */
131
        if (ops->cpu_bootstrap(i))
130
        if (ops->cpu_bootstrap(i))
132
            continue;
131
            continue;
133
 
132
 
134
        if (ops->cpu_apic_id(i) == l_apic_id()) {
133
        if (ops->cpu_apic_id(i) == l_apic_id()) {
135
            printf("kmp: bad processor entry #%d, will not send IPI to myself\n", i);
134
            printf("%s: bad processor entry #%d, will not send IPI to myself\n", __FUNCTION__, i);
136
            continue;
135
            continue;
137
        }
136
        }
138
       
137
       
139
        /*
138
        /*
140
         * Prepare new GDT for CPU in question.
139
         * Prepare new GDT for CPU in question.
Line 151... Line 150...
151
            /*
150
            /*
152
                 * There may be just one AP being initialized at
151
                 * There may be just one AP being initialized at
153
             * the time. After it comes completely up, it is
152
             * the time. After it comes completely up, it is
154
             * supposed to wake us up.
153
             * supposed to wake us up.
155
                 */
154
                 */
156
            waitq_sleep(&ap_completion_wq);
155
            if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_BLOCKING) == ESYNCH_TIMEOUT)
-
 
156
                printf("%s: waiting for cpu%d (APIC ID = %d) timed out\n", __FUNCTION__, config.cpu_active > i ? config.cpu_active : i, ops->cpu_apic_id(i));
157
        }
157
        }
158
        else {
158
        else {
159
            printf("INIT IPI for l_apic%d failed\n", ops->cpu_apic_id(i));
159
            printf("INIT IPI for l_apic%d failed\n", ops->cpu_apic_id(i));
160
        }
160
        }
161
    }
161
    }