Merge branch 'master' of g.csail.mit.edu:xv6-dev

This commit is contained in:
Frans Kaashoek 2016-09-02 08:36:14 -04:00
commit b8fd4cba13
3 changed files with 9 additions and 3 deletions

7
proc.c
View file

@ -302,7 +302,12 @@ scheduler(void)
} }
// Enter scheduler. Must hold only ptable.lock // Enter scheduler. Must hold only ptable.lock
// and have changed proc->state. // and have changed proc->state. Saves and restores
// intena because intena is a property of this
// kernel thread, not this CPU. It should
// be proc->intena and proc->ncli, but that would
// break in the few places where a lock is held but
// there's no process.
void void
sched(void) sched(void)
{ {

View file

@ -102,8 +102,9 @@ pushcli(void)
eflags = readeflags(); eflags = readeflags();
cli(); cli();
if(cpu->ncli++ == 0) if(cpu->ncli == 0)
cpu->intena = eflags & FL_IF; cpu->intena = eflags & FL_IF;
cpu->ncli += 1;
} }
void void

2
vm.c
View file

@ -27,7 +27,7 @@ seginit(void)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
// Map cpu and curproc -- these are private per cpu. // Map cpu and proc -- these are private per cpu.
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0); c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0);
lgdt(c->gdt, sizeof(c->gdt)); lgdt(c->gdt, sizeof(c->gdt));