From 0b1f1658732cd0e38ecb84a98b3bdf7a97a3b122 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 28 Nov 2020 01:14:13 +0100 Subject: 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. --- i386/i386/pio.h | 12 ++++++------ 1 file 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_ */ -- cgit v1.2.3