Skip to content

Commit

Permalink
can set just %gs now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ Cox committed Sep 2, 2009
1 parent 7e0cc8e commit d26025d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ ksegment(void)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0);
lgdt(c->gdt, sizeof(c->gdt));
loadfsgs(SEG_KCPU << 3);
loadgs(SEG_KCPU << 3);

// Initialize cpu-local storage.
asm volatile(""); // Do not let gcc reorder across this line.
cpu = c;
proc = 0;
}
Expand Down
3 changes: 1 addition & 2 deletions x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ xchg(volatile uint *addr, uint newval)
}

static inline void
loadfsgs(ushort v)
loadgs(ushort v)
{
asm volatile("movw %0, %%fs" : : "r" (v));
asm volatile("movw %0, %%gs" : : "r" (v));
}

Expand Down

0 comments on commit d26025d

Please sign in to comment.