diff options
author | rsc <rsc> | 2007-08-14 04:05:27 +0000 |
---|---|---|
committer | rsc <rsc> | 2007-08-14 04:05:27 +0000 |
commit | 3163085ace9f530bdf6dbc83c62d5e3842728860 (patch) | |
tree | fe6c4210a15fe5e6aedf942a0b2b20e30464791e /x86.h | |
parent | 5e03dd86c8de6180ddbddb16974e5af1a010f60b (diff) | |
download | xv6-labs-3163085ace9f530bdf6dbc83c62d5e3842728860.tar.gz xv6-labs-3163085ace9f530bdf6dbc83c62d5e3842728860.tar.bz2 xv6-labs-3163085ace9f530bdf6dbc83c62d5e3842728860.zip |
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.
Diffstat (limited to 'x86.h')
-rw-r--r-- | x86.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |