[INTRIN]
[reactos.git] / include / crt / mingw32 / intrin_x86.h
index 9e83ed8..6125043 100644 (file)
@@ -114,7 +114,7 @@ __INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destinati
 
 __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
 {
-       return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
+       return (void *)__sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
 __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value)
@@ -137,7 +137,7 @@ __INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Targe
 {
        /* NOTE: ditto */
        __sync_synchronize();
-       return __sync_lock_test_and_set(Target, Value);
+       return (void *)__sync_lock_test_and_set(Target, Value);
 }
 
 __INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
@@ -1113,6 +1113,39 @@ __INTRIN_INLINE void __outdwordstring(unsigned short const Port, const unsigned
        __asm__ __volatile__("rep; outsl" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
 }
 
+__INTRIN_INLINE int _inp(unsigned short Port)
+{
+       return __inbyte(Port);
+}
+
+__INTRIN_INLINE unsigned short _inpw(unsigned short Port)
+{
+       return __inword(Port);
+}
+
+__INTRIN_INLINE unsigned long _inpd(unsigned short Port)
+{
+       return __indword(Port);
+}
+
+__INTRIN_INLINE int _outp(unsigned short Port, int databyte)
+{
+       __outbyte(Port, databyte);
+       return databyte;
+}
+
+__INTRIN_INLINE unsigned short _outpw(unsigned short Port, unsigned short dataword)
+{
+       __outword(Port, dataword);
+       return dataword;
+}
+
+__INTRIN_INLINE unsigned long _outpd(unsigned short Port, unsigned long dataword)
+{
+       __outdword(Port, dataword);
+       return dataword;
+}
+
 
 /*** System information ***/
 __INTRIN_INLINE void __cpuid(int CPUInfo[], const int InfoType)