summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-28 01:14:13 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-28 01:15:27 +0100
commit0b1f1658732cd0e38ecb84a98b3bdf7a97a3b122 (patch)
treeed8e77b2fae5faa39eb9b507e4ea6b2686f322de /i386
parent5576957a69642e74753e56ee0767b663378d7bca (diff)
x86: allow using 8bit constants in in/out instructions
* i386/i386/pio.h (inl, inw, inb, outl, outw, outb): Add N constraint alternative on port. (outl): Cast data to unsigned int.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/pio.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/i386/i386/pio.h b/i386/i386/pio.h
index fa0bab9f..c488fbb2 100644
--- a/i386/i386/pio.h
+++ b/i386/i386/pio.h
@@ -33,29 +33,29 @@
#define inl(y) \
({ unsigned int _tmp__; \
- asm volatile("inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
+ asm volatile("inl %1, %0" : "=a" (_tmp__) : "dN" ((unsigned short)(y))); \
_tmp__; })
#define inw(y) \
({ unsigned short _tmp__; \
- asm volatile("inw %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
+ asm volatile("inw %1, %0" : "=a" (_tmp__) : "dN" ((unsigned short)(y))); \
_tmp__; })
#define inb(y) \
({ unsigned char _tmp__; \
- asm volatile("inb %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
+ asm volatile("inb %1, %0" : "=a" (_tmp__) : "dN" ((unsigned short)(y))); \
_tmp__; })
#define outl(x, y) \
-{ asm volatile("outl %0, %1" : : "a" (y) , "d" ((unsigned short)(x))); }
+{ asm volatile("outl %0, %1" : : "a" ((unsigned int)(y)) , "dN" ((unsigned short)(x))); }
#define outw(x, y) \
-{ asm volatile("outw %0, %1" : : "a" ((unsigned short)(y)) , "d" ((unsigned short)(x))); }
+{ asm volatile("outw %0, %1" : : "a" ((unsigned short)(y)) , "dN" ((unsigned short)(x))); }
#define outb(x, y) \
-{ asm volatile("outb %0, %1" : : "a" ((unsigned char)(y)) , "d" ((unsigned short)(x))); }
+{ asm volatile("outb %0, %1" : : "a" ((unsigned char)(y)) , "dN" ((unsigned short)(x))); }
#endif /* _I386_PIO_H_ */