2 * Interface to Unix specific code for performing card I/O
4 * Copyright (C) Eicon Technology Corporation, 2000.
6 * Eicon File Revision : 1.6
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
22 /* user callback, returns zero if interrupt was from this card */
23 typedef void isr_fn_t(void *);
46 * Get a card handle to enable card to be accessed
49 int UxCardHandleGet( ux_diva_card_t **card,
53 * Free a card handle as no longer needed
56 void UxCardHandleFree(ux_diva_card_t *card);
59 * Lock and unlock access to a card
62 long UxCardLock(ux_diva_card_t *card);
63 void UxCardUnlock(ux_diva_card_t *card, long ipl);
66 * Set the mapping address for PCI cards
69 int UxCardAddrMappingSet(ux_diva_card_t *card,
75 * Attach card to memory to enable it to be accessed
76 * Returns the mapped address
79 void *UxCardMemAttach(ux_diva_card_t *card, int id);
82 * map card out of memory after completion of access
85 void UxCardMemDetach(ux_diva_card_t *card, void *address);
88 * input functions for memory-mapped cards
91 byte UxCardMemIn(ux_diva_card_t *card, void *address);
93 word UxCardMemInW(ux_diva_card_t *card, void *address);
95 dword UxCardMemInD(ux_diva_card_t *card, void *address);
97 void UxCardMemInBuffer( ux_diva_card_t *card,
103 * output functions for memory-mapped cards
106 void UxCardMemOut(ux_diva_card_t *card, void *address, byte data);
108 void UxCardMemOutW(ux_diva_card_t *card, void *address, word data);
110 void UxCardMemOutD(ux_diva_card_t *card, void *address, dword data);
112 void UxCardMemOutBuffer( ux_diva_card_t *card,
118 * input functions for I/O-mapped cards
121 byte UxCardIoIn(ux_diva_card_t *card, void *, void *address);
123 word UxCardIoInW(ux_diva_card_t *card, void *, void *address);
125 dword UxCardIoInD(ux_diva_card_t *card, void *, void *address);
127 void UxCardIoInBuffer( ux_diva_card_t *card,
128 void *, void *address,
133 * output functions for I/O-mapped cards
136 void UxCardIoOut(ux_diva_card_t *card, void *, void *address, byte data);
138 void UxCardIoOutW(ux_diva_card_t *card, void *, void *address, word data);
140 void UxCardIoOutD(ux_diva_card_t *card, void *, void *address, dword data);
142 void UxCardIoOutBuffer( ux_diva_card_t *card,
143 void *, void *address,
148 * Get specified PCI config
151 void UxPciConfigRead(ux_diva_card_t *card,
157 * Set specified PCI config
160 void UxPciConfigWrite(ux_diva_card_t *card,
165 /* allocate memory, returning NULL if none available */
167 void *UxAlloc(unsigned int size);
172 * Pause for specified number of milli-seconds
175 void UxPause(long ms);
178 * Install an ISR for the specified card
181 int UxIsrInstall(ux_diva_card_t *card, isr_fn_t *isr_fn, void *isr_arg);
184 * Remove an ISR for the specified card
186 void UxIsrRemove(ux_diva_card_t *card, void *);
189 * DEBUG function to turn logging ON or OFF
192 void UxCardLog(int turn_on);
194 long UxInterlockedIncrement(ux_diva_card_t *card, long *dst);
195 long UxInterlockedDecrement(ux_diva_card_t *card, long *dst);
197 #endif /* of UXIO_H */