Subversion Repositories HelenOS

Rev

Rev 4344 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4344 Rev 4346
Line 129... Line 129...
129
    apic_init();
129
    apic_init();
130
   
130
   
131
    uint8_t apic = l_apic_id();
131
    uint8_t apic = l_apic_id();
132
 
132
 
133
    for (i = 0; i < ops->cpu_count(); i++) {
133
    for (i = 0; i < ops->cpu_count(); i++) {
134
        struct descriptor *gdt_new;
134
        descriptor_t *gdt_new;
135
   
135
       
136
        /*
136
        /*
137
         * Skip processors marked unusable.
137
         * Skip processors marked unusable.
138
         */
138
         */
139
        if (!ops->cpu_enabled(i))
139
        if (!ops->cpu_enabled(i))
Line 157... Line 157...
157
       
157
       
158
        /* XXX Flag FRAME_LOW_4_GiB was removed temporarily,
158
        /* XXX Flag FRAME_LOW_4_GiB was removed temporarily,
159
         * it needs to be replaced by a generic fuctionality of
159
         * it needs to be replaced by a generic fuctionality of
160
         * the memory subsystem
160
         * the memory subsystem
161
         */
161
         */
162
        gdt_new = (struct descriptor *) malloc(GDT_ITEMS *
162
        gdt_new = (descriptor_t *) malloc(GDT_ITEMS *
163
            sizeof(struct descriptor), FRAME_ATOMIC);
163
            sizeof(descriptor_t), FRAME_ATOMIC);
164
        if (!gdt_new)
164
        if (!gdt_new)
165
            panic("Cannot allocate memory for GDT.");
165
            panic("Cannot allocate memory for GDT.");
166
 
166
 
167
        memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor));
167
        memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(descriptor_t));
168
        memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0);
168
        memsetb(&gdt_new[TSS_DES], sizeof(descriptor_t), 0);
169
        protected_ap_gdtr.limit = GDT_ITEMS * sizeof(struct descriptor);
169
        protected_ap_gdtr.limit = GDT_ITEMS * sizeof(descriptor_t);
170
        protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new);
170
        protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new);
171
        gdtr.base = (uintptr_t) gdt_new;
171
        gdtr.base = (uintptr_t) gdt_new;
172
 
172
 
173
        if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) {
173
        if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) {
174
            /*
174
            /*