summaryrefslogtreecommitdiffstats
path: root/private/ntos/miniport/trantor/source/port.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--private/ntos/miniport/trantor/source/port.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/private/ntos/miniport/trantor/source/port.c b/private/ntos/miniport/trantor/source/port.c
new file mode 100644
index 000000000..e2246b3c6
--- /dev/null
+++ b/private/ntos/miniport/trantor/source/port.c
@@ -0,0 +1,62 @@
+//----------------------------------------------------------------------
+// File: PORT.C
+//
+// Contains generic port access routines.
+//
+// Revisions:
+// 01-08-93 KJB First.
+// 03-25-93 JAP Fixed up typedef and prototype inconsistencies
+//
+//----------------------------------------------------------------------
+
+#include CARDTXXX_H
+
+
+//
+// CardPortSet
+//
+// This routine sets a mask on a certain port. It or's the mask with
+// the value currently at the port. Works only for ports where all bits
+// are readable and writable.
+//
+
+VOID CardPortSet (PUCHAR baseIoAddress, UCHAR mask)
+{
+ UCHAR tmp;
+
+ CardPortGet (baseIoAddress,&tmp);
+ tmp = tmp | mask;
+ CardPortPut (baseIoAddress,tmp);
+}
+
+
+//
+// CardPortClear
+//
+// This routine clears a mask on a certain port. It and's the inverse with
+// the value currently at the port. Works only for ports where all bits
+// are readable and writable.
+//
+VOID CardPortClear (PUCHAR baseIoAddress, UCHAR mask)
+{
+ UCHAR tmp;
+
+ CardPortGet(baseIoAddress,&tmp);
+ tmp = tmp & (0xff ^ mask);
+ CardPortPut(baseIoAddress,tmp);
+}
+
+//
+// CardPortTest
+//
+// This routine clears a mask on a certain port. It and's the mask with
+// the value currently at the port. This result is returned.
+//
+BOOLEAN CardPortTest(PUCHAR baseIoAddress, UCHAR mask)
+{
+ UCHAR tmp;
+
+ CardPortGet(baseIoAddress,&tmp);
+ return (tmp & mask);
+}
+