Rev 3104 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3104 | Rev 3790 | ||
---|---|---|---|
Line 70... | Line 70... | ||
70 | ops = &mps_config_operations; |
70 | ops = &mps_config_operations; |
71 | } |
71 | } |
72 | 72 | ||
73 | l_apic_address = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
73 | l_apic_address = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
74 | if (!l_apic_address) |
74 | if (!l_apic_address) |
75 | panic("cannot allocate address for l_apic\n"); |
75 | panic("Cannot allocate address for l_apic."); |
76 | 76 | ||
77 | io_apic_address = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
77 | io_apic_address = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
78 | if (!io_apic_address) |
78 | if (!io_apic_address) |
79 | panic("cannot allocate address for io_apic\n"); |
79 | panic("Cannot allocate address for io_apic."); |
80 | 80 | ||
81 | if (config.cpu_count > 1) { |
81 | if (config.cpu_count > 1) { |
82 | page_mapping_insert(AS_KERNEL, l_apic_address, (uintptr_t) l_apic, |
82 | page_mapping_insert(AS_KERNEL, l_apic_address, (uintptr_t) l_apic, |
83 | PAGE_NOT_CACHEABLE | PAGE_WRITE); |
83 | PAGE_NOT_CACHEABLE | PAGE_WRITE); |
84 | page_mapping_insert(AS_KERNEL, io_apic_address, (uintptr_t) io_apic, |
84 | page_mapping_insert(AS_KERNEL, io_apic_address, (uintptr_t) io_apic, |
Line 141... | Line 141... | ||
141 | 141 | ||
142 | /* |
142 | /* |
143 | * Prepare new GDT for CPU in question. |
143 | * Prepare new GDT for CPU in question. |
144 | */ |
144 | */ |
145 | if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS * sizeof(struct descriptor), FRAME_ATOMIC))) |
145 | if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS * sizeof(struct descriptor), FRAME_ATOMIC))) |
146 | panic("couldn't allocate memory for GDT\n"); |
146 | panic("Cannot allocate memory for GDT."); |
147 | 147 | ||
148 | memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor)); |
148 | memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor)); |
149 | memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0); |
149 | memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0); |
150 | gdtr.base = (uintptr_t) gdt_new; |
150 | gdtr.base = (uintptr_t) gdt_new; |
151 | 151 |