Subversion Repositories HelenOS-historic

Rev

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

Rev 110 Rev 113
Line 390... Line 390...
390
                break;
390
                break;
391
        }
391
        }
392
    }
392
    }
393
}
393
}
394
 
394
 
-
 
395
 
395
/*
396
/*
396
 * Kernel thread for bringing up application processors. It becomes clear
397
 * Kernel thread for bringing up application processors. It becomes clear
397
 * that we need an arrangement like this (AP's being initialized by a kernel
398
 * that we need an arrangement like this (AP's being initialized by a kernel
398
 * thread), for a thread has its dedicated stack. (The stack used during the
399
 * thread), for a thread has its dedicated stack. (The stack used during the
399
 * BSP initialization (prior the very first call to scheduler()) will be used
400
 * BSP initialization (prior the very first call to scheduler()) will be used
Line 412... Line 413...
412
     * Processor entries immediately follow the configuration table header.
413
     * Processor entries immediately follow the configuration table header.
413
     */
414
     */
414
    pr = processor_entries;
415
    pr = processor_entries;
415
 
416
 
416
    /*
417
    /*
417
     * Grab a frame and map its address to page 0. This is a hack which
-
 
418
     * accesses data in frame 0. Note that page 0 is not present because
-
 
419
     * of nil reference bug catching.
418
     * We need to access data in frame 0.
420
     */
419
     */
421
    frame = frame_alloc(FRAME_KA);
420
    frame = frame_alloc(0);
422
    map_page_to_frame(frame,0,PAGE_CACHEABLE,0);
421
    map_page_to_frame(frame,0,PAGE_CACHEABLE,0);
423
 
422
 
424
    /*
423
    /*
425
     * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot()
424
     * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot()
426
     */
425
     */
Line 471... Line 470...
471
        if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor))))
470
        if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor))))
472
            panic("couldn't allocate memory for GDT\n");
471
            panic("couldn't allocate memory for GDT\n");
473
 
472
 
474
        memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor));
473
        memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor));
475
        gdtr.base = KA2PA((__address) gdt_new);
474
        gdtr.base = KA2PA((__address) gdt_new);
476
       
475
 
477
        if (l_apic_send_init_ipi(pr[i].l_apic_id)) {
476
        if (l_apic_send_init_ipi(pr[i].l_apic_id)) {
478
            /*
477
            /*
479
                 * There may be just one AP being initialized at
478
                 * There may be just one AP being initialized at
480
             * the time. After it comes completely up, it is
479
             * the time. After it comes completely up, it is
481
             * supposed to wake us up.
480
             * supposed to wake us up.