提交 3163085a 创建 作者: rsc's avatar rsc

Cannot use "g" as an arg constraint because

some memory references aren't actually valid and gcc is a bit too smart in parsing (%0) and a bit too dumb in knowing which memory refs are not valid. Using "r" seems to constrain gcc to use a register as in (%eax) and not substitute a memory reference like (-36(%ebp)). No one really understands these things.
上级 5e03dd86
......@@ -50,7 +50,7 @@ lgdt(struct segdesc *p, int size)
pd[1] = (uint)p;
pd[2] = (uint)p >> 16;
asm volatile("lgdt (%0)" : : "g" (pd));
asm volatile("lgdt (%0)" : : "r" (&pd));
}
struct gatedesc;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论