Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | /* * * Copyright (C) Eicon Technology Corporation, 2000. * * This source file is supplied for the exclusive use with Eicon * Technology Corporation's range of DIVA Server Adapters. * * Eicon File Revision : 1.6 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * Interface to Unix specific code for performing card I/O */ #if !defined(UXIO_H) #define UXIO_H #include "sys.h" #include "adapter.h" struct pt_regs; /* user callback, returns zero if interrupt was from this card */ typedef void isr_fn_t(void *); struct ux_diva_card_s { word in_use; int io_base; int reset_base; int card_type; byte *mapped; int bus_num; int func_num; int slot; int irq; byte *pDRAM; byte *pDEVICES; byte *pCONFIG; byte *pSHARED; byte *pCONTROL; word features; void *user_isr_arg; isr_fn_t *user_isr; }; void bcopy(void *pSource, void *pDest, dword dwLength); void bzero(void *pDataArea, dword dwLength); /* * Get a card handle to enable card to be accessed */ int UxCardHandleGet( ux_diva_card_t **card, dia_card_t *cfg); /* * Free a card handle as no longer needed */ void UxCardHandleFree(ux_diva_card_t *card); /* * Lock and unlock access to a card */ int UxCardLock(ux_diva_card_t *card); void UxCardUnlock(ux_diva_card_t *card, int ipl); /* * Set the mapping address for PCI cards */ int UxCardAddrMappingSet(ux_diva_card_t *card, int id, void *address, int size); /* * Attach card to memory to enable it to be accessed * Returns the mapped address */ void *UxCardMemAttach(ux_diva_card_t *card, int id); /* * map card out of memory after completion of access */ void UxCardMemDetach(ux_diva_card_t *card, void *address); /* * input functions for memory-mapped cards */ byte UxCardMemIn(ux_diva_card_t *card, void *address); word UxCardMemInW(ux_diva_card_t *card, void *address); dword UxCardMemInD(ux_diva_card_t *card, void *address); void UxCardMemInBuffer( ux_diva_card_t *card, void *address, void *buffer, int length); /* * output functions for memory-mapped cards */ void UxCardMemOut(ux_diva_card_t *card, void *address, byte data); void UxCardMemOutW(ux_diva_card_t *card, void *address, word data); void UxCardMemOutD(ux_diva_card_t *card, void *address, dword data); void UxCardMemOutBuffer( ux_diva_card_t *card, void *address, void *buffer, int length); /* * input functions for I/O-mapped cards */ byte UxCardIoIn(ux_diva_card_t *card, void *, void *address); word UxCardIoInW(ux_diva_card_t *card, void *, void *address); dword UxCardIoInD(ux_diva_card_t *card, void *, void *address); void UxCardIoInBuffer( ux_diva_card_t *card, void *, void *address, void *buffer, int length); /* * output functions for I/O-mapped cards */ void UxCardIoOut(ux_diva_card_t *card, void *, void *address, byte data); void UxCardIoOutW(ux_diva_card_t *card, void *, void *address, word data); void UxCardIoOutD(ux_diva_card_t *card, void *, void *address, dword data); void UxCardIoOutBuffer( ux_diva_card_t *card, void *, void *address, void *buffer, int length); /* * Get specified PCI config */ void UxPciConfigRead(ux_diva_card_t *card, int size, int offset, void *value); /* * Set specified PCI config */ void UxPciConfigWrite(ux_diva_card_t *card, int size, int offset, void *value); /* allocate memory, returning NULL if none available */ void *UxAlloc(unsigned int size); void UxFree(void *); /* * Pause for specified number of milli-seconds */ void UxPause(long ms); /* * Install an ISR for the specified card */ int UxIsrInstall(ux_diva_card_t *card, isr_fn_t *isr_fn, void *isr_arg); /* * Remove an ISR for the specified card */ void UxIsrRemove(ux_diva_card_t *card, void *); /* * DEBUG function to turn logging ON or OFF */ void UxCardLog(int turn_on); long UxInterlockedIncrement(ux_diva_card_t *card, long *dst); long UxInterlockedDecrement(ux_diva_card_t *card, long *dst); #endif /* of UXIO_H */ |