Rev 2745 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2745 | Rev 3071 | ||
---|---|---|---|
Line 140... | Line 140... | ||
140 | } |
140 | } |
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("couldn't allocate memory for GDT\n"); |
147 | 147 | ||
148 | memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor)); |
148 | memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor)); |
149 | memsetb((uintptr_t)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0); |
149 | memsetb((uintptr_t)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0); |
150 | gdtr.base = (uintptr_t) gdt_new; |
150 | gdtr.base = (uintptr_t) gdt_new; |