]> mj.ucw.cz Git - pciutils.git/commit
libpci: i386-io-windows.h: Fix definitions of I/O port functions for UCRT, CRTDLL...
authorPali Rohár <pali@kernel.org>
Sat, 25 Dec 2021 12:45:28 +0000 (13:45 +0100)
committerMartin Mareš <mj@ucw.cz>
Sun, 26 Dec 2021 21:32:18 +0000 (22:32 +0100)
commit2b32362a2f8f4e7ebc509d7163f12d1ae24346a5
treeff8cff5663c79efe176da091c1d43fdad98b0443
parent8e6f2fcd2580894419c2807f8c1c5a8630a7d644
libpci: i386-io-windows.h: Fix definitions of I/O port functions for UCRT, CRTDLL and for 64-bit mode

Functions _outp(), _outpw(), _outpd(), _inp(), _inpw() and _inpd() are
available only in 32-bit version of the old MSVCRT library. They are not
available in 64-bit version of old MSVCRT library and neither the oldest
CRTDLL library or in new UCRT library.

Function prototypes for 32-bit mode should be available in <conio.h> header
file. But they are missing in some MinGW toolchains.

For 64-bit mode I/O port functions are defined only as inline functions or
intrinsics macros in <intrin.h> header file but under different names:
__outbyte(), __outword(), __outdword(), __inbyte(), __inword(), __indword()
This header file is available also in UCRT-compatible compilers.

When compiling with the oldest CRTDLL library and not using <intrin.h>
header file, it is required to provide own implementation of these
functions. Do it via inline assembly.

With this change it is possible to compile i386-io-windows.h with all
combination of toolchains, compilers, crt library and arch mode.

The most important is the fix to allow compilation with modern UCRT
library.
lib/i386-io-windows.h