-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
在做lab4的Part A 的 Exercise 4 时,trap.c的trap_init_percpu中:
gdt[GD_TSS0 >> 3] = SEG16(STS_T32A, (uint32_t) (&thiscpu->cpu_ts), sizeof(struct Taskstate) - 1, 0);
gdt[GD_TSS0 >> 3].sd_s = 0;
ltr(GD_TSS0);
应改为:
int i = thiscpu->cpu_id;
gdt[(GD_TSS0 >> 3) + i] = SEG16(STS_T32A, (uint32_t) (&thiscpu->cpu_ts), sizeof(struct Taskstate) - 1, 0);
gdt[(GD_TSS0 >> 3) + i].sd_s = 0;
ltr(GD_TSS0+(i << 3));
否则,多核共用一个异常栈,报错
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels