1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
8 * Purpose: Macros to access device
21 /*--------------------- Export Definitions -------------------------*/
23 /* For memory mapped IO */
25 #define VNSvInPortB(dwIOAddress, pbyData) \
26 (*(pbyData) = ioread8(dwIOAddress))
28 #define VNSvInPortW(dwIOAddress, pwData) \
29 (*(pwData) = ioread16(dwIOAddress))
31 #define VNSvInPortD(dwIOAddress, pdwData) \
32 (*(pdwData) = ioread32(dwIOAddress))
34 #define VNSvOutPortB(dwIOAddress, byData) \
35 iowrite8((u8)(byData), dwIOAddress)
37 #define VNSvOutPortW(dwIOAddress, wData) \
38 iowrite16((u16)(wData), dwIOAddress)
40 #define VNSvOutPortD(dwIOAddress, dwData) \
41 iowrite32((u32)(dwData), dwIOAddress)
43 #define PCAvDelayByIO(uDelayUnit) \
45 unsigned char byData; \
48 if (uDelayUnit <= 50) { \
51 for (ii = 0; ii < (uDelayUnit); ii++) \
56 /*--------------------- Export Classes ----------------------------*/
58 /*--------------------- Export Variables --------------------------*/
60 /*--------------------- Export Functions --------------------------*/
62 #endif /* __UPC_H__ */