Rev 244 | Rev 269 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 244 | Rev 267 | ||
---|---|---|---|
Line 68... | Line 68... | ||
68 | static struct tss tss; |
68 | static struct tss tss; |
69 | 69 | ||
70 | struct tss *tss_p = NULL; |
70 | struct tss *tss_p = NULL; |
71 | 71 | ||
72 | /* gdtr is changed by kmp before next CPU is initialized */ |
72 | /* gdtr is changed by kmp before next CPU is initialized */ |
73 | struct ptr_16_32 gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt - BOOT_OFFSET) }; |
73 | struct ptr_16_32 bsp_bootstrap_gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt - BOOT_OFFSET) }; |
- | 74 | struct ptr_16_32 ap_bootstrap_gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }; |
|
- | 75 | struct ptr_16_32 gdtr = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }; |
|
74 | struct ptr_16_32 idtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(idt), .base = KA2PA((__address) idt) }; |
76 | struct ptr_16_32 idtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(idt), .base = KA2PA((__address) idt) }; |
75 | 77 | ||
76 | void gdt_setbase(struct descriptor *d, __address base) |
78 | void gdt_setbase(struct descriptor *d, __address base) |
77 | { |
79 | { |
78 | d->base_0_15 = base & 0xffff; |
80 | d->base_0_15 = base & 0xffff; |
Line 168... | Line 170... | ||
168 | 170 | ||
169 | 171 | ||
170 | /* |
172 | /* |
171 | * Update addresses in GDT and IDT to their virtual counterparts. |
173 | * Update addresses in GDT and IDT to their virtual counterparts. |
172 | */ |
174 | */ |
173 | gdtr.base = KA2PA(gdtr.base); |
175 | gdtr.base = (__address) gdt; |
174 | idtr.base = (__address) idt; |
176 | idtr.base = (__address) idt; |
175 | __asm__ volatile ("lgdt %0\n" : : "m" (gdtr)); |
177 | __asm__ volatile ("lgdt %0\n" : : "m" (gdtr)); |
176 | __asm__ volatile ("lidt %0\n" : : "m" (idtr)); |
178 | __asm__ volatile ("lidt %0\n" : : "m" (idtr)); |
177 | 179 | ||
178 | /* |
180 | /* |