memtest86+-5.01-io-extern-inline.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. http://forum.canardpc.com/threads/110951-fix-build-with-newer-gcc-versions
  2. the meaning of extern inline changed between standards. use static inline
  3. for these tiny I/O functions everywhere to keep things simple.
  4. --- a/io.h
  5. +++ b/io.h
  6. @@ -31,6 +31,6 @@
  7. */
  8. #define __OUT1(s,x) \
  9. -extern inline void __out##s(unsigned x value, unsigned short port) {
  10. +static inline void __out##s(unsigned x value, unsigned short port) {
  11. #define __OUT2(s,s1,s2) \
  12. @@ -43,6 +43,6 @@
  13. __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
  14. #define __IN1(s) \
  15. -extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
  16. +static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
  17. #define __IN2(s,s1,s2) \
  18. @@ -55,6 +55,6 @@
  19. __IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; }
  20. #define __OUTS(s) \
  21. -extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
  22. +static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
  23. { __asm__ __volatile__ ("cld ; rep ; outs" #s \
  24. : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }